summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.2.inc5
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.2/0048-gcc-Enable-static-PIE.patch39
2 files changed, 28 insertions, 16 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.2.inc b/meta/recipes-devtools/gcc/gcc-7.2.inc
index d5f9bea8b65..80cba2c35f3 100644
--- a/meta/recipes-devtools/gcc/gcc-7.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.2.inc
@@ -32,7 +32,9 @@ LIC_FILES_CHKSUM = "\
BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-7-branch;protocol=git"
SRCREV = "598768d5c31e9fc9a39a7530782068d4bdcb0891"
-#file://0048-gcc-Enable-static-PIE.patch
+# file://0048-gcc-Enable-static-PIE.patch : see the commit f96152b2b6ff8419a06de446339e9e7abc955ba2 PR driver/81523: Make -static override -pie
+# https://patchwork.ozlabs.org/patch/792907/
+
SRC_URI = "\
${BASEURI} \
file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
@@ -76,6 +78,7 @@ SRC_URI = "\
file://0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
file://0046-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
file://0047-sync-gcc-stddef.h-with-musl.patch \
+ file://0048-gcc-Enable-static-PIE.patch \
file://fix-segmentation-fault-precompiled-hdr.patch \
file://0050-RISC-V-Handle-non-legitimate-address-in-riscv_legiti.patch \
${BACKPORTS} \
diff --git a/meta/recipes-devtools/gcc/gcc-7.2/0048-gcc-Enable-static-PIE.patch b/meta/recipes-devtools/gcc/gcc-7.2/0048-gcc-Enable-static-PIE.patch
index 879e360cf38..a96e91339b0 100644
--- a/meta/recipes-devtools/gcc/gcc-7.2/0048-gcc-Enable-static-PIE.patch
+++ b/meta/recipes-devtools/gcc/gcc-7.2/0048-gcc-Enable-static-PIE.patch
@@ -7,31 +7,40 @@ Static PIE support in GCC
see
https://gcc.gnu.org/ml/gcc/2015-06/msg00008.html
+startfiles before patch:
+ -static -> crt1.o crti.o crtbeginT.o
+ -static -PIE -> crt1.o crti.o crtbeginT.o
+
+after patch:
+ -static -> crt1.o crti.o crtbeginT.o
+ -static -PIE -> rcrt1.o crti.o crtbeginS.o
+
Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
---
gcc/config/gnu-user.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
-index 2787a3d16be..ee7b781319e 100644
+index de605b0..b035bbe 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
-@@ -51,10 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
- #if defined HAVE_LD_PIE
+@@ -52,11 +52,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define GNU_USER_TARGET_STARTFILE_SPEC \
- "%{!shared: %{pg|p|profile:gcrt1.o%s;: \
-- %{" PIE_SPEC ":Scrt1.o%s} %{" NO_PIE_SPEC ":crt1.o%s}}} \
-- crti.o%s %{static:crtbeginT.o%s;: %{shared:crtbeginS.o%s} \
-+ %{" PIE_SPEC ":%{static:rcrt1.o%s;:Scrt1.o%s}} %{" NO_PIE_SPEC ":crt1.o%s}}} \
-+ crti.o%s %{shared:crtbeginS.o%s;: \
- %{" PIE_SPEC ":crtbeginS.o%s} \
-- %{" NO_PIE_SPEC ":crtbegin.o%s}} \
-+ %{" NO_PIE_SPEC ":%{static:crtbeginT.o%s;:crtbegin.o%s}}} \
+ "%{shared:; \
+ pg|p|profile:gcrt1.o%s; \
+- static:crt1.o%s; \
++ static: %{" PIE_SPEC ": rcrt1.o%s; :crt1.o%s}; \
+ " PIE_SPEC ":Scrt1.o%s; \
+ :crt1.o%s} \
+ crti.o%s \
+- %{static:crtbeginT.o%s; \
++ %{static: %{" PIE_SPEC ": crtbeginS.o%s; :crtbeginT.o%s}; \
+ shared|" PIE_SPEC ":crtbeginS.o%s; \
+ :crtbegin.o%s} \
%{fvtable-verify=none:%s; \
- fvtable-verify=preinit:vtv_start_preinit.o%s; \
- fvtable-verify=std:vtv_start.o%s} \
---
+
2.13.1