summaryrefslogtreecommitdiff
authorNathan Chancellor <natechancellor@gmail.com>2019-04-09 17:46:35 (GMT)
committer Nathan Chancellor <natechancellor@gmail.com>2019-04-09 18:31:53 (GMT)
commitfc67a895f0a58fc7c6dc82bf192382b98cd1e763 (patch)
tree806203fce6b309435207069faaec932f22fa8ac0
parent286f971000f15e3a619bb6f4730c38390af00cea (diff)
downloadcommon-fc67a895f0a58fc7c6dc82bf192382b98cd1e763.zip
common-fc67a895f0a58fc7c6dc82bf192382b98cd1e763.tar.gz
common-fc67a895f0a58fc7c6dc82bf192382b98cd1e763.tar.bz2
ANDROID: Makefile: Add '-fsplit-lto-unit' to cfi-clang-flags
After r350949 in clang, linking an CONFIG_CFI_CLANG kernel fails with the following error: aarch64-linux-gnu-ld.gold: fatal error: LLVM gold plugin: linking module flags 'EnableSplitLTOUnit': IDs have conflicting values -fsplit-lto-unit is needed when using -fsanitize-cfi so add the flag if it is supported by the compiler. CONFIG_CFI_CLANG works as expected with a tip of tree LLVM toolchain after this commit. Change-Id: I358ff024204c7abcef57b43a583ae960b89113f7 Link: https://github.com/ClangBuiltLinux/linux/issues/406 Link: https://github.com/llvm/llvm-project/commit/84cecfcb3db7c3275ae2d64c419a752d9f5311d6 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Diffstat
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 885b2d8..97d6ad4 100644
--- a/Makefile
+++ b/Makefile
@@ -694,7 +694,7 @@ export LDFINAL_vmlinux LDFLAGS_FINAL_vmlinux
endif
ifdef CONFIG_CFI_CLANG
-cfi-clang-flags += -fsanitize=cfi
+cfi-clang-flags += -fsanitize=cfi $(call cc-option, -fsplit-lto-unit)
DISABLE_CFI_CLANG := -fno-sanitize=cfi
ifdef CONFIG_MODULES
cfi-clang-flags += -fsanitize-cfi-cross-dso