summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0040-ssp_nonshared.patch28
3 files changed, 43 insertions, 29 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.1.inc b/meta/recipes-devtools/gcc/gcc-7.1.inc
index b52d51fba6..96fc11c943 100644
--- a/meta/recipes-devtools/gcc/gcc-7.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.1.inc
@@ -64,7 +64,7 @@ SRC_URI = "\
64 file://0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ 64 file://0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
65 file://0038-Fix-various-_FOR_BUILD-and-related-variables.patch \ 65 file://0038-Fix-various-_FOR_BUILD-and-related-variables.patch \
66 file://0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ 66 file://0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
67 file://0040-ssp_nonshared.patch \ 67 file://0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
68 file://0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch \ 68 file://0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
69 file://0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \ 69 file://0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
70 file://0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \ 70 file://0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta/recipes-devtools/gcc/gcc-7.1/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
new file mode 100644
index 0000000000..310f7aacba
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
@@ -0,0 +1,42 @@
1From 75a42d6d0f1f9784327f74882195a5c24843d5a8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 27 Jun 2017 18:10:54 -0700
4Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets
5
6when -fstack-protector options are enabled we need to
7link with ssp_shared on musl since it does not provide
8the __stack_chk_fail_local() so essentially it provides
9libssp but not libssp_nonshared something like
10TARGET_LIBC_PROVIDES_SSP_BUT_NOT_SSP_NONSHARED
11 where-as for glibc the needed symbols
12are already present in libc_nonshared library therefore
13we do not need any library helper on glibc based systems
14but musl needs the libssp_noshared from gcc
15
16Upstream-Status: Pending
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 gcc/config/linux.h | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23diff --git a/gcc/config/linux.h b/gcc/config/linux.h
24index 2e683d0c430..5ff0a2cb2ff 100644
25--- a/gcc/config/linux.h
26+++ b/gcc/config/linux.h
27@@ -182,6 +182,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
28 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
29 { 0, 0, 0, 0, 0, 0 } \
30 }
31+#ifdef TARGET_LIBC_PROVIDES_SSP
32+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
33+ "|fstack-protector-strong|fstack-protector-explicit" \
34+ ":-lssp_nonshared}"
35+#endif
36+
37 #endif
38
39 #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
40--
412.13.2
42
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0040-ssp_nonshared.patch b/meta/recipes-devtools/gcc/gcc-7.1/0040-ssp_nonshared.patch
deleted file mode 100644
index e9fb35cb91..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.1/0040-ssp_nonshared.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 6c98538411ac30c2262b2635547974c6cd1699c5 Mon Sep 17 00:00:00 2001
2From: Szabolcs Nagy <nsz@port70.net>
3Date: Sat, 7 Nov 2015 14:58:40 +0000
4Subject: [PATCH 40/47] ssp_nonshared
5
6---
7Upstream-Status: Inappropriate [OE-Specific]
8
9 gcc/gcc.c | 3 ++-
10 1 file changed, 2 insertions(+), 1 deletion(-)
11
12diff --git a/gcc/gcc.c b/gcc/gcc.c
13index 84af5d5a2e1..2c6471aa565 100644
14--- a/gcc/gcc.c
15+++ b/gcc/gcc.c
16@@ -872,7 +872,8 @@ proper position among the other output files. */
17 #ifndef LINK_SSP_SPEC
18 #ifdef TARGET_LIBC_PROVIDES_SSP
19 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
20- "|fstack-protector-strong|fstack-protector-explicit:}"
21+ "|fstack-protector-strong|fstack-protector-explicit" \
22+ ":-lssp_nonshared}"
23 #else
24 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
25 "|fstack-protector-strong|fstack-protector-explicit" \
26--
272.12.2
28