diff mbox

[21/21] x86: Enable Link Time Optimization

Message ID 20171127213423.27218-22-andi@firstfloor.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andi Kleen Nov. 27, 2017, 9:34 p.m. UTC
From: Andi Kleen <ak@linux.intel.com>

LTO is opt-in per architecture because it usually needs some
fixes.

LTO needs THIN_ARCHIVES because standard binutils doesn't like mixing
assembler and LTO code with ld -r.

Enable LTO and THIN_ARCHIVES for x86

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 8eed3f94bfc7..92650726f908 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -122,6 +122,8 @@  config X86
 	select HAVE_ARCH_VMAP_STACK		if X86_64
 	select HAVE_ARCH_WITHIN_STACK_FRAMES
 	select HAVE_CC_STACKPROTECTOR
+	select THIN_ARCHIVES			if LTO
+	select ARCH_SUPPORTS_LTO
 	select HAVE_CMPXCHG_DOUBLE
 	select HAVE_CMPXCHG_LOCAL
 	select HAVE_CONTEXT_TRACKING		if X86_64