aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-20 13:24:24 +0200
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit34ccadcd3334d695806acb84e4d4e5f4ef322e9e (patch)
tree0c9c960d22440e952ab627489619b445ec2e34c4
parent75c7d10c1f61ff509bcbe00284b7424b55c9ed92 (diff)
downloadu-boot-34ccadcd3334d695806acb84e4d4e5f4ef322e9e.zip
u-boot-34ccadcd3334d695806acb84e4d4e5f4ef322e9e.tar.gz
u-boot-34ccadcd3334d695806acb84e4d4e5f4ef322e9e.tar.bz2
ARM: don't use --gc-sections with LTO when using private libgcc
When using LTO, we can throw away the --gc-sections flag, but only if using private libgcc. When using system's libgcc, --gc-sections is still needed, otherwise linking will fail due to undefined references to libc's symbols. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/arm/config.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index f556ee3..16c63e1 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -15,7 +15,9 @@ CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections \
-fstack-protector-strong
CFLAGS_EFI := -fpic -fshort-wchar
+ifneq ($(CONFIG_LTO)$(CONFIG_USE_PRIVATE_LIBGCC),yy)
LDFLAGS_FINAL += --gc-sections
+endif
ifndef CONFIG_LTO
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections