Skip to contentSkip to conversation

Add as-option to top-level Makefile

PATCH In review Paul Mundt 2 participants 2 messages Feb 6, 2005

Subsystems (2)
lore
Share & tools
lore

Paul Mundt

author
#0 lore raw

PATCH 1/1 Add as-option to top-level Makefile

cc-option can presently not be used for checking as flags. It seems like MIPS ran into this already and added their own as-option (which at this point seems to be completely unused on MIPS, so perhaps it's worth removing entirely from there).

This patch moves the definition to the top-level Makefile so that others can make use of it (sh wants this with newer binutils that allow for ISA tuning, for instance).

Additionally, it may make more sense to move the -Wa$(comma) stuff into as-option directly so it doesn't get repeated all over the place (though it seems unlikely that there will be enough users that actually care about this).

===== Makefile 1.563 vs edited =====

Makefile +7 -0
@@ -279,6 +279,13 @@
 # cc support functions to be used (only) in arch/$(ARCH)/Makefile
 # See documentation in Documentation/kbuild/makefiles.txt
 
+# as-option
+# Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,)
+
+as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
+	     -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
+	     else echo "$(2)"; fi ;)
+
 # cc-option
 # Usage: cflags-y += $(call gcc-option, -march=winchip-c6, -march=i586)
 

===== arch/mips/Makefile 1.28 vs edited =====

arch/mips/Makefile +0 -4
@@ -12,10 +12,6 @@
 # for "archclean" cleaning up for this architecture.
 #
 
-as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
-	     -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
-	     else echo "$(2)"; fi ;)
-
 cflags-y :=
 
 #
#1 lore raw
Quoted 5 lines · Paul Mundt

cc-option can presently not be used for checking as flags. It seems like MIPS ran into this already and added their own as-option (which at this point seems to be completely unused on MIPS, so perhaps it's worth removing entirely from there).

Quoted 8 lines

This patch moves the definition to the top-level Makefile so that others can make use of it (sh wants this with newer binutils that allow for ISA tuning, for instance).

Additionally, it may make more sense to move the -Wa$(comma) stuff into as-option directly so it doesn't get repeated all over the place (though it seems unlikely that there will be enough users that actually care about this).

For MIPS as-option became unused when old binutils versions finally had to be retired. Patch looks good to me but since it's sort of a no-op patch I won't merge it into linux-mips.org but if accepted rather wait until it comes to me vi Linus's patches, as usual.

Thanks,

Ralf