]> git.sur5r.net Git - u-boot/blobdiff - lib_arm/config.mk
start a linker script helper file
[u-boot] / lib_arm / config.mk
index a13603e40917b32db8b9703814bbd01f1e8d3c92..705dfc306c4d578d0142f70fc610dc8ddb15858b 100644 (file)
@@ -25,4 +25,32 @@ CROSS_COMPILE ?= arm-linux-
 
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
+# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
+PLATFORM_CPPFLAGS += $(call cc-option,-marm,)
+
+# Try if EABI is supported, else fall back to old API,
+# i. e. for example:
+# - with ELDK 4.2 (EABI supported), use:
+#      -mabi=aapcs-linux -mno-thumb-interwork
+# - with ELDK 4.1 (gcc 4.x, no EABI), use:
+#      -mabi=apcs-gnu -mno-thumb-interwork
+# - with ELDK 3.1 (gcc 3.x), use:
+#      -mapcs-32 -mno-thumb-interwork
+PLATFORM_CPPFLAGS += $(call cc-option,\
+                               -mabi=aapcs-linux -mno-thumb-interwork,\
+                               $(call cc-option,\
+                                       -mapcs-32,\
+                                       $(call cc-option,\
+                                               -mabi=apcs-gnu,\
+                                       )\
+                               ) $(call cc-option,-mno-thumb-interwork,)\
+                       )
+
+# For EABI, make sure to provide raise()
+ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
+# This file is parsed several times; make sure to add only once.
+ifeq (,$(findstring lib_arm/eabi_compat.o,$(PLATFORM_LIBS)))
+PLATFORM_LIBS += $(OBJTREE)/lib_arm/eabi_compat.o
+endif
+endif
 LDSCRIPT := $(SRCTREE)/cpu/$(CPU)/u-boot.lds