aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2021-07-19 23:30:28 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2021-07-19 23:30:28 +0100
commit5013b9e50a671edefe6b0ce6c103dbeb621344c3 (patch)
tree37b3d2896953f795144b0a51ee47079aba780a72 /8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch
parent6.5.0: cut 6 patchset (diff)
downloadgcc-patches-5013b9e50a671edefe6b0ce6c103dbeb621344c3.tar.gz
gcc-patches-5013b9e50a671edefe6b0ce6c103dbeb621344c3.tar.bz2
gcc-patches-5013b9e50a671edefe6b0ce6c103dbeb621344c3.zip
8.5.0: apply powerpcspe pie and march patches
Two new patches: + 31_all_powerpcspe-pie-crt.patch + 32_all_powerpcspe-march-PLATFORM.patch Fix-by: Luke McHale Bug: https://bugs.gentoo.org/802930 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to '8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch')
-rw-r--r--8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch b/8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch
new file mode 100644
index 0000000..bb7354d
--- /dev/null
+++ b/8.5.0/gentoo/31_all_powerpcspe-pie-crt.patch
@@ -0,0 +1,95 @@
+https://bugs.gentoo.org/802930
+
+From 4e542386b97b648fd844e6b9d380c193fd662098 Mon Sep 17 00:00:00 2001
+From: Luke McHale <luke.mchale@protonmail.com>
+Date: Fri, 7 Aug 2020 16:40:11 +0000
+Subject: [PATCH] Bring powerpcspe STARTFILE_LINUX_SPEC up to date with the
+ newer PIE_SPEC decision tree from reference GNU_USER_TARGET_STARTFILE_SPEC.
+ Bring powerpcspe ENDFILE_LINUX_SPEC up to date with the newer PIE_SPEC
+ decision tree from reference GNU_USER_TARGET_STARTFILE_SPEC.
+
+Fixes issue where the incorrect start/end crti files are chosen when gcc is compiled with --enable-default-pie.
+---
+ gcc/config/powerpcspe/sysv4.h | 65 +++++++++++++++++++++++++++--------
+ 1 file changed, 50 insertions(+), 15 deletions(-)
+
+--- a/gcc/config/powerpcspe/sysv4.h
++++ b/gcc/config/powerpcspe/sysv4.h
+@@ -757,24 +757,59 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ #define CRTOFFLOADEND ""
+ #endif
+
+-#ifdef HAVE_LD_PIE
+-#define STARTFILE_LINUX_SPEC "\
+-%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+-%{mnewlib:ecrti.o%s;:crti.o%s} \
+-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
+-" CRTOFFLOADBEGIN
++/* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC
++ but with the mnewlib ecrti.o%s selection substituted for crti.o%s. */
++#if defined HAVE_LD_PIE
++#define STARTFILE_LINUX_SPEC \
++ "%{shared:; \
++ pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
++ static:crt1.o%s; \
++ static-pie:rcrt1.o%s; \
++ " PIE_SPEC ":Scrt1.o%s; \
++ :crt1.o%s} \
++ %{mnewlib:ecrti.o%s;:crti.o%s} \
++ %{static:crtbeginT.o%s; \
++ shared|static-pie|" 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} \
++ " CRTOFFLOADBEGIN
+ #else
+-#define STARTFILE_LINUX_SPEC "\
+-%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
+-%{mnewlib:ecrti.o%s;:crti.o%s} \
+-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
+-" CRTOFFLOADBEGIN
++#define STARTFILE_LINUX_SPEC \
++ "%{shared:; \
++ pg|p|profile:gcrt1.o%s; \
++ :crt1.o%s} \
++ %{mnewlib:ecrti.o%s;:crti.o%s} \
++ %{static:crtbeginT.o%s; \
++ shared|pie|static-pie:crtbeginS.o%s; \
++ :crtbegin.o%s} \
++ " CRTOFFLOADBEGIN
+ #endif
+
+-#define ENDFILE_LINUX_SPEC "\
+-%{shared|pie:crtendS.o%s;:crtend.o%s} \
+-%{mnewlib:ecrtn.o%s;:crtn.o%s} \
+-" CRTOFFLOADEND
++/* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC
++ but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s. */
++#if defined HAVE_LD_PIE
++#define ENDFILE_LINUX_SPEC \
++ "%{fvtable-verify=none:%s; \
++ fvtable-verify=preinit:vtv_end_preinit.o%s; \
++ fvtable-verify=std:vtv_end.o%s} \
++ %{static:crtend.o%s; \
++ shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
++ :crtend.o%s} \
++ %{mnewlib:ecrtn.o%s;:crtn.o%s} \
++ " CRTOFFLOADEND
++#else
++#define ENDFILE_LINUX_SPEC \
++ "%{fvtable-verify=none:%s; \
++ fvtable-verify=preinit:vtv_end_preinit.o%s; \
++ fvtable-verify=std:vtv_end.o%s} \
++ %{static:crtend.o%s; \
++ shared|pie|static-pie:crtendS.o%s; \
++ :crtend.o%s} \
++ %{mnewlib:ecrtn.o%s;:crtn.o%s} \
++ " CRTOFFLOADEND
++#endif
+
+ #define LINK_START_LINUX_SPEC ""
+
+--
+2.27.0
+