summaryrefslogtreecommitdiffstats
path: root/main/gcc/20_all_gcc46_config_crtbeginp.patch
blob: 67075ee4eab54a6ed3e5a570f03fa1b5eff1cad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2011-03-05		Magnus Granberg		<zorry@gentoo.org>

		* gcc/config/gnu-user.h			If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.
		* gcc/config/rs6000/sysv4.h		If ENABLE_CRTBEGINP, -static and -pie use crtbegineP.o.

--- ./gcc/config/gnu-user.h	2009-04-10 01:23:07.000000000 +0200
+++ ./gcc/config/gnu-user.h	2009-09-08 04:08:06.000000000 +0200
@@ -39,7 +39,11 @@
    provides part of the support for getting C++ file-scope static
    object constructed before entering `main'.  */
    
-#if defined HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#define GNU_USER_TARGET_STARTFILE_SPEC \
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \
+   %{static:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
 #define GNU_USER_TARGET_STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
--- ./gcc/config/rs6000/sysv4.h	2009-04-10 01:23:07.000000000 +0200
+++ ./gcc/config/rs6000/sysv4.h	2009-09-08 04:41:50.000000000 +0200
@@ -883,7 +883,12 @@
 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
 %{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
 
-#ifdef HAVE_LD_PIE
+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINP)
+#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:%{pie:crtbeginP.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}"
+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINP)
 #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} \