From 9a8a0e6fd9c5bc69523d082fa1db84973b25f5bc Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Wed, 24 Jul 2019 09:12:50 -0700 Subject: [PATCH] ANDROID: kernel/Makefile: do not disable LTO for sys_ni.c with CFI sys_ni.c compiles fine with CONFIG_LTO_CLANG, and disabling LTO for it breaks indirect call checking to functions in this file. Bug: 138254717 Change-Id: I7947cf3d0283ad37431860739665fee7fb0dfbdb Signed-off-by: Sami Tolvanen --- kernel/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/Makefile b/kernel/Makefile index 33dfa002d7b2..e968877d17ab 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -32,8 +32,10 @@ KCOV_INSTRUMENT_kcov.o := n KASAN_SANITIZE_kcov.o := n CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -# cond_syscall is currently not LTO compatible +ifndef CONFIG_CFI_CLANG +# cond_syscall is currently not gcc LTO compatible CFLAGS_sys_ni.o = $(DISABLE_LTO) +endif # Don't instrument error handlers CFLAGS_cfi.o = $(DISABLE_CFI_CLANG)