Skip to content

Commit d2dcd3e

Browse files
samitolvanenkees
authored andcommitted
x86, cpu: disable LTO for cpu.c
Clang incorrectly inlines functions with differing stack protector attributes, which breaks __restore_processor_state() that relies on stack protector being disabled. This change disables LTO for cpu.c to work aroung the bug. Link: https://bugs.llvm.org/show_bug.cgi?id=47479 Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Sami Tolvanen <[email protected]>
1 parent e242db4 commit d2dcd3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/power/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ OBJECT_FILES_NON_STANDARD_hibernate_asm_$(BITS).o := y
55
# itself be stack-protected
66
CFLAGS_cpu.o := -fno-stack-protector
77

8+
# Clang may incorrectly inline functions with stack protector enabled into
9+
# __restore_processor_state(): https://bugs.llvm.org/show_bug.cgi?id=47479
10+
CFLAGS_REMOVE_cpu.o := $(CC_FLAGS_LTO)
11+
812
obj-$(CONFIG_PM_SLEEP) += cpu.o
913
obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o hibernate.o

0 commit comments

Comments
 (0)