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)