Subject: [PATCH] Add as-option to top-level Makefile

From: Paul Mundt <[email-masked]>
Date: Sun, 6 Feb 2005 19:03:47 +0200

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 =====
--- 1.563/Makefile	2005-02-03 03:50:51 +02:00
+++ edited/Makefile	2005-02-06 18:50:49 +02:00
@@ -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 =====
--- 1.28/arch/mips/Makefile	2005-01-31 08:33:43 +02:00
+++ edited/arch/mips/Makefile	2005-02-06 18:49:20 +02:00
@@ -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 :=
 
 #

---

From: Ralf Baechle <[email-masked]>
Date: Sun, 6 Feb 2005 18:03:08 +0000

> it seems unlikely that there will be enough users that actually care

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