Skip to contentSkip to conversation

fsverity-utils Makefile fixes

PATCH Superseded Jes Sorensen 3 participants 7 messages May 20, 2020

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover fsverity-utils Makefile fixes

From: Jes Sorensen <[email protected]>

Hi

This addresses the comments to the previous version of these Makefile changes.

Let me know if you have any additional issues with it?

I'd really love to see an official release soon that includes these changes, which I can point to when submitting the RPM patches. Any chance of doing 1.1 or something like that?

Cheers,
Jes

Jes Sorensen (2):
Fix Makefile to delete objects from the library on make clean Let package manager override CFLAGS and CPPFLAGS

 Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 1/2 Fix Makefile to delete objects from the library on make clean

From: Jes Sorensen <[email protected]>

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 1a7be53..e7fb5cf 100644
@@ -180,8 +180,8 @@ help:
 	done
 
 clean:
-	rm -f $(DEFAULT_TARGETS) $(TEST_PROGRAMS) $(LIB_OBJS) $(ALL_PROG_OBJ) \
-		.build-config
+	rm -f $(DEFAULT_TARGETS) $(TEST_PROGRAMS) \
+		lib/*.o programs/*.o .build-config
 
 FORCE:
 
Signature · 1 line
2.26.2
#2 lore raw

PATCH v2 2/2 Let package manager override CFLAGS and CPPFLAGS

In reply to Jes Sorensen

From: Jes Sorensen <[email protected]>

Package managers such as RPM wants to build everything with their preferred flags, and we shouldn't hard override flags.

---
 Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Makefile +3 -4
index e7fb5cf..7bcd5e4 100644
@@ -32,15 +32,14 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
 #### Common compiler flags.  You can add additional flags by defining CFLAGS
 #### and/or CPPFLAGS in the environment or on the 'make' command line.
 
-override CFLAGS := -O2 -Wall -Wundef				\
+CFLAGS := -O2 -Wall -Wundef				\
 	$(call cc-option,-Wdeclaration-after-statement)		\
 	$(call cc-option,-Wmissing-prototypes)			\
 	$(call cc-option,-Wstrict-prototypes)			\
 	$(call cc-option,-Wvla)					\
-	$(call cc-option,-Wimplicit-fallthrough)		\
-	$(CFLAGS)
+	$(call cc-option,-Wimplicit-fallthrough)
 
-override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
+CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
 
 #### Other user settings
 
Signature · 1 line
2.26.2
maintainer
#3 lore raw

Re: [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS

Quoted 15 lines · Jes Sorensen

From: Jes Sorensen <[email protected]>

Package managers such as RPM wants to build everything with their preferred flags, and we shouldn't hard override flags.

---
 Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Makefile +0 -0
index e7fb5cf..7bcd5e4 100644

Makefile cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \ · line 33

Quoted 2 lines
Makefile +0 -0
@@ -32,15 +32,14 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
 #### Common compiler flags.  You can add additional flags by defining CFLAGS
 #### and/or CPPFLAGS in the environment or on the 'make' command line.

The above comment is still being made outdated. IMO, just remove it.

Makefile cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \ · line 42

Quoted 13 lines
Makefile +3 -4
-override CFLAGS := -O2 -Wall -Wundef				\
+CFLAGS := -O2 -Wall -Wundef				\
 	$(call cc-option,-Wdeclaration-after-statement)		\
 	$(call cc-option,-Wmissing-prototypes)			\
 	$(call cc-option,-Wstrict-prototypes)			\
 	$(call cc-option,-Wvla)					\
-	$(call cc-option,-Wimplicit-fallthrough)		\
-	$(CFLAGS)
+	$(call cc-option,-Wimplicit-fallthrough)
 
-override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
+CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)

On the other thread you ageed that CPPFLAGS should be left as-is, but here you removed 'override'. I think always using -D_FILE_OFFSET_BITS=64 is what we want, since it avoids incorrect builds on 32-bit platforms. Right?

- Eric

#4 lore raw

Re: [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS

Quoted 11 lines · Eric Biggers
Quoted 10 lines · Jes Sorensen

From: Jes Sorensen <[email protected]>

Package managers such as RPM wants to build everything with their preferred flags, and we shouldn't hard override flags.

---
 Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Quoted 9 lines

Makefile cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \ · line 33

Quoted 7 lines
Makefile +0 -0
index e7fb5cf..7bcd5e4 100644
@@ -32,15 +32,14 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
 #### Common compiler flags.  You can add additional flags by defining CFLAGS
 #### and/or CPPFLAGS in the environment or on the 'make' command line.

The above comment is still being made outdated. IMO, just remove it.

Good point, I'll send out a v3.

Quoted 11 lines
Quoted 11 lines
Makefile +2 -3
-override CFLAGS := -O2 -Wall -Wundef				\
+CFLAGS := -O2 -Wall -Wundef				\
 	$(call cc-option,-Wdeclaration-after-statement)		\
 	$(call cc-option,-Wmissing-prototypes)			\
 	$(call cc-option,-Wstrict-prototypes)			\
 	$(call cc-option,-Wvla)					\
-	$(call cc-option,-Wimplicit-fallthrough)		\
-	$(CFLAGS)
+	$(call cc-option,-Wimplicit-fallthrough)
 
Quoted 6 lines

Makefile cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \ · line 42

Quoted 2 lines
Makefile +1 -1
-override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
+CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)

On the other thread you ageed that CPPFLAGS should be left as-is, but here you removed 'override'. I think always using -D_FILE_OFFSET_BITS=64 is what we want, since it avoids incorrect builds on 32-bit platforms. Right?

That should work I think, I read your response as agreeing with me, hence leaving the change in place.

Cheers,
Jes

maintainer
#5 lore raw
In reply to Jes Sorensen
Quoted 7 lines · Jes Sorensen

From: Jes Sorensen <[email protected]>

Hi

This addresses the comments to the previous version of these Makefile changes.

Quoted 8 lines

Let me know if you have any additional issues with it?

I'd really love to see an official release soon that includes these changes, which I can point to when submitting the RPM patches. Any chance of doing 1.1 or something like that?

Cheers,
Jes

I'll release v1.1 after I merge the libfsverity patches, but I need to look over everything again first before committing to a stable API. I'll try to get to it this weekend; I'm also busy with a lot of other things.

Also, could you look over my patches and leave your Reviewed-by? I expected that you'd have a few more comments.

- Eric

#6 lore raw
Quoted 17 lines · Eric Biggers
Quoted 7 lines · Jes Sorensen

From: Jes Sorensen <[email protected]>

Hi

This addresses the comments to the previous version of these Makefile changes.

Quoted 8 lines

Let me know if you have any additional issues with it?

I'd really love to see an official release soon that includes these changes, which I can point to when submitting the RPM patches. Any chance of doing 1.1 or something like that?

Cheers,
Jes

Quoted 6 lines

I'll release v1.1 after I merge the libfsverity patches, but I need to look over everything again first before committing to a stable API. I'll try to get to it this weekend; I'm also busy with a lot of other things.

Also, could you look over my patches and leave your Reviewed-by? I expected that you'd have a few more comments.

Sounds good, I'll go over them again and add the Reviewed-by lines once I'm through.

Cheers,
Jes