multipath-tools: Makefile.inc: use -Wp,... for compiling only
authorMartin Wilck <mwilck@suse.com>
Sat, 12 Oct 2019 21:29:01 +0000 (21:29 +0000)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 2 Mar 2020 08:40:18 +0000 (09:40 +0100)
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

index 0c800ab..bfff9b8 100644 (file)
@@ -95,9 +95,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
@@ -134,4 +133,4 @@ check_file = $(shell \
 
 %.o:   %.c
        @echo building $@ because of $?
-       $(CC) $(CFLAGS) -c -o $@ $<
+       $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<