aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--4.5.0/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.5.0/gentoo/README.history1
-rw-r--r--4.5.1/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.5.1/gentoo/README.history1
-rw-r--r--4.5.2/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.5.2/gentoo/README.history1
-rw-r--r--4.5.3/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.5.3/gentoo/README.history3
-rw-r--r--4.6.0/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.6.0/gentoo/README.history1
-rw-r--r--4.6.1/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.6.1/gentoo/README.history1
-rw-r--r--4.6.2/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.6.2/gentoo/README.history1
-rw-r--r--4.6.3/gentoo/92_all_freebsd-pie.patch71
-rw-r--r--4.6.3/gentoo/README.history3
16 files changed, 580 insertions, 0 deletions
diff --git a/4.5.0/gentoo/92_all_freebsd-pie.patch b/4.5.0/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.5.0/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.5.0/gentoo/README.history b/4.5.0/gentoo/README.history
index 2fb369c..5359aea 100644
--- a/4.5.0/gentoo/README.history
+++ b/4.5.0/gentoo/README.history
@@ -4,6 +4,7 @@
+ 31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
+ 33_all_armhf.patch
U 53_all_gcc4-superh-default-multilib.patch
+ + 92_all_freebsd-pie.patch
- 94_all_gcc-4.3.3-pch-nostdinc-tr1.patch
+ 94_all_gcc-4.5-pch-nostdinc.patch
diff --git a/4.5.1/gentoo/92_all_freebsd-pie.patch b/4.5.1/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.5.1/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.5.1/gentoo/README.history b/4.5.1/gentoo/README.history
index bc92c5c..7a1263d 100644
--- a/4.5.1/gentoo/README.history
+++ b/4.5.1/gentoo/README.history
@@ -3,6 +3,7 @@
+ 30_all_gcc-4.5-ppc-msingle-pic-base.patch
+ 31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
+ 33_all_armhf.patch
+ + 92_all_freebsd-pie.patch
1.4 29 Nov 2010
U 90_all_gcc-4.5-graphite-ICE.patch
diff --git a/4.5.2/gentoo/92_all_freebsd-pie.patch b/4.5.2/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.5.2/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.5.2/gentoo/README.history b/4.5.2/gentoo/README.history
index d91ea45..f4e7fa5 100644
--- a/4.5.2/gentoo/README.history
+++ b/4.5.2/gentoo/README.history
@@ -5,6 +5,7 @@
+ 31_all_gcc-4.4-ppc-fpic-mrelocatable.patch
+ 33_all_armhf.patch
+ 62_all_gcc-4.5-ia64-pr43603.patch
+ + 92_all_freebsd-pie.patch
1.1 13 Feb 2011
+ 22_all_4.6_pr45094_arm-dword-move.patch
diff --git a/4.5.3/gentoo/92_all_freebsd-pie.patch b/4.5.3/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.5.3/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.5.3/gentoo/README.history b/4.5.3/gentoo/README.history
index 903c1a8..4419c77 100644
--- a/4.5.3/gentoo/README.history
+++ b/4.5.3/gentoo/README.history
@@ -1,3 +1,6 @@
+1.5 11 May 2012
+ + 92_all_freebsd-pie.patch
+
1.4 09 May 2012
+ 64_all_gcc-hppa-64bit-pr52408.patch
diff --git a/4.6.0/gentoo/92_all_freebsd-pie.patch b/4.6.0/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.6.0/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.6.0/gentoo/README.history b/4.6.0/gentoo/README.history
index ccf1c5d..1d4051a 100644
--- a/4.6.0/gentoo/README.history
+++ b/4.6.0/gentoo/README.history
@@ -1,6 +1,7 @@
1.3 [pending]
+ 27_all_gcj-glibc-2.15-pr50888.patch
+ 33_all_armhf.patch
+ + 92_all_freebsd-pie.patch
1.2 12 Apr 2011
+ 01_all_joined-cpp-defs.patch
diff --git a/4.6.1/gentoo/92_all_freebsd-pie.patch b/4.6.1/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.6.1/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.6.1/gentoo/README.history b/4.6.1/gentoo/README.history
index 866ba6b..3f91d32 100644
--- a/4.6.1/gentoo/README.history
+++ b/4.6.1/gentoo/README.history
@@ -1,6 +1,7 @@
1.1 [pending]
+ 27_all_gcj-glibc-2.15-pr50888.patch
+ 33_all_armhf.patch
+ + 92_all_freebsd-pie.patch
1.0 05 Jul 2011
+ 01_all_joined-cpp-defs.patch
diff --git a/4.6.2/gentoo/92_all_freebsd-pie.patch b/4.6.2/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.6.2/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.6.2/gentoo/README.history b/4.6.2/gentoo/README.history
index ef8e33e..fb71575 100644
--- a/4.6.2/gentoo/README.history
+++ b/4.6.2/gentoo/README.history
@@ -1,6 +1,7 @@
1.5 [pending]
+ 27_all_gcj-glibc-2.15-pr50888.patch
+ 33_all_armhf.patch
+ + 92_all_freebsd-pie.patch
1.4 20 Feb 2012
+ 76_all_4.7.0_c-family-headers.patch
diff --git a/4.6.3/gentoo/92_all_freebsd-pie.patch b/4.6.3/gentoo/92_all_freebsd-pie.patch
new file mode 100644
index 0000000..4905db7
--- /dev/null
+++ b/4.6.3/gentoo/92_all_freebsd-pie.patch
@@ -0,0 +1,71 @@
+https://bugs.gentoo.org/415185
+http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00555.html
+
+From: Alexis Ballier <aballier@gentoo.org>
+To: gcc-patches@gcc.gnu.org
+Cc: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 8 May 2012 09:53:43 -0400
+Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin,end}S.o and Scrt1.o which are PIC instead of crt{begin,end}.o and crt1.o which are not. Spec synced from gnu-user.h.
+
+gcc/config/i386/freebsd.h: Likewise.
+---
+ gcc/config/freebsd-spec.h | 9 +++------
+ gcc/config/i386/freebsd.h | 9 +++------
+ 2 files changed, 6 insertions(+), 12 deletions(-)
+
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 770a3d1..2808582 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ before entering `main'. */
+
+ #define FBSD_STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ `crtn.o'. */
+
+ #define FBSD_ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
+index 649274d..dd69e43 100644
+--- a/gcc/config/i386/freebsd.h
++++ b/gcc/config/i386/freebsd.h
+@@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+- "%{!shared: \
+- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+- %{!p:%{profile:gcrt1.o%s} \
+- %{!profile:crt1.o%s}}}} \
+- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
++ crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+ /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+@@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+ /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
+ for the special GCC options -static and -shared, which allow us to
+--
+1.7.8.6
diff --git a/4.6.3/gentoo/README.history b/4.6.3/gentoo/README.history
index ef8ee07..bd0cde3 100644
--- a/4.6.3/gentoo/README.history
+++ b/4.6.3/gentoo/README.history
@@ -1,3 +1,6 @@
+1.3 11 May 2012
+ + 92_all_freebsd-pie.patch
+
1.2 09 May 2012
+ 64_all_gcc-hppa-64bit-pr52408.patch