]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/config.mk
Merge git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / arch / arm / config.mk
1 #
2 # (C) Copyright 2000-2002
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 CROSS_COMPILE ?= arm-linux-
9
10 ifndef CONFIG_STANDALONE_LOAD_ADDR
11 ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TI814X),)
12 CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
13 else
14 CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
15 endif
16 endif
17
18 LDFLAGS_FINAL += --gc-sections
19 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
20
21 # Support generic board on ARM
22 __HAVE_ARCH_GENERIC_BOARD := y
23
24 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
25
26 # Choose between ARM/Thumb instruction sets
27 ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
28 PF_CPPFLAGS_ARM := $(call cc-option, -mthumb -mthumb-interwork,\
29                         $(call cc-option,-marm,)\
30                         $(call cc-option,-mno-thumb-interwork,)\
31                 )
32 else
33 PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
34                 $(call cc-option,-mno-thumb-interwork,)
35 endif
36
37 # Only test once
38 ifneq ($(CONFIG_SPL_BUILD),y)
39 ALL-$(CONFIG_SYS_THUMB_BUILD)   += checkthumb
40 endif
41
42 # Try if EABI is supported, else fall back to old API,
43 # i. e. for example:
44 # - with ELDK 4.2 (EABI supported), use:
45 #       -mabi=aapcs-linux
46 # - with ELDK 4.1 (gcc 4.x, no EABI), use:
47 #       -mabi=apcs-gnu
48 # - with ELDK 3.1 (gcc 3.x), use:
49 #       -mapcs-32
50 PF_CPPFLAGS_ABI := $(call cc-option,\
51                         -mabi=aapcs-linux,\
52                         $(call cc-option,\
53                                 -mapcs-32,\
54                                 $(call cc-option,\
55                                         -mabi=apcs-gnu,\
56                                 )\
57                         )\
58                 )
59 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
60
61 # For EABI, make sure to provide raise()
62 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
63 # This file is parsed many times, so the string may get added multiple
64 # times. Also, the prefix needs to be different based on whether
65 # CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
66 # before adding the correct one.
67 ifdef CONFIG_SPL_BUILD
68 PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
69         $(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
70 else
71 PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
72         $(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
73 endif
74 endif
75
76 # needed for relocation
77 LDFLAGS_u-boot += -pie
78
79 #
80 # FIXME: binutils versions < 2.22 have a bug in the assembler where
81 # branches to weak symbols can be incorrectly optimized in thumb mode
82 # to a short branch (b.n instruction) that won't reach when the symbol
83 # gets preempted
84 #
85 # http://sourceware.org/bugzilla/show_bug.cgi?id=12532
86 #
87 ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
88 ifeq ($(GAS_BUG_12532),)
89 export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
90         then echo y; else echo n; fi)
91 endif
92 ifeq ($(GAS_BUG_12532),y)
93 PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
94 endif
95 endif
96
97 # check that only R_ARM_RELATIVE relocations are generated
98 ifneq ($(CONFIG_SPL_BUILD),y)
99 ALL-y   += checkarmreloc
100 endif