ARM: make LTO available
Make LTO available for ARM architecture.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/Kconfig b/arch/Kconfig
index 8fd39e3..49813a4 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -33,6 +33,7 @@
config ARM
bool "ARM architecture"
+ select ARCH_SUPPORTS_LTO
select CREATE_ARCH_SYMLINK
select HAVE_PRIVATE_LIBGCC if !ARM64
select SUPPORT_OF_CONTROL
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 61bef1d..7f66332 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -45,6 +45,8 @@
obj-y += bdinfo.o
obj-y += sections.o
+CFLAGS_REMOVE_sections.o := $(LTO_CFLAGS)
+
obj-y += stack.o
ifdef CONFIG_CPU_V7M
obj-y += interrupts_m.o