|
@@ -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
|