[xen master] build: filter out command line assembler arguments

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] build: filter out command line assembler arguments

patchbot
commit 07f141bfa6c748bdec0fc17aeb9fc20f9c939323
Author:     Roger Pau Monne <[hidden email]>
AuthorDate: Tue Feb 20 14:10:12 2018 +0000
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Wed Feb 21 17:17:39 2018 +0000

    build: filter out command line assembler arguments
   
    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é <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
---
 xen/Rules.mk          | 6 +++---
 xen/arch/x86/Makefile | 6 +++---
 xen/arch/x86/Rules.mk | 5 +----
 xen/include/Makefile  | 2 +-
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index da3c35b..2918019 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -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)
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index f327eca..7c6e93d 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -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
 
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 56b2ea8..1dc5c37 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -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
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 19066a3..69052ad 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -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)
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog