All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fsverity-utils Makefile fixes
@ 2020-05-15 20:56 Jes Sorensen
  2020-05-15 20:56 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen
  2020-05-15 20:56 ` [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS Jes Sorensen
  0 siblings, 2 replies; 8+ messages in thread
From: Jes Sorensen @ 2020-05-15 20:56 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

Hi,

This set goes on top of the libfsverity changes from Eric.

One deals with the Makefile not cleaning up the library when running
'make clean'.

The second removes the forced override of CFLAGS and CPPFLAGS. This
really shouldn't be forced like it was, since package managers and
builders should be able to specify their preferred flags.

With these applied, I am able to build an rpm of fsverity-utils which
provides fsverity-utils and fsverity-utils-devel.

Should we bump the version to 1.1 or 1.0.1 or something too?

Once this is pushed to the official branch, I'll do an updated package
for Fedora Rawhide and do another pull-request for the RPM code.

Cheers,
Jes


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

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Fix Makefile to delete objects from the library on make clean
  2020-05-15 20:56 [PATCH 0/2] fsverity-utils Makefile fixes Jes Sorensen
@ 2020-05-15 20:56 ` Jes Sorensen
  2020-05-20  2:42   ` Eric Biggers
  2020-05-15 20:56 ` [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS Jes Sorensen
  1 sibling, 1 reply; 8+ messages in thread
From: Jes Sorensen @ 2020-05-15 20:56 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 1a7be53..c5f46f4 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,7 @@ LIB_SRC         := $(wildcard lib/*.c)
 LIB_HEADERS     := $(wildcard lib/*.h) $(COMMON_HEADERS)
 STATIC_LIB_OBJ  := $(LIB_SRC:.c=.o)
 SHARED_LIB_OBJ  := $(LIB_SRC:.c=.shlib.o)
+LIB_OBJS        := $(SHARED_LIB_OBJ) $(STATIC_LIB_OBJ)
 
 # Compile static library object files
 $(STATIC_LIB_OBJ): %.o: %.c $(LIB_HEADERS) .build-config
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS
  2020-05-15 20:56 [PATCH 0/2] fsverity-utils Makefile fixes Jes Sorensen
  2020-05-15 20:56 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen
@ 2020-05-15 20:56 ` Jes Sorensen
  2020-05-20  2:54   ` Eric Biggers
  1 sibling, 1 reply; 8+ messages in thread
From: Jes Sorensen @ 2020-05-15 20:56 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

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

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c5f46f4..0c2a621 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ 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)			\
@@ -40,7 +40,7 @@ override CFLAGS := -O2 -Wall -Wundef				\
 	$(call cc-option,-Wimplicit-fallthrough)		\
 	$(CFLAGS)
 
-override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
+CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
 
 #### Other user settings
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] Fix Makefile to delete objects from the library on make clean
  2020-05-15 20:56 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen
@ 2020-05-20  2:42   ` Eric Biggers
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Biggers @ 2020-05-20  2:42 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

On Fri, May 15, 2020 at 04:56:48PM -0400, Jes Sorensen wrote:
> From: Jes Sorensen <jsorensen@fb.com>
> 
> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Makefile b/Makefile
> index 1a7be53..c5f46f4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -81,6 +81,7 @@ LIB_SRC         := $(wildcard lib/*.c)
>  LIB_HEADERS     := $(wildcard lib/*.h) $(COMMON_HEADERS)
>  STATIC_LIB_OBJ  := $(LIB_SRC:.c=.o)
>  SHARED_LIB_OBJ  := $(LIB_SRC:.c=.shlib.o)
> +LIB_OBJS        := $(SHARED_LIB_OBJ) $(STATIC_LIB_OBJ)
>  
>  # Compile static library object files
>  $(STATIC_LIB_OBJ): %.o: %.c $(LIB_HEADERS) .build-config
> -- 

Thanks for pointing this out.  I think it would be a bit easier to just use a
wildcard in the clean target, though.

diff --git a/Makefile b/Makefile
index 1a7be53..e7fb5cf 100644
--- a/Makefile
+++ b/Makefile
@@ -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:
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS
  2020-05-15 20:56 ` [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS Jes Sorensen
@ 2020-05-20  2:54   ` Eric Biggers
  2020-05-20 20:00     ` Jes Sorensen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Biggers @ 2020-05-20  2:54 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

On Fri, May 15, 2020 at 04:56:49PM -0400, Jes Sorensen wrote:
> From: Jes Sorensen <jsorensen@fb.com>
> 
> Package managers such as RPM wants to build everything with their
> preferred flags, and we shouldn't hard override flags.
> 
> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index c5f46f4..0c2a621 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -32,7 +32,7 @@ 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 needs to be updated.

>  
> -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)			\
> @@ -40,7 +40,7 @@ override CFLAGS := -O2 -Wall -Wundef				\
>  	$(call cc-option,-Wimplicit-fallthrough)		\
>  	$(CFLAGS)

The user's $(CFLAGS) is already added at the end, so the -O2 can already be
overridden, e.g. with -O0.  Is your concern just that this is bad practice?

Also, did you intentionally leave $(CFLAGS) at the end, rather than remove it as
might be expected?

> -override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
> +CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)

-D_FILE_OFFSET_BITS=64 is required for correctness.
So I think this part is good as-is.

- Eric

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS
  2020-05-20  2:54   ` Eric Biggers
@ 2020-05-20 20:00     ` Jes Sorensen
  0 siblings, 0 replies; 8+ messages in thread
From: Jes Sorensen @ 2020-05-20 20:00 UTC (permalink / raw)
  To: Eric Biggers, Jes Sorensen; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

On 5/19/20 10:54 PM, Eric Biggers wrote:
> On Fri, May 15, 2020 at 04:56:49PM -0400, Jes Sorensen wrote:
>> From: Jes Sorensen <jsorensen@fb.com>
>>
>> Package managers such as RPM wants to build everything with their
>> preferred flags, and we shouldn't hard override flags.
>>
>> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
>> ---
>>  Makefile | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index c5f46f4..0c2a621 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -32,7 +32,7 @@ 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 needs to be updated.

I'll fix that

>> -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)			\
>> @@ -40,7 +40,7 @@ override CFLAGS := -O2 -Wall -Wundef				\
>>  	$(call cc-option,-Wimplicit-fallthrough)		\
>>  	$(CFLAGS)
> 
> The user's $(CFLAGS) is already added at the end, so the -O2 can already be
> overridden, e.g. with -O0.  Is your concern just that this is bad practice?

I do think it's bad practice to hard add them, we should make
recommendations, but not policy. However, more importantly rpm fails the
build. It uses specific CFLAGS to do debug builds, and if the binary
ends up with build flags that do not match, it fails.

> Also, did you intentionally leave $(CFLAGS) at the end, rather than remove it as
> might be expected?

That was an oversight, I'll fix that.

>> -override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
>> +CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
> 
> -D_FILE_OFFSET_BITS=64 is required for correctness.
> So I think this part is good as-is.

Sounds good!

I'll send out an updated patchset shortly.

Cheers,
Jes



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Fix Makefile to delete objects from the library on make clean
  2020-05-20 21:25 [PATCH v3 0/2] fsverity-utils Makefile fixes Jes Sorensen
@ 2020-05-20 21:25 ` Jes Sorensen
  0 siblings, 0 replies; 8+ messages in thread
From: Jes Sorensen @ 2020-05-20 21:25 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1a7be53..e7fb5cf 100644
--- a/Makefile
+++ b/Makefile
@@ -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:
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] Fix Makefile to delete objects from the library on make clean
  2020-05-20 20:08 [PATCH v2 0/2] fsverity-utils Makefile fixes Jes Sorensen
@ 2020-05-20 20:08 ` Jes Sorensen
  0 siblings, 0 replies; 8+ messages in thread
From: Jes Sorensen @ 2020-05-20 20:08 UTC (permalink / raw)
  To: ebiggers; +Cc: linux-fscrypt, kernel-team, Jes Sorensen

From: Jes Sorensen <jsorensen@fb.com>

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1a7be53..e7fb5cf 100644
--- a/Makefile
+++ b/Makefile
@@ -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:
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-20 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 20:56 [PATCH 0/2] fsverity-utils Makefile fixes Jes Sorensen
2020-05-15 20:56 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen
2020-05-20  2:42   ` Eric Biggers
2020-05-15 20:56 ` [PATCH 2/2] Let package manager override CFLAGS and CPPFLAGS Jes Sorensen
2020-05-20  2:54   ` Eric Biggers
2020-05-20 20:00     ` Jes Sorensen
2020-05-20 20:08 [PATCH v2 0/2] fsverity-utils Makefile fixes Jes Sorensen
2020-05-20 20:08 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen
2020-05-20 21:25 [PATCH v3 0/2] fsverity-utils Makefile fixes Jes Sorensen
2020-05-20 21:25 ` [PATCH 1/2] Fix Makefile to delete objects from the library on make clean Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.