From 9e33b76c67638bdc740ed967e53c8c6489dcbbd3 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 29 Oct 2021 02:43:22 +0800 Subject: [PATCH] Re-enable LTO for linker Clang cannot build ifunc with LTO. This is a KI: https://bugs.llvm.org/show_bug.cgi?id=46488 Move the LTO: never down to libc itself, so that we can have LTO for the rest of linker. Test: m GLOBAL_THINLTO=true linker Change-Id: I483fc3944e340638a664fb390279e211c2ae224b --- libc/Android.bp | 7 ++++--- linker/Android.bp | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libc/Android.bp b/libc/Android.bp index 36d2019a0..00904aa43 100644 --- a/libc/Android.bp +++ b/libc/Android.bp @@ -122,6 +122,10 @@ cc_defaults { cflags: ["-DUSE_SCUDO"], }, }, + + lto: { + never: true, + }, } libc_scudo_product_variables = { @@ -1782,9 +1786,6 @@ cc_library { "com.android.runtime", ], - lto: { - never: true, - }, target: { native_bridge: { shared: { diff --git a/linker/Android.bp b/linker/Android.bp index f6f86fbcd..3ceafc75e 100644 --- a/linker/Android.bp +++ b/linker/Android.bp @@ -391,9 +391,6 @@ cc_binary { }, }, - lto: { - never: true, - }, pgo: { sampling: true, },