summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kexec
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2015-07-17 10:58:32 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-20 10:40:42 +0100
commitc49cfc2b2001615abffd8610e55654078edb8239 (patch)
tree8277dcdf18cf4067cd521ba84882de71600e77ac /meta/recipes-kernel/kexec
parent88dd997d9941b63ae9eead6690ecf2b785c0740c (diff)
downloadpoky-c49cfc2b2001615abffd8610e55654078edb8239.tar.gz
kexec-tools: disable the GCC's stack protection for purgatory code
If the GCC's stack protection is enabled by default, the purgatory will also be built with this option. But it makes no sense to enable this for the purgatory code, and would cause error when we are trying to relocate the purgatory codes because symbol like __stack_chk_fail is unresolved. Instead of disabling this for some archs specifically, disable it for all the archs. (From OE-Core rev: 466b0b2c572fb3201ca415b689ce7a950b8625a7) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/kexec')
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Disabling-GCC-s-stack-protection.patch64
-rw-r--r--meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Disabling-GCC-s-stack-protection.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Disabling-GCC-s-stack-protection.patch
new file mode 100644
index 0000000000..74a838704c
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Disabling-GCC-s-stack-protection.patch
@@ -0,0 +1,64 @@
1From 8227f5a583ad4523059ba2531263e625ac01cd40 Mon Sep 17 00:00:00 2001
2From: Kevin Hao <kexin.hao@windriver.com>
3Date: Tue, 28 Apr 2015 20:25:12 +0800
4Subject: [PATCH] purgatory: Disabling GCC's stack protection
5
6If the GCC's stack protection is enabled by default, the purgatory will
7also be built with this option. But it makes no sense to enable this
8for the purgatory code, and would cause error when we are trying to
9relocate the purgatory codes because symbol like __stack_chk_fail is
10unresolved. Instead of disabling this for some archs specifically,
11disable it for all the archs.
12
13Upstream-Status: Pending
14
15Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
16Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
17---
18 purgatory/Makefile | 3 ++-
19 purgatory/arch/ppc64/Makefile | 2 +-
20 purgatory/arch/s390/Makefile | 1 -
21 3 files changed, 3 insertions(+), 3 deletions(-)
22
23diff --git a/purgatory/Makefile b/purgatory/Makefile
24index 1945702..a25b262 100644
25--- a/purgatory/Makefile
26+++ b/purgatory/Makefile
27@@ -47,7 +47,8 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
28 $(PURGATORY): CC=$(TARGET_CC)
29 $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
30 $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
31- -Os -fno-builtin -ffreestanding
32+ -Os -fno-builtin -ffreestanding \
33+ -fno-stack-protector
34
35 $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
36 -I$(srcdir)/purgatory/include \
37diff --git a/purgatory/arch/ppc64/Makefile b/purgatory/arch/ppc64/Makefile
38index 6c58fa2..8ca2719 100644
39--- a/purgatory/arch/ppc64/Makefile
40+++ b/purgatory/arch/ppc64/Makefile
41@@ -9,7 +9,7 @@ ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/console-ppc64.c
42 ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/crashdump_backup.c
43 ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/misc.S
44
45-ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float -fno-stack-protector \
46+ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float \
47 -fno-exceptions
48 ppc64_PURGATORY_EXTRA_ASFLAGS += -m64
49 ifeq ($(SUBARCH),BE)
50diff --git a/purgatory/arch/s390/Makefile b/purgatory/arch/s390/Makefile
51index 09749bd..c94cc3c 100644
52--- a/purgatory/arch/s390/Makefile
53+++ b/purgatory/arch/s390/Makefile
54@@ -2,7 +2,6 @@
55 # Purgatory s390
56 #
57
58-s390_PURGATORY_EXTRA_CFLAGS += -fno-stack-protector
59 s390_PURGATORY_SRCS += purgatory/arch/s390/console-s390.c
60 s390_PURGATORY_SRCS += purgatory/arch/s390/setup-s390.S
61 s390_PURGATORY_SRCS += purgatory/arch/s390/purgatory-s390.c
62--
631.9.1
64
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb
index 36e4c15364..db5649b506 100644
--- a/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb
@@ -5,6 +5,7 @@ EXTRA_OECONF = " --with-zlib=yes"
5SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \ 5SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \
6 file://kexec-aarch64.patch \ 6 file://kexec-aarch64.patch \
7 file://kexec-x32.patch \ 7 file://kexec-x32.patch \
8 file://0001-purgatory-Disabling-GCC-s-stack-protection.patch \
8 " 9 "
9 10
10SRC_URI[md5sum] = "4ecb7ab7ad9eb6ce413899bdb07a8426" 11SRC_URI[md5sum] = "4ecb7ab7ad9eb6ce413899bdb07a8426"