diff mbox series

[67/72] multipath-tools: Makefile.inc: use -Wp, ... for compiling only

Message ID 20191012212703.12989-68-martin.wilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: cleanup and warning enablement | expand

Commit Message

Martin Wilck Oct. 12, 2019, 9:29 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

clang-3.9 errors out if -Wp,... preprocessor flags are used in the
linking stage.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile.inc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Benjamin Marzinski Oct. 30, 2019, 2:55 p.m. UTC | #1
On Sat, Oct 12, 2019 at 09:29:01PM +0000, Martin Wilck wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> clang-3.9 errors out if -Wp,... preprocessor flags are used in the
> linking stage.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  Makefile.inc | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index d4d08fe9..f309a274 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -96,9 +96,8 @@ OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \
>  		  -Werror=implicit-function-declaration -Werror=format-security \
>  		  -Wno-clobbered \
>  		  -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \
> -		  -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \
> -		  --param=ssp-buffer-size=4
> -
> +		  $(STACKPROT) --param=ssp-buffer-size=4
> +CPPFLAGS	:= -Wp,-D_FORTIFY_SOURCE=2 

Just a nit. The above line adds trailing whitespace.

-Ben

>  CFLAGS		:= $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \
>  		   -MMD -MP $(CFLAGS)
>  BIN_CFLAGS	= -fPIE -DPIE
> @@ -135,4 +134,4 @@ check_file = $(shell \
>  
>  %.o:	%.c
>  	@echo building $@ because of $?
> -	$(CC) $(CFLAGS) -c -o $@ $<
> +	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
> -- 
> 2.23.0

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/Makefile.inc b/Makefile.inc
index d4d08fe9..f309a274 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -96,9 +96,8 @@  OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \
 		  -Werror=implicit-function-declaration -Werror=format-security \
 		  -Wno-clobbered \
 		  -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \
-		  -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \
-		  --param=ssp-buffer-size=4
-
+		  $(STACKPROT) --param=ssp-buffer-size=4
+CPPFLAGS	:= -Wp,-D_FORTIFY_SOURCE=2 
 CFLAGS		:= $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \
 		   -MMD -MP $(CFLAGS)
 BIN_CFLAGS	= -fPIE -DPIE
@@ -135,4 +134,4 @@  check_file = $(shell \
 
 %.o:	%.c
 	@echo building $@ because of $?
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<