pmaports/main/gcc6/fix-rs6000-pie.patch
Oliver Smith 737cff798a
Add gcc6 aport
Based on the last version from Alpine, but installed to /usr/gcc6 and
with pretty much everything disabled except for the C compiler.

We can probably throw out a lot of patches, and make the APKBUILD much
smaller. But let's focus on making it possible to compile old kernels
again first. There's still a lot to do for that, see #103.
2018-11-27 07:47:11 +01:00

59 lines
2 KiB
Diff

--- 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 ""