summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2017-09-01 18:43:42 -0400
committerNicolas Pitre <nicolas.pitre@linaro.org>2018-01-10 14:39:57 -0500
commit31e12874673c645a21f24d71187141238a69cc8f (patch)
treec97e9bc34d4825568057d456d36c09d7ed9380fe
parent1ec6585a456c5ba1ee06235cab79508c805150c6 (diff)
downloadlinux-lto-415.tar.gz
HACK: enable LTO on ARMlto-415
Without the ${KBUILD_VMLINUX_LIBS} move the build fails with missing memcpy all over the place. Didn't figure it out yet.
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/boot/compressed/Makefile2
-rwxr-xr-xscripts/link-vmlinux.sh2
3 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 438231500510..84450843ed0e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -17,6 +17,7 @@ config ARM
select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
select ARCH_SUPPORTS_ATOMIC_RMW
+ select ARCH_SUPPORTS_LTO
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_WANT_IPC_PARSE_VERSION
@@ -101,6 +102,7 @@ config ARM
select PERF_USE_VMALLOC
select RTC_LIB
select SYS_SUPPORTS_APM_EMULATION
+ select THIN_ARCHIVES if LTO
# Above selects are sorted alphabetically; please add new ones
# according to that. Thanks.
help
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 45a6b9b7af2a..39ac0a96399a 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -97,7 +97,7 @@ targets := vmlinux vmlinux.lds piggy_data piggy.o \
clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \
$(libfdt) $(libfdt_hdrs) hyp-stub.S
-KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING $(DISABLE_LTO)
ifeq ($(CONFIG_FUNCTION_TRACER),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 964b2ee855dd..0774a87788d3 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -99,9 +99,9 @@ vmlinux_link()
if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
objects="--whole-archive \
built-in.o \
+ ${KBUILD_VMLINUX_LIBS} \
--no-whole-archive \
--start-group \
- ${KBUILD_VMLINUX_LIBS} \
--end-group \
${1}"
else