- add cc-option and use it to check for stuff that is benefical for PREFER_IMA
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 12 Feb 2007 13:38:06 +0000 (13:38 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 12 Feb 2007 13:38:06 +0000 (13:38 -0000)
- backport the libbackend.o gcov-iov.h dependency fixup from 4.2 to 4.0

Makefile
package/setserial/setserial.mk
toolchain/Makefile.in
toolchain/gcc/4.0.4/402-libbackend_dep_gcov-iov.h.patch [new file with mode: 0644]

index 80e314c6a598205783e8073e4f1582e56378f1f9..6cb05d30c8d501762d4390bab0fd55a3e37f86bb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,13 @@ endif
 
 ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
 
+# cc-option
+# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
+# sets -march=winchip-c6 if supported else falls back to -march=i586
+# without checking the latter.
+cc-option = $(shell if $(TARGET_CC) $(TARGET_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+       > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+
 #############################################################
 #
 # The list of stuff to build for the target toolchain
index 604f7df2e2802404f71103d8ca85cdb43d5af212..cea3e541adfa36055a8f2c1bcf8bc2901210a7a8 100644 (file)
@@ -27,7 +27,7 @@ endif
        touch $@
 
 ifeq ($(BR2_PREFER_IMA),y)
-SETSERIAL_CFLAGS=--combine -fwhole-program
+SETSERIAL_CFLAGS=--combine $(CFLAGS_WHOLE_PROGRAM)
 endif
 
 $(SETSERIAL_DIR)/.configured: $(SETSERIAL_DIR)/.unpacked
index 1a2c0f26f5b9b4ef51731bade5993c3772ad0a9f..84e2ae42fedd819580a8659eae1b65b5956e230b 100644 (file)
@@ -14,5 +14,8 @@ endif
 # FIXME -- this is temporary
 OPTIMIZE_FOR_CPU=$(ARCH)
 
+# late binding check to see if the target cc supports -fwhole-program
+CFLAGS_WHOLE_PROGRAM = $(call cc-option,-fwhole-program,)
+
 # gcc has a bunch of needed stuff....
 include toolchain/gcc/Makefile.in
diff --git a/toolchain/gcc/4.0.4/402-libbackend_dep_gcov-iov.h.patch b/toolchain/gcc/4.0.4/402-libbackend_dep_gcov-iov.h.patch
new file mode 100644 (file)
index 0000000..89196d9
--- /dev/null
@@ -0,0 +1,11 @@
+--- gcc-4.0.4.orig/gcc/Makefile.in     2007-02-12 11:35:43.000000000 +0100
++++ gcc-4.0.4/gcc/Makefile.in  2007-02-12 11:38:04.000000000 +0100
+@@ -2202,7 +2202,7 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) 
+ # FIXME: writing proper dependencies for this is a *LOT* of work.
+ libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
+   insn-config.h insn-flags.h insn-codes.h insn-constants.h \
+-  insn-attr.h
++  insn-attr.h gcov-iov.h
+       $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+         -DTARGET_NAME=\"$(target_noncanonical)\" \
+         -DLOCALEDIR=\"$(localedir)\" \