2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-08-14 20:30:46 +00:00
|
|
|
#
|
|
|
|
# (C) Copyright 2000-2002
|
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2011-02-04 13:25:17 +00:00
|
|
|
ifndef CONFIG_STANDALONE_LOAD_ADDR
|
2017-04-25 04:10:11 +00:00
|
|
|
ifneq ($(CONFIG_ARCH_OMAP2PLUS),)
|
2011-02-04 13:25:17 +00:00
|
|
|
CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
|
2009-09-04 03:12:47 +00:00
|
|
|
else
|
2011-02-04 13:25:17 +00:00
|
|
|
CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
|
2009-09-04 03:12:47 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-11-07 15:47:10 +00:00
|
|
|
CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections
|
|
|
|
CFLAGS_EFI := -fpic -fshort-wchar
|
|
|
|
|
2013-04-25 07:40:22 +00:00
|
|
|
LDFLAGS_FINAL += --gc-sections
|
2013-09-07 08:42:37 +00:00
|
|
|
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
|
2013-12-14 03:47:35 +00:00
|
|
|
-fno-common -ffixed-r9
|
2014-01-15 02:00:45 +00:00
|
|
|
PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
|
|
|
|
$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
|
2013-04-25 07:40:22 +00:00
|
|
|
|
2016-03-16 23:55:55 +00:00
|
|
|
# LLVM support
|
2018-04-22 23:15:03 +00:00
|
|
|
LLVM_RELFLAGS := $(call cc-option,-mllvm,) \
|
|
|
|
$(call cc-option,-mno-movt,)
|
2016-03-16 23:55:55 +00:00
|
|
|
PLATFORM_RELFLAGS += $(LLVM_RELFLAGS)
|
|
|
|
|
2014-07-30 05:08:23 +00:00
|
|
|
PLATFORM_CPPFLAGS += -D__ARM__
|
2009-05-08 18:24:12 +00:00
|
|
|
|
2017-04-20 18:36:25 +00:00
|
|
|
ifdef CONFIG_ARM64
|
|
|
|
PLATFORM_ELFFLAGS += -B aarch64 -O elf64-littleaarch64
|
|
|
|
else
|
|
|
|
PLATFORM_ELFFLAGS += -B arm -O elf32-littlearm
|
|
|
|
endif
|
|
|
|
|
2012-03-08 07:20:19 +00:00
|
|
|
# Choose between ARM/Thumb instruction sets
|
2017-03-18 13:01:44 +00:00
|
|
|
ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
|
2014-12-18 17:10:33 +00:00
|
|
|
AFLAGS_IMPLICIT_IT := $(call as-option,-Wa$(comma)-mimplicit-it=always)
|
|
|
|
PF_CPPFLAGS_ARM := $(AFLAGS_IMPLICIT_IT) \
|
|
|
|
$(call cc-option, -mthumb -mthumb-interwork,\
|
2012-03-08 07:20:19 +00:00
|
|
|
$(call cc-option,-marm,)\
|
|
|
|
$(call cc-option,-mno-thumb-interwork,)\
|
|
|
|
)
|
|
|
|
else
|
|
|
|
PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
|
|
|
|
$(call cc-option,-mno-thumb-interwork,)
|
|
|
|
endif
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
|
2012-03-16 06:34:35 +00:00
|
|
|
# Only test once
|
2017-03-18 13:01:44 +00:00
|
|
|
ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
|
2017-04-17 13:18:00 +00:00
|
|
|
archprepare: checkthumb checkgcc6
|
2014-03-05 08:49:22 +00:00
|
|
|
|
|
|
|
checkthumb:
|
2016-01-20 01:39:02 +00:00
|
|
|
@if test "$(call cc-name)" = "gcc" -a \
|
|
|
|
"$(call cc-version)" -lt "0404"; then \
|
2014-03-05 08:49:22 +00:00
|
|
|
echo -n '*** Your GCC does not produce working '; \
|
|
|
|
echo 'binaries in THUMB mode.'; \
|
|
|
|
echo '*** Your board is configured for THUMB mode.'; \
|
|
|
|
false; \
|
|
|
|
fi
|
2017-04-17 13:18:00 +00:00
|
|
|
else
|
|
|
|
archprepare: checkgcc6
|
2014-03-05 08:49:22 +00:00
|
|
|
endif
|
2012-03-16 06:34:35 +00:00
|
|
|
|
2017-04-17 13:18:00 +00:00
|
|
|
checkgcc6:
|
|
|
|
@if test "$(call cc-name)" = "gcc" -a \
|
|
|
|
"$(call cc-version)" -lt "0600"; then \
|
2017-12-03 01:11:31 +00:00
|
|
|
echo '*** Your GCC is older than 6.0 and is not supported'; \
|
|
|
|
false; \
|
2017-04-17 13:18:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
# Try if EABI is supported, else fall back to old API,
|
|
|
|
# i. e. for example:
|
|
|
|
# - with ELDK 4.2 (EABI supported), use:
|
2012-03-08 07:20:19 +00:00
|
|
|
# -mabi=aapcs-linux
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
# - with ELDK 4.1 (gcc 4.x, no EABI), use:
|
2012-03-08 07:20:19 +00:00
|
|
|
# -mabi=apcs-gnu
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
# - with ELDK 3.1 (gcc 3.x), use:
|
2012-03-08 07:20:19 +00:00
|
|
|
# -mapcs-32
|
2011-11-01 20:54:02 +00:00
|
|
|
PF_CPPFLAGS_ABI := $(call cc-option,\
|
2012-03-08 07:20:19 +00:00
|
|
|
-mabi=aapcs-linux,\
|
2011-11-01 20:54:02 +00:00
|
|
|
$(call cc-option,\
|
|
|
|
-mapcs-32,\
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
$(call cc-option,\
|
2011-11-01 20:54:02 +00:00
|
|
|
-mabi=apcs-gnu,\
|
|
|
|
)\
|
2012-03-08 07:20:19 +00:00
|
|
|
)\
|
2011-11-01 20:54:02 +00:00
|
|
|
)
|
|
|
|
PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
|
|
|
|
# For EABI, make sure to provide raise()
|
|
|
|
ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
|
2011-07-19 05:51:41 +00:00
|
|
|
# This file is parsed many times, so the string may get added multiple
|
|
|
|
# times. Also, the prefix needs to be different based on whether
|
|
|
|
# CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
|
|
|
|
# before adding the correct one.
|
2014-02-27 13:40:34 +00:00
|
|
|
PLATFORM_LIBS := arch/arm/lib/eabi_compat.o \
|
|
|
|
$(filter-out arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
|
ARM: compiler options cleanup - improve tool chain support
For some time there have been repeated reports about build problems
with some ARM (cross) tool chains. Especially issues about
(in)compatibility with the tool chain provided runtime support
library libgcc.a caused to add and support a private implementation
of such runtime support code in U-Boot. A closer look at the code
indicated that some of these issues are actually home-made. This
patch attempts to clean up some of the most obvious problems and make
building of U-Boot with different tool chains easier:
- Even though all ARM systems basicy used the same compiler options
to select a specific ABI from the tool chain, the code for this was
distributed over all cpu/*/config.mk files. We move this one level
up into lib_arm/config.mk instead.
- So far, we only checked if "-mapcs-32" was supported by the tool
chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
selected, no matter if the tool chain actually understood this
option. There was no support for EABI conformant tool chains.
This patch implements the following logic:
1) If the tool chain supports
"-mabi=aapcs-linux -mno-thumb-interwork"
we use these options (EABI conformant tool chain).
2) Otherwise, we check first if
"-mapcs-32"
is supported, and then check for
"-mabi=apcs-gnu"
If one test succeeds, we use the first found option.
3) In case 2), we also test if "-mno-thumb-interwork", and use
this if the test succeeds. [For "-mabi=aapcs-linux" we set
"-mno-thumb-interwork" mandatorily.]
This way we use a similar logic for the compile options as the
Linux kernel does.
- Some EABI conformant tool chains cause external references to
utility functions like raise(); such functions are provided in the
new file lib_arm/eabi_compat.c
Note that lib_arm/config.mk gets parsed several times, so we must
make sure to add eabi_compat.o only once to the linker list.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Cc: Magnus Lilja <lilja.magnus@gmail.com>
Cc: Tom Rix <Tom.Rix@windriver.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Sergey Kubushyn <ksi@koi8.net>
Tested-by: Magnus Lilja <lilja.magnus@gmail.com>
Tested-by: Andrzej Wolski <awolski@poczta.fm>
Tested-by: Gaye Abdoulaye Walsimou <walsimou@walsimou.com>
Tested-by: Tom Rix <Tom.Rix@windriver.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-08-17 11:17:29 +00:00
|
|
|
endif
|
2010-10-11 11:13:28 +00:00
|
|
|
|
|
|
|
# needed for relocation
|
2011-01-27 06:03:49 +00:00
|
|
|
LDFLAGS_u-boot += -pie
|
2012-07-18 13:45:53 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# FIXME: binutils versions < 2.22 have a bug in the assembler where
|
|
|
|
# branches to weak symbols can be incorrectly optimized in thumb mode
|
|
|
|
# to a short branch (b.n instruction) that won't reach when the symbol
|
|
|
|
# gets preempted
|
|
|
|
#
|
|
|
|
# http://sourceware.org/bugzilla/show_bug.cgi?id=12532
|
|
|
|
#
|
2017-03-18 13:01:44 +00:00
|
|
|
ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
|
2012-07-18 13:45:53 +00:00
|
|
|
ifeq ($(GAS_BUG_12532),)
|
|
|
|
export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
|
|
|
|
then echo y; else echo n; fi)
|
|
|
|
endif
|
|
|
|
ifeq ($(GAS_BUG_12532),y)
|
|
|
|
PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
|
|
|
|
endif
|
|
|
|
endif
|
2013-06-11 12:17:30 +00:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_SPL_BUILD),y)
|
2013-08-24 11:55:38 +00:00
|
|
|
# Check that only R_ARM_RELATIVE relocations are generated.
|
|
|
|
ALL-y += checkarmreloc
|
|
|
|
# The movt / movw can hardcode 16 bit parts of the addresses in the
|
|
|
|
# instruction. Relocation is not supported for that case, so disable
|
|
|
|
# such usage by requiring word relocations.
|
|
|
|
PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations)
|
2016-01-30 04:10:49 +00:00
|
|
|
PLATFORM_CPPFLAGS += $(call cc-option, -fno-pic)
|
2013-06-11 12:17:30 +00:00
|
|
|
endif
|
2013-11-07 13:21:46 +00:00
|
|
|
|
|
|
|
# limit ourselves to the sections we want in the .bin.
|
2013-12-14 03:47:35 +00:00
|
|
|
ifdef CONFIG_ARM64
|
2016-12-08 03:58:22 +00:00
|
|
|
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \
|
2017-11-14 01:55:02 +00:00
|
|
|
-j .u_boot_list -j .rela.dyn -j .got -j .got.plt \
|
|
|
|
-j .binman_sym_table
|
2013-12-14 03:47:35 +00:00
|
|
|
else
|
2016-07-05 13:45:06 +00:00
|
|
|
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
|
2017-11-14 01:55:02 +00:00
|
|
|
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \
|
|
|
|
-j .binman_sym_table
|
2013-12-14 03:47:35 +00:00
|
|
|
endif
|
2014-02-24 02:12:21 +00:00
|
|
|
|
2017-05-25 16:23:58 +00:00
|
|
|
# if a dtb section exists we always have to include it
|
|
|
|
# there are only two cases where it is generated
|
|
|
|
# 1) OF_EMBEDED is turned on
|
|
|
|
# 2) unit tests include device tree blobs
|
2014-07-06 23:21:44 +00:00
|
|
|
OBJCOPYFLAGS += -j .dtb.init.rodata
|
|
|
|
|
2016-03-04 00:10:01 +00:00
|
|
|
ifdef CONFIG_EFI_LOADER
|
|
|
|
OBJCOPYFLAGS += -j .efi_runtime -j .efi_runtime_rel
|
|
|
|
endif
|
|
|
|
|
2014-02-24 02:12:21 +00:00
|
|
|
ifneq ($(CONFIG_IMX_CONFIG),)
|
|
|
|
ifdef CONFIG_SPL
|
|
|
|
ifndef CONFIG_SPL_BUILD
|
|
|
|
ALL-y += SPL
|
|
|
|
endif
|
|
|
|
else
|
2014-03-31 07:50:35 +00:00
|
|
|
ifeq ($(CONFIG_OF_SEPARATE),y)
|
|
|
|
ALL-y += u-boot-dtb.imx
|
|
|
|
else
|
2014-02-24 02:12:21 +00:00
|
|
|
ALL-y += u-boot.imx
|
|
|
|
endif
|
|
|
|
endif
|
2016-09-26 07:08:06 +00:00
|
|
|
ifneq ($(CONFIG_VF610),)
|
|
|
|
ALL-y += u-boot.vyb
|
|
|
|
endif
|
2014-03-31 07:50:35 +00:00
|
|
|
endif
|
2016-11-07 15:47:10 +00:00
|
|
|
|
|
|
|
EFI_LDS := elf_arm_efi.lds
|
|
|
|
EFI_CRT0 := crt0_arm_efi.o
|
|
|
|
EFI_RELOC := reloc_arm_efi.o
|