]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
build: filter out command line assembler arguments
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 20 Feb 2018 14:10:12 +0000 (14:10 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 21 Feb 2018 17:17:39 +0000 (17:17 +0000)
If the assembler is not used. This happens when using cc -E or cc -S
for example. GCC will just ignore the -Wa,... when the assembler is
not called, but clang will complain loudly and fail.

Also enable passing -Wa,-I$(BASEDIR)/include to clang now that it's
safe to do so.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/Rules.mk
xen/arch/x86/Makefile
xen/arch/x86/Rules.mk
xen/include/Makefile

index da3c35ba363141fb66fe9d035c633e909445c8be..2918019b927aa1f15d3602df079808241d278005 100644 (file)
@@ -208,13 +208,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o Makefile
        $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
 
 %.i: %.c Makefile
-       $(CPP) $(CFLAGS) $< -o $@
+       $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) $< -o $@
 
 %.s: %.c Makefile
-       $(CC) $(CFLAGS) -S $< -o $@
+       $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -S $< -o $@
 
 # -std=gnu{89,99} gets confused by # as an end-of-line comment marker
 %.s: %.S Makefile
-       $(CPP) $(AFLAGS) $< -o $@
+       $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) $< -o $@
 
 -include $(DEPS_INCLUDE)
index f327ecaec530cf91f5e5ae191aea77ed984ade44..7c6e93d560175695547cf78179db08da6c729f85 100644 (file)
@@ -213,15 +213,15 @@ efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: $(BASEDIR)/arch/x86/ef
 efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o: ;
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
-       $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
+       $(CC) $(filter-out -Wa$(comma)% -flto,$(CFLAGS)) -S -o $@ $<
 
 xen.lds: xen.lds.S
-       $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $<
+       $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
        sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new
        mv -f .xen.lds.d.new .xen.lds.d
 
 efi.lds: xen.lds.S
-       $(CC) -P -E -Ui386 -DEFI $(AFLAGS) -o $@ $<
+       $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
        sed -e 's/efi\.lds\.o:/efi\.lds:/g' <.$(@F).d >.$(@F).d.new
        mv -f .$(@F).d.new .$(@F).d
 
index 56b2ea835679f6a8502d183d6e31b6c689c1adcf..1dc5c3785aa71e641d2eae4d0bc3c3284fd232f7 100644 (file)
@@ -42,8 +42,5 @@ CFLAGS += -DCONFIG_INDIRECT_THUNK
 export CONFIG_INDIRECT_THUNK=y
 endif
 
-# Set up the assembler include path properly for older GCC toolchains.  Clang
-# objects to the agument being passed however.
-ifneq ($(clang),y)
+# Set up the assembler include path properly for older toolchains.
 CFLAGS += -Wa,-I$(BASEDIR)/include
-endif
index 19066a33a0879d7d54189abe573dee801e4ae92e..69052ade2429c07ec4c3ceee6afdade403d1782a 100644 (file)
@@ -65,7 +65,7 @@ compat/%.h: compat/%.i Makefile $(BASEDIR)/tools/compat-build-header.py
        mv -f $@.new $@
 
 compat/%.i: compat/%.c Makefile
-       $(CPP) $(filter-out -M% %.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
+       $(CPP) $(filter-out -Wa$(comma)% -M% %.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
 
 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
        mkdir -p $(@D)