Makefile.in: add -mtext-section-literals to xtensa ABI

Collecting literals into separate section can be advantageous if that
section is placed into DTCM at link time. This is applicable for code
running on bare metal, but makes no sense under linux, where userspace
is isolated from the physical memory details. OTOH placing literals into
separate section breaks build of huge source files, because l32r
instruction can only access literals in 256 KBytes range.

Add -mtext-section-literals into xtensa ABI to fix build issues of
packages with huge sources.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Max Filippov 2014-03-30 21:57:46 +04:00 committed by Thomas Petazzoni
parent 1b1b8fbca7
commit c6277e4b31

View File

@ -72,8 +72,17 @@ endif
# and is required for some packages. While this option can degrade both
# code size and performance, the linker can usually optimize away the
# overhead when a call ends up within a certain range.
#
# Use text-section-literals for Xtensa globally.
# Collecting literals into separate section can be advantageous if that
# section is placed into DTCM at link time. This is applicable for code
# running on bare metal, but makes no sense under linux, where userspace
# is isolated from the physical memory details. OTOH placing literals into
# separate section breaks build of huge source files, because l32r
# instruction can only access literals in 256 KBytes range.
#
ifeq ($(BR2_xtensa),y)
TARGET_ABI += -mlongcalls
TARGET_ABI += -mlongcalls -mtext-section-literals
endif
STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot