summaryrefslogtreecommitdiff
path: root/system/gcc/fix-rs6000-pie.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:53:51 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:54:20 -0600
commit6d7203982c05651f748825deb393eb6480c03e32 (patch)
treef771531d5103dede68a6c9f52b349d8ba04cbb09 /system/gcc/fix-rs6000-pie.patch
parent866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (diff)
downloadpackages-6d7203982c05651f748825deb393eb6480c03e32.tar.gz
packages-6d7203982c05651f748825deb393eb6480c03e32.tar.bz2
packages-6d7203982c05651f748825deb393eb6480c03e32.tar.xz
packages-6d7203982c05651f748825deb393eb6480c03e32.zip
system/gcc: maintain our own toolchain
Diffstat (limited to 'system/gcc/fix-rs6000-pie.patch')
-rw-r--r--system/gcc/fix-rs6000-pie.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/system/gcc/fix-rs6000-pie.patch b/system/gcc/fix-rs6000-pie.patch
new file mode 100644
index 000000000..1fbc31a56
--- /dev/null
+++ b/system/gcc/fix-rs6000-pie.patch
@@ -0,0 +1,59 @@
+--- gcc-6.3.0.orig/gcc/config/rs6000/sysv4.h
++++ gcc-6.3.0/gcc/config/rs6000/sysv4.h
+@@ -753,23 +753,42 @@
+ #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
++#define STARTFILE_LINUX_SPEC \
++ "%{!shared: %{pg|p|profile:gcrt1.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 ":%{static:crtbeginT.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}} \
++ crti.o%s %{static:crtbeginT.o%s;shared|pie: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
+ #endif
+
+-#define ENDFILE_LINUX_SPEC "\
+-%{shared|pie:crtendS.o%s;:crtend.o%s} \
+-%{mnewlib:ecrtn.o%s;:crtn.o%s} \
+-" CRTOFFLOADEND
++#ifdef 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} \
++ %{shared:crtendS.o%s;: %{" PIE_SPEC ":crtendS.o%s} \
++ %{" NO_PIE_SPEC ":crtend.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} \
++ %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s \
++ " CRTOFFLOADEND
++#endif
+
+ #define LINK_START_LINUX_SPEC ""
+