]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Make sure only supported compiler options are used
authorWolfgang Denk <wd@pollux.denx.de>
Tue, 4 Oct 2005 20:38:24 +0000 (22:38 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Tue, 4 Oct 2005 20:38:24 +0000 (22:38 +0200)
Import "cc-option" shell function from kernel and
use it to get the correct ARM GCC options for individual CPUs
Patch by Peter Pearse, 30 Jun 2005

12 files changed:
CHANGELOG
config.mk
cpu/arm1136/config.mk
cpu/arm720t/config.mk
cpu/arm920t/config.mk
cpu/arm925t/config.mk
cpu/arm926ejs/config.mk
cpu/ixp/config.mk
cpu/lh7a40x/config.mk
cpu/pxa/config.mk
cpu/s3c44b0/config.mk
cpu/sa1100/config.mk

index 4498d8a481ba9526aa2fa98a082087540581d52d..fc1f8e3de3a32e0a98e4ef2f6f4e62964849588c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,11 @@
 Changes for U-Boot 1.1.4:
 ======================================================================
 
+* Make sure only supported compiler options are used
+  Import "cc-option" shell function from kernel and
+  use it to get the correct ARM GCC options for individual CPUs
+  Patch by Peter Pearse, 30 Jun 2005
+
 * Fix 440GR to print correct cpu revision
   Patch by Stefan Roese, 4 Oct 2005
 
index ff83091746887aad0e44a0e03113c75863f68a91..0f104398c27fc1cacc6474d1a11e605fa45a1006 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -86,6 +86,12 @@ HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTSTRIP      = strip
 
 #########################################################################
+#
+# Option checker (courtesy linux kernel) to ensure
+# only supported compiler options are used
+#
+cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
 #
 # Include the make variables (CC, etc...)
index ca9dc2564e7568b9a111878490b80cb25df71f21..cbcf92b3f8c69fc939ec4513bdeafc5090e4286f 100644 (file)
 # MA 02111-1307 USA
 #
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
+       -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5
+PLATFORM_CPPFLAGS += -march=armv5
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
+
index 2d797090556324cbfe3a6f16496da244032307ef..e5dce9d03c6e9844eb6b974829723be67f28bd1b 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=arm7tdmi
index cef7d26f1cb48b8c84642a58a80d050d3e3a756b..3c7a279791ea0faf6d5cb48081cabacbc5bdabe3 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
index cef7d26f1cb48b8c84642a58a80d050d3e3a756b..3c7a279791ea0faf6d5cb48081cabacbc5bdabe3 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
index cef7d26f1cb48b8c84642a58a80d050d3e3a756b..3c7a279791ea0faf6d5cb48081cabacbc5bdabe3 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
index 667adfc25d05e292bed0a6cfe68be9f0c48a0ad7..2f735c552cc7d7aa956433bb5cd08d9c5da22c30 100644 (file)
 BIG_ENDIAN = y
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float -mbig-endian
+       -msoft-float -mbig-endian
+
+PLATFORM_CPPFLAGS += -mbig-endian -march=armv4 -mtune=strongarm1100
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# =========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mbig-endian -mapcs-32 -march=armv4 -mtune=strongarm1100
index cef7d26f1cb48b8c84642a58a80d050d3e3a756b..5062ba22d9915f9f04b5bc098dea6212f8e2b57a 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# ========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4
index 6030c49c2e4ec9e953fa6548cd0966c536af661f..0e386984288551bebf7b308acc331e75d2ee5e7c 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
 
 #PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5 -mtune=xscale
+PLATFORM_CPPFLAGS += -march=armv5 -mtune=xscale
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# ========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
+
index a1c5dd10a5cd23e1aa9d6e012309220f5f8a94d8..0052ba4f8dabe7a87f4dd851693a9473c2a43b63 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi -msoft-float
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# ========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=arm7tdmi -msoft-float
index c40dcf861498cd0dbb6e9f3dc817a43ae73681ba..3bed8503a17d88d932fb5321ee2e295f9a57816c 100644 (file)
 #
 
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
-       -mshort-load-bytes -msoft-float
+       -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100
+# =========================================================================
+#
+# Supply options according to compiler version
+#
+# ========================================================================
+PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
-PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100