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 <samitolvanen@google.com>
This commit is contained in:
Sami Tolvanen
2019-07-24 09:12:50 -07:00
parent b9079579b0
commit 9a8a0e6fd9

View File

@@ -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)