Revert "ANDROID: kbuild: add support for Clang LTO"
This reverts commit 310afefe71d480d563f3691b74bff61a53ba81ca as the LTO
feature causes merge issues with 5.8-rc1. So remove it for now and
allow the developer to add the latest version of the patches later on.
Cc: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4f30d8544545860dd1a70bd18a63b9a1673c6c6a
diff --git a/Makefile b/Makefile
index 61aaf02..5d8d571 100644
--- a/Makefile
+++ b/Makefile
@@ -674,16 +674,6 @@
export RETPOLINE_CFLAGS
export RETPOLINE_VDSO_CFLAGS
-# Make toolchain changes before including arch/$(SRCARCH)/Makefile to ensure
-# ar/cc/ld-* macros return correct values.
-ifdef CONFIG_LTO_CLANG
-# LTO produces LLVM IR instead of object files. Use llvm-ar and llvm-nm, so we
-# can process these.
-AR := llvm-ar
-LLVM_NM := llvm-nm
-export LLVM_NM
-endif
-
include arch/$(SRCARCH)/Makefile
ifdef need-config
@@ -876,22 +866,6 @@
KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone)
endif
-ifdef CONFIG_LTO_CLANG
-ifdef CONFIG_THINLTO
-CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)
-KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache
-else
-CC_FLAGS_LTO_CLANG := -flto
-endif
-CC_FLAGS_LTO_CLANG += -fvisibility=default
-endif
-
-ifdef CONFIG_LTO
-CC_FLAGS_LTO := $(CC_FLAGS_LTO_CLANG)
-KBUILD_CFLAGS += $(CC_FLAGS_LTO)
-export CC_FLAGS_LTO
-endif
-
ifdef CONFIG_CFI_CLANG
CC_FLAGS_CFI := -fsanitize=cfi \
-fno-sanitize-cfi-canonical-jump-tables \
@@ -1807,8 +1781,7 @@
-o -name '.tmp_*.o.*' \
-o -name '*.c.[012]*.*' \
-o -name '*.ll' \
- -o -name '*.gcno' \
- -o -name '*.*.symversions' \) -type f -print | xargs rm -f
+ -o -name '*.gcno' \) -type f -print | xargs rm -f
# Generate tags for editors
# ---------------------------------------------------------------------------