[PATCH] Disable GCC stack protector for purgatory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Modern versions of GCC enable the stack protector by default. This causes
Linux kernels build using such GCC versions to complain about undefined
references to `__stack_chk_fail` in purgatory whenever `kexec_file_load`
is used.

Fix this by building purgatory with `-fno-stack-protector`.

Signed-off-by: Marcel Krüger <linux@xxxxxxxxxxx>
---
 arch/s390/purgatory/Makefile | 1 +
 arch/x86/purgatory/Makefile  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
index ce6a3f75065b..61820af85903 100644
--- a/arch/s390/purgatory/Makefile
+++ b/arch/s390/purgatory/Makefile
@@ -23,6 +23,7 @@ KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
 KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
 KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
 KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
 KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))

 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile
index 3cf302b26332..f8519959a47e 100644
--- a/arch/x86/purgatory/Makefile
+++ b/arch/x86/purgatory/Makefile
@@ -22,6 +22,7 @@ KCOV_INSTRUMENT := n
 KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -Os -mcmodel=large
 KBUILD_CFLAGS += -m$(BITS)
 KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)

 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
                $(call if_changed,ld)
--
2.20.1



_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux