Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit fc67a895 authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

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: default avatarNathan Chancellor <natechancellor@gmail.com>
parent 286f9710
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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