public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-01-25 19:51 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-01-25 19:51 UTC (permalink / raw
  To: gentoo-commits

commit:     8d6f5eeaafc371ae241c52e6acdc5fa8a5613f64
Author:     layman <layman <AT> localhost>
AuthorDate: Sat Jan 25 19:48:13 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 25 19:51:06 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=8d6f5eea

sys-devel/gcc: cp libgcc_s.so.1 to /usr/lib/ in musl's library path

---
 .../gcc/files/gcc-4.7.3-musl-linker-path.patch     | 10 +++
 sys-devel/gcc/files/gcc-spec-env-r1.patch          | 87 ++++++++++++++++++++++
 sys-devel/gcc/gcc-4.7.3-r99.ebuild                 | 13 ++++
 .../{gcc-4.7.3-r99.ebuild => gcc-4.8.2-r99.ebuild} | 46 +++++++-----
 sys-devel/gcc/metadata.xml                         |  6 +-
 5 files changed, 140 insertions(+), 22 deletions(-)

diff --git a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
new file mode 100644
index 0000000..875a2d6
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
@@ -0,0 +1,10 @@
+diff -Nuar gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h
+--- gcc-4.7.3.orig/gcc/config/i386/linux64.h	2011-07-07 15:38:34.000000000 +0000
++++ gcc-4.7.3/gcc/config/i386/linux64.h	2014-01-25 17:11:52.126098018 +0000
+@@ -29,5 +29,5 @@
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+ 
+ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER64 "/usr/lib/libc.so"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"

diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
new file mode 100644
index 0000000..a589268
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env-r1.patch
@@ -0,0 +1,87 @@
+2013-08-22  Magnus Granberg <zorry@gentoo.org>
+
+	* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
+	and move the process of the user specifed specs.
+
+    This allows us to easily control pie/ssp defaults with gcc-config profiles.
+    Original patch by Rob Holland
+    Extended to support multiple entries separated by ':' by Kevin F. Quinn
+    Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+    Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
+
+--- gcc-4.8-20130210/gcc/gcc.c	2013-02-05 16:55:31.000000000 +0100
++++ gcc-4.8-20130210-work/gcc/gcc.c	2013-07-26 02:32:14.625089864 +0200
+@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
+     do_option_spec (option_default_specs[i].name,
+ 		    option_default_specs[i].spec);
+ 
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++  /* Add specs listed in GCC_SPECS.  Note; in the process of separating
++   * each spec listed, the string is overwritten at token boundaries
++   * (':') with '\0', an effect of strtok_r().
++   */
++  specs_file = getenv ("GCC_SPECS");
++  if (specs_file && (strlen(specs_file) > 0))
++    {
++      char *spec, *saveptr;
++      for (spec=strtok_r(specs_file,":",&saveptr);
++           spec!=NULL;
++           spec=strtok_r(NULL,":",&saveptr))
++        {
++          struct user_specs *user = (struct user_specs *)
++            xmalloc (sizeof (struct user_specs));
++          user->next = (struct user_specs *) 0;
++          user->filename = spec;
++          if (user_specs_tail)
++            user_specs_tail->next = user;
++          else
++            user_specs_head = user;
++          user_specs_tail = user;
++        }
++    }
++#endif
++  /* Process any user specified specs in the order given on the command
++   *     line.  */
++  for (uptr = user_specs_head; uptr; uptr = uptr->next)
++    {
++      char *filename = find_a_file (&startfile_prefixes, uptr->filename,
++        R_OK, true);
++      read_specs (filename ? filename : uptr->filename, false, true);
++    }
++  /* Process any user self specs.  */
++  {
++    struct spec_list *sl;
++    for (sl = specs; sl; sl = sl->next)
++      if (sl->name_len == sizeof "self_spec" - 1
++          && !strcmp (sl->name, "self_spec"))
++        do_self_spec (*sl->ptr_spec);
++  }
++
+   /* Process DRIVER_SELF_SPECS, adding any new options to the end
+      of the command line.  */
+ 
+@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
+ 			      PREFIX_PRIORITY_LAST, 0, 1);
+     }
+ 
+-  /* Process any user specified specs in the order given on the command
+-     line.  */
+-  for (uptr = user_specs_head; uptr; uptr = uptr->next)
+-    {
+-      char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+-				    R_OK, true);
+-      read_specs (filename ? filename : uptr->filename, false, true);
+-    }
+-
+-  /* Process any user self specs.  */
+-  {
+-    struct spec_list *sl;
+-    for (sl = specs; sl; sl = sl->next)
+-      if (sl->name_len == sizeof "self_spec" - 1
+-	  && !strcmp (sl->name, "self_spec"))
+-	do_self_spec (*sl->ptr_spec);
+-  }
+-
+   if (compare_debug)
+     {
+       enum save_temps save;

diff --git a/sys-devel/gcc/gcc-4.7.3-r99.ebuild b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
index d7de607..3a5a93d 100644
--- a/sys-devel/gcc/gcc-4.7.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
@@ -2,6 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.7.3.ebuild,v 1.2 2013/05/20 10:56:06 aballier Exp $
 
+EAPI=4
+
 PATCH_VER="1.0"
 UCLIBC_VER="1.0"
 
@@ -41,6 +43,8 @@ src_unpack() {
 		cp libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver libstdc++-v3/config/os/gnu-linux/
 		mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
 		cp -r libitm/config/generic libitm/config/linux/x86
+
+		epatch "${FILESDIR}"/${P}-musl-linker-path.patch
 	fi
 
 	use vanilla && return 0
@@ -48,6 +52,15 @@ src_unpack() {
 	[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
 }
 
+src_install() {
+	toolchain_src_install
+
+	# Because /usr/lib/gcc/.. is not in musl search path
+	# cp-ing libgcc_s.so.1 is the safest way but it does
+	# mess up gcc-config which will need patching for this.
+	cp "${D}"/usr/lib/gcc/${CHOST}/${PV}/libgcc_s.so.1 "${D}"/usr/lib
+}
+
 pkg_setup() {
 	toolchain_pkg_setup
 }

diff --git a/sys-devel/gcc/gcc-4.7.3-r99.ebuild b/sys-devel/gcc/gcc-4.8.2-r99.ebuild
similarity index 51%
copy from sys-devel/gcc/gcc-4.7.3-r99.ebuild
copy to sys-devel/gcc/gcc-4.8.2-r99.ebuild
index d7de607..d99fab3 100644
--- a/sys-devel/gcc/gcc-4.7.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.8.2-r99.ebuild
@@ -1,37 +1,50 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.7.3.ebuild,v 1.2 2013/05/20 10:56:06 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.8.2.ebuild,v 1.9 2014/01/19 01:51:34 dirtyepic Exp $
 
-PATCH_VER="1.0"
+EAPI="2"
+
+PATCH_VER="1.3r1"
 UCLIBC_VER="1.0"
 
 # Hardened gcc 4 stuff
-PIE_VER="0.5.5"
+PIE_VER="0.5.8r1"
 SPECS_VER="0.2.0"
 SPECS_GCC_VER="4.4.3"
 # arch/libc configurations known to be stable with {PIE,SSP}-by-default
-PIE_GLIBC_STABLE="x86 amd64 ppc ppc64 arm ia64"
-PIE_UCLIBC_STABLE="x86 arm amd64 ppc ppc64"
-SSP_STABLE="amd64 x86 ppc ppc64 arm"
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
 # uclibc need tls and nptl support for SSP support
 # uclibc need to be >= 0.9.33
-SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
 #end Hardened stuff
 
-inherit toolchain eutils
+inherit eutils toolchain
 
 DESCRIPTION="The GNU Compiler Collection"
 
 LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
 
-KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -amd64-fbsd -x86-fbsd"
+KEYWORDS=""
 
 RDEPEND=""
 DEPEND="${RDEPEND}
-	>=${CATEGORY}/binutils-2.18"
+	elibc_glibc? ( >=sys-libs/glibc-2.8 )
+	>=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+	PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+	if has_version '<sys-libs/glibc-2.12' ; then
+		ewarn "Your host glibc is too old; disabling automatic fortify."
+		ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+		EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+	fi
 
-src_unpack() {
-	toolchain_src_unpack
+	toolchain_src_prepare
 
 	if use elibc_musl; then
 		cd "${S}"
@@ -45,9 +58,6 @@ src_unpack() {
 
 	use vanilla && return 0
 
-	[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
-}
-
-pkg_setup() {
-	toolchain_pkg_setup
+	#Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
+	[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
 }

diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
index a595b18..cc0d5da 100644
--- a/sys-devel/gcc/metadata.xml
+++ b/sys-devel/gcc/metadata.xml
@@ -3,22 +3,20 @@
 <pkgmetadata>
   <herd>toolchain</herd>
   <use>
+    <flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
+      (AWT) peer support on top of GTK+</flag>
     <flag name="d">Enable support for the D programming language</flag>
     <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets 
       in gcc (Warning: significantly increases compile time!)</flag>
     <flag name="go">Build the GCC Go language frontend.</flag>
     <flag name="graphite">Add support for the framework for loop
       optimizations based on a polyhedral intermediate representation</flag>
-    <flag name="gtk">Useful only when building GCJ, this enables Abstract Window Toolkit
-      (AWT) peer support on top of GTK+</flag>
     <flag name="ip28">Enable building a compiler capable of building a kernel
       for SGI Indigo2 Impact R10000 (IP28)</flag>
     <flag name="ip32r10k">Enable building a compiler capable of building an
       experimental kernel for SGI O2 w/ R1x000 CPUs (IP32)</flag>
     <flag name="libssp">Build SSP support into a dedicated library rather than use the
       code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
-    <flag name="lto">Add support for link-time optimizations (unsupported, use
-      at your own risk).</flag>
     <flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>
     <flag name="multislot">Allow for SLOTs to include minor version (3.3.4
     instead of just 3.3)</flag>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-02-27 13:15 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-02-27 13:15 UTC (permalink / raw
  To: gentoo-commits

commit:     8cf1cbefbebd9cccdb1259228465ee33dd93b436
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 27 13:17:17 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Feb 27 13:17:17 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=8cf1cbef

sys-devel/gcc: point to libc.so for linker for arm

Package-Manager: portage-2.2.7
Manifest-Sign-Key: 0xF52D4BBA

---
 .../gcc/files/gcc-4.7.3-musl-linker-path.patch     | 23 ++++++++++++++++++----
 sys-devel/gcc/gcc-4.7.3-r99.ebuild                 |  9 ++-------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
index 9128e44..d9d0df6 100644
--- a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
+++ b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
@@ -1,11 +1,26 @@
-diff -Nuar gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h
+diff -Naur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h
+--- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h	2014-02-26 11:35:12.955061913 +0000
++++ gcc-4.7.3/gcc/config/arm/linux-eabi.h	2014-02-26 11:40:46.800062073 +0000
+@@ -69,8 +69,8 @@
+    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
+ 
+ #undef  GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/usr/lib/libc.so"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/usr/lib/libc.so"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+diff -Naur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h
 --- gcc-4.7.3.orig/gcc/config/i386/linux64.h	2011-07-07 15:38:34.000000000 +0000
-+++ gcc-4.7.3/gcc/config/i386/linux64.h	2014-01-25 17:11:52.126098018 +0000
-@@ -29,5 +29,5 @@
++++ gcc-4.7.3/gcc/config/i386/linux64.h	2014-02-26 11:40:00.240062051 +0000
+@@ -28,6 +28,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
  #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
  
 -#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
-+#define GLIBC_DYNAMIC_LINKER32 "/usr/lib/libc.so"
 -#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/usr/lib/libc.so"
 +#define GLIBC_DYNAMIC_LINKER64 "/usr/lib/libc.so"
  #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"

diff --git a/sys-devel/gcc/gcc-4.7.3-r99.ebuild b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
index eb2a1a7..c4e8690 100644
--- a/sys-devel/gcc/gcc-4.7.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
@@ -44,6 +44,8 @@ src_prepare() {
 		EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
 	fi
 
+	toolchain_src_prepare
+
 	if use elibc_musl; then
 		cd "${S}"
 		sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
@@ -55,13 +57,6 @@ src_prepare() {
 		epatch "${FILESDIR}"/${P}-musl-linker-path.patch
 	fi
 
-	# drop the x32 stuff once 4.7 goes stable
-	if [[ ${CTARGET} != x86_64* ]] || ! has x32 $(get_all_abis TARGET) ; then
-		EPATCH_EXCLUDE+=" 90_all_gcc-4.7-x32.patch"
-	fi
-
-	toolchain_src_prepare
-
 	use vanilla && return 0
 
 	[[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-08-31 16:56 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-31 16:56 UTC (permalink / raw
  To: gentoo-commits

commit:     63ece5f00873afa800133b7adbc1616a619cf01b
Author:     Hinnerk van Bruinehsen <h.v.bruinehsen <AT> fu-berlin <DOT> de>
AuthorDate: Sun Aug 31 16:32:36 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 16:58:36 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=63ece5f0

Fix gcc-4.8.3-r99 build

From e060301e4cba9d3d5d5cb8777e4c76b4a909ed0c Mon Aug 31 18:31:21 2014
From: Hinnerk van Bruinehsen <h.v.bruinehsen <AT> fu-berlin.de>
Date: Sun, 31 Aug 2014 16:13:39 +0000
Subject: [PATCH] Fix gcc-4.8.3-r99 build

libsanitizer/tsan/tsan_platform_linux.cc uses __res_state *  which would
have to be either struct __res_state * or the typedef: res_state. The
patch uses the latter.

Signed-of-by: Hinnerk van Bruinehsen <h.v.bruinehsen <AT> fu-berlin.de>

---
 sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch | 12 ++++++++++++
 sys-devel/gcc/gcc-4.8.3-r99.ebuild                 |  1 +
 2 files changed, 13 insertions(+)

diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
new file mode 100644
index 0000000..7757c38
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
@@ -0,0 +1,12 @@
+diff -ENwbur gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc
+--- gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc	2014-08-31 12:50:18.381689906 +0000
++++ gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc	2014-08-31 13:12:19.838446253 +0000
+@@ -292,7 +292,7 @@
+ #ifndef TSAN_GO
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  res_state statp = (res_state)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];

diff --git a/sys-devel/gcc/gcc-4.8.3-r99.ebuild b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
index 4a64149..b96acf6 100644
--- a/sys-devel/gcc/gcc-4.8.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
@@ -57,6 +57,7 @@ src_prepare() {
 		mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
 		cp -r libitm/config/generic libitm/config/linux/x86
 		epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
+		epatch "${FILESDIR}"/${PN}-4.8.3-musl-res_state.patch
 	fi
 
 	use vanilla && return 0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-08-31 16:56 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-31 16:56 UTC (permalink / raw
  To: gentoo-commits

commit:     d5a627d73e0f4a62ec635c71b7a8734fb224b77b
Author:     Hinnerk van Bruinehsen <h.v.bruinehsen <AT> fu-berlin <DOT> de>
AuthorDate: Sun Aug 31 16:32:36 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Aug 31 16:59:05 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=d5a627d7

sys-devel/gcc-4.8.3-r99: fix build

libsanitizer/tsan/tsan_platform_linux.cc uses __res_state *  which would
have to be either struct __res_state * or the typedef: res_state. The
patch uses the latter.

Signed-of-by: Hinnerk van Bruinehsen <h.v.bruinehsen <AT> fu-berlin.de>

---
 sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch | 12 ++++++++++++
 sys-devel/gcc/gcc-4.8.3-r99.ebuild                 |  1 +
 2 files changed, 13 insertions(+)

diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
new file mode 100644
index 0000000..7757c38
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
@@ -0,0 +1,12 @@
+diff -ENwbur gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc
+--- gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc	2014-08-31 12:50:18.381689906 +0000
++++ gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc	2014-08-31 13:12:19.838446253 +0000
+@@ -292,7 +292,7 @@
+ #ifndef TSAN_GO
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+   int cnt = 0;
+-  __res_state *statp = (__res_state*)state;
++  res_state statp = (res_state)state;
+   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+       fds[cnt++] = statp->_u._ext.nssocks[i];

diff --git a/sys-devel/gcc/gcc-4.8.3-r99.ebuild b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
index 4a64149..b96acf6 100644
--- a/sys-devel/gcc/gcc-4.8.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
@@ -57,6 +57,7 @@ src_prepare() {
 		mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
 		cp -r libitm/config/generic libitm/config/linux/x86
 		epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
+		epatch "${FILESDIR}"/${PN}-4.8.3-musl-res_state.patch
 	fi
 
 	use vanilla && return 0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-10-24 21:51 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-10-24 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     62ea25d913176e609e6b0ddb21ea07e96bf5de70
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 24 21:52:47 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Oct 24 21:52:47 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=62ea25d9

sys-devel/gcc: fix build USE=gcj, bug #526618

Package-Manager: portage-2.2.8-r2
Manifest-Sign-Key: 0xF52D4BBA

---
 sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch | 11 +++++++++++
 sys-devel/gcc/gcc-4.8.3-r99.ebuild                            |  1 +
 2 files changed, 12 insertions(+)

diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch
new file mode 100644
index 0000000..65bc45e
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch
@@ -0,0 +1,11 @@
+--- /var/tmp/portage/sys-devel/gcc-4.8.3-r99/work/gcc-4.8.3/boehm-gc/os_dep.c	2013-03-06 15:08:58.000000000 +0000
++++ gcc-4.8.3.new/boehm-gc/os_dep.c	2014-10-24 18:25:39.963379871 +0000
+@@ -41,7 +41,7 @@
+ #     else /* not 2 <= __GLIBC__ */
+         /* libc5 doesn't have <sigcontext.h>: go directly with the kernel   */
+         /* one.  Check LINUX_VERSION_CODE to see which we should reference. */
+-#       include <asm/sigcontext.h>
++//#       include <asm/sigcontext.h>
+ #     endif /* 2 <= __GLIBC__ */
+ #   endif
+ # endif

diff --git a/sys-devel/gcc/gcc-4.8.3-r99.ebuild b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
index b96acf6..deb1c76 100644
--- a/sys-devel/gcc/gcc-4.8.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
@@ -58,6 +58,7 @@ src_prepare() {
 		cp -r libitm/config/generic libitm/config/linux/x86
 		epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
 		epatch "${FILESDIR}"/${PN}-4.8.3-musl-res_state.patch
+		epatch "${FILESDIR}"/${PN}-4.8.3-musl-fix-libc5-assumption.patch
 	fi
 
 	use vanilla && return 0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/
@ 2014-11-04 18:53 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-11-04 18:53 UTC (permalink / raw
  To: gentoo-commits

commit:     7e77904383bab15cbe131c2d32cf4e2d06dbb769
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Mon Nov  3 19:54:43 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Nov  4 18:41:48 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=7e779043

sys-devel/gcc: support for powerpc

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 .../gcc/files/gcc-4.7.3-musl-linker-path.patch     |  26 ++++
 .../files/gcc-4.7.3-powerpc-libc-stack-end.patch   | 171 +++++++++++++++++++++
 sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch     |  37 +++++
 .../gcc/files/gcc-4.8.3-musl-linker-path.patch     |  65 ++++++++
 sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch     |  43 ++++++
 sys-devel/gcc/gcc-4.7.4-r99.ebuild                 |   2 +
 sys-devel/gcc/gcc-4.8.3-r99.ebuild                 |   3 +-
 7 files changed, 346 insertions(+), 1 deletion(-)

diff --git a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
index df076f1..d454053 100644
--- a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
+++ b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
@@ -33,3 +33,29 @@ diff -Naur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linu
  
 -#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
 +#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-mipsel.so.1"
+diff -Naur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h
+--- gcc-4.7.3/gcc/config/rs6000/linux64.h	2014-10-11 18:59:07.479279989 -0200
++++ gcc-4.7.3/gcc/config/rs6000/linux64.h	2014-10-11 18:59:45.777801191 -0200
+@@ -358,8 +358,8 @@
+ #undef	LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+diff -Naur gcc-4.7.3/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h
+--- gcc-4.7.3/gcc/config/rs6000/sysv4.h	2014-10-11 19:00:03.079584889 -0200
++++ gcc-4.7.3/gcc/config/rs6000/sysv4.h	2014-10-11 19:00:28.476267387 -0200
+@@ -802,7 +802,7 @@
+ 
+ #define LINK_START_LINUX_SPEC ""
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"

diff --git a/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch b/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch
new file mode 100644
index 0000000..91c1b34
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch
@@ -0,0 +1,171 @@
+From: amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 15 Feb 2013 13:53:40 +0000 (+0000)
+Subject: 	PR target/55431
+X-Git-Tag: gcc-4_8_0-release~416
+X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/2a0bfd56d1b6a8ece8fb852691ea32713c7891b3
+
+	PR target/55431
+	* config/rs6000/linux-unwind.h (ppc_linux_aux_vector): Delete.
+	(ppc_fallback_frame_state): Always set up save locations for fp
+	and altivec.  Don't bother with non-callee-saved regs, r0-r13
+	except for r2 on ppc64, fr0-fr13, v0-v19, vscr.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196077 138bc75d-0d04-0410-961f-82ee72b054a4
+diff --git a/libgcc/config/rs6000/linux-unwind.h b/libgcc/config/rs6000/linux-unwind.h
+index 3a2da6e..c9273c4 100644
+--- a/libgcc/config/rs6000/linux-unwind.h
++++ b/libgcc/config/rs6000/linux-unwind.h
+@@ -26,7 +26,6 @@
+ #define R_CR2		70
+ #define R_VR0		77
+ #define R_VRSAVE	109
+-#define R_VSCR		110
+ 
+ struct gcc_vregs
+ {
+@@ -175,38 +174,6 @@ get_regs (struct _Unwind_Context *context)
+ }
+ #endif
+ 
+-/* Find an entry in the process auxiliary vector.  The canonical way to
+-   test for VMX is to look at AT_HWCAP.  */
+-
+-static long
+-ppc_linux_aux_vector (long which)
+-{
+-  /* __libc_stack_end holds the original stack passed to a process.  */
+-  extern long *__libc_stack_end;
+-  long argc;
+-  char **argv;
+-  char **envp;
+-  struct auxv
+-  {
+-    long a_type;
+-    long a_val;
+-  } *auxp;
+-
+-  /* The Linux kernel puts argc first on the stack.  */
+-  argc = __libc_stack_end[0];
+-  /* Followed by argv, NULL terminated.  */
+-  argv = (char **) __libc_stack_end + 1;
+-  /* Followed by environment string pointers, NULL terminated. */
+-  envp = argv + argc + 1;
+-  while (*envp++)
+-    continue;
+-  /* Followed by the aux vector, zero terminated.  */
+-  for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp)
+-    if (auxp->a_type == which)
+-      return auxp->a_val;
+-  return 0;
+-}
+-
+ /* Do code reading to identify a signal frame, and set the frame
+    state data appropriately.  See unwind-dw2.c for the structs.  */
+ 
+@@ -216,8 +183,8 @@ static _Unwind_Reason_Code
+ ppc_fallback_frame_state (struct _Unwind_Context *context,
+ 			  _Unwind_FrameState *fs)
+ {
+-  static long hwcap = 0;
+   struct gcc_regs *regs = get_regs (context);
++  struct gcc_vregs *vregs;
+   long new_cfa;
+   int i;
+ 
+@@ -229,12 +196,15 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
+   fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+   fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+ 
+-  for (i = 0; i < 32; i++)
+-    if (i != STACK_POINTER_REGNUM)
+-      {
+-	fs->regs.reg[i].how = REG_SAVED_OFFSET;
+-	fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
+-      }
++#ifdef __powerpc64__
++  fs->regs.reg[2].how = REG_SAVED_OFFSET;
++  fs->regs.reg[2].loc.offset = (long) &regs->gpr[2] - new_cfa;
++#endif
++  for (i = 14; i < 32; i++)
++    {
++      fs->regs.reg[i].how = REG_SAVED_OFFSET;
++      fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
++    }
+ 
+   fs->regs.reg[R_CR2].how = REG_SAVED_OFFSET;
+   /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit
+@@ -250,57 +220,35 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
+   fs->retaddr_column = ARG_POINTER_REGNUM;
+   fs->signal_frame = 1;
+ 
+-  if (hwcap == 0)
++  /* If we have a FPU...  */
++  for (i = 14; i < 32; i++)
+     {
+-      hwcap = ppc_linux_aux_vector (16);
+-      /* These will already be set if we found AT_HWCAP.  A nonzero
+-	 value stops us looking again if for some reason we couldn't
+-	 find AT_HWCAP.  */
+-#ifdef __powerpc64__
+-      hwcap |= 0xc0000000;
+-#else
+-      hwcap |= 0x80000000;
+-#endif
++      fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
++      fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
+     }
+ 
+-  /* If we have a FPU...  */
+-  if (hwcap & 0x08000000)
+-    for (i = 0; i < 32; i++)
+-      {
+-	fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+-	fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
+-      }
+-
+   /* If we have a VMX unit...  */
+-  if (hwcap & 0x10000000)
+-    {
+-      struct gcc_vregs *vregs;
+ #ifdef __powerpc64__
+-      vregs = regs->vp;
++  vregs = regs->vp;
+ #else
+-      vregs = &regs->vregs;
++  vregs = &regs->vregs;
+ #endif
+-      if (regs->msr & (1 << 25))
++  if (regs->msr & (1 << 25))
++    {
++      for (i = 20; i < 32; i++)
+ 	{
+-	  for (i = 0; i < 32; i++)
+-	    {
+-	      fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
+-	      fs->regs.reg[i + R_VR0].loc.offset
+-		= (long) &vregs->vr[i] - new_cfa;
+-	    }
+-
+-	  fs->regs.reg[R_VSCR].how = REG_SAVED_OFFSET;
+-	  fs->regs.reg[R_VSCR].loc.offset = (long) &vregs->vscr - new_cfa;
++	  fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
++	  fs->regs.reg[i + R_VR0].loc.offset = (long) &vregs->vr[i] - new_cfa;
+ 	}
+-
+-      fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
+-      fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
+     }
+ 
++  fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
++  fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
++
+   /* If we have SPE register high-parts... we check at compile-time to
+      avoid expanding the code for all other PowerPC.  */
+ #ifdef __SPE__
+-  for (i = 0; i < 32; i++)
++  for (i = 14; i < 32; i++)
+     {
+       fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET;
+       fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset

diff --git a/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch b/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch
new file mode 100644
index 0000000..6277824
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch
@@ -0,0 +1,37 @@
+adapted from musl-cross gcc-patches
+diff -r 6097333f2ab4 gcc/config/rs6000/secureplt.h
+--- a/gcc/config/rs6000/secureplt.h	Tue May 20 11:06:08 2014 -0400
++++ b/gcc/config/rs6000/secureplt.h	Tue May 20 11:06:11 2014 -0400
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+--- a/gcc/config/rs6000/sysv4.h	2012-04-30 19:39:01.000000000 -0200
++++ b/gcc/config/rs6000/sysv4.h	2014-10-21 10:24:03.631956578 -0200
+@@ -537,6 +537,9 @@
+     }						\
+   while (0)
+ #endif
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
+ 
+ #undef	ASM_SPEC
+ #define	ASM_SPEC "%(asm_cpu) \
+@@ -624,6 +627,7 @@
+ /* Override the default target of the linker.  */
+ #define	LINK_TARGET_SPEC "\
+ %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
++%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}} \
+ %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
+     %{mcall-i960-old: --oformat elf32-powerpcle} \
+   }}}}"
+@@ -938,6 +942,7 @@
+   { "cc1_endian_little",	CC1_ENDIAN_LITTLE_SPEC },		\
+   { "cc1_endian_default",	CC1_ENDIAN_DEFAULT_SPEC },		\
+   { "cc1_secure_plt_default",	CC1_SECURE_PLT_DEFAULT_SPEC },		\
++  { "link_secure_plt_default",	LINK_SECURE_PLT_DEFAULT_SPEC },		\
+   { "cpp_os_ads",		CPP_OS_ADS_SPEC },			\
+   { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
+   { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\

diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch
new file mode 100644
index 0000000..0f3d96c
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch
@@ -0,0 +1,65 @@
+diff -ur a/gcc-4.8.3/gcc/config/arm/linux-eabi.h b/gcc-4.8.3/gcc/config/arm/linux-eabi.h
+--- a/gcc-4.8.3/gcc/config/arm/linux-eabi.h	2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/arm/linux-eabi.h	2014-11-03 20:04:06.126283403 -0100
+@@ -68,8 +68,8 @@
+    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
+ 
+ #undef  GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+diff -ur a/gcc-4.8.3/gcc/config/i386/linux64.h b/gcc-4.8.3/gcc/config/i386/linux64.h
+--- a/gcc-4.8.3/gcc/config/i386/linux64.h	2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/i386/linux64.h	2014-11-03 20:04:06.126283403 -0100
+@@ -27,6 +27,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+diff -ur a/gcc-4.8.3/gcc/config/mips/linux.h b/gcc-4.8.3/gcc/config/mips/linux.h
+--- a/gcc-4.8.3/gcc/config/mips/linux.h	2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/mips/linux.h	2014-11-03 20:04:06.126283403 -0100
+@@ -17,4 +17,4 @@
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-mipsel.so.1"
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/linux64.h b/gcc-4.8.3/gcc/config/rs6000/linux64.h
+--- a/gcc-4.8.3/gcc/config/rs6000/linux64.h	2014-04-04 16:10:24.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/linux64.h	2014-11-03 20:06:28.219506993 -0100
+@@ -366,12 +366,8 @@
+ #undef	LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
+-#else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
+-#endif
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/sysv4.h b/gcc-4.8.3/gcc/config/rs6000/sysv4.h
+--- a/gcc-4.8.3/gcc/config/rs6000/sysv4.h	2014-04-04 15:50:31.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/sysv4.h	2014-11-03 20:04:06.128283378 -0100
+@@ -761,7 +761,7 @@
+ 
+ #define LINK_START_LINUX_SPEC ""
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"

diff --git a/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch b/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch
new file mode 100644
index 0000000..fc367ae
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch
@@ -0,0 +1,43 @@
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/secureplt.h b/gcc-4.8.3/gcc/config/rs6000/secureplt.h
+--- a/gcc-4.8.3/gcc/config/rs6000/secureplt.h	2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/secureplt.h	2014-11-03 20:41:01.696584962 -0100
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/sysv4.h b/gcc-4.8.3/gcc/config/rs6000/sysv4.h
+--- a/gcc-4.8.3/gcc/config/rs6000/sysv4.h	2014-04-04 15:50:31.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/sysv4.h	2014-11-03 20:42:30.098479787 -0100
+@@ -585,7 +585,8 @@
+ 
+ /* Override the default target of the linker.  */
+ #define	LINK_TARGET_SPEC \
+-  ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++  ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++  "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+ 
+ /* Any specific OS flags.  */
+ #define LINK_OS_SPEC "\
+@@ -894,6 +895,7 @@
+   { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
+   { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
+   { "cc1_secure_plt_default",	CC1_SECURE_PLT_DEFAULT_SPEC },		\
++  { "link_secure_plt_default",	LINK_SECURE_PLT_DEFAULT_SPEC },		\
+   { "cpp_os_ads",		CPP_OS_ADS_SPEC },			\
+   { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
+   { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\
+diff -ur a/gcc-4.8.3/gcc/config.gcc b/gcc-4.8.3/gcc/config.gcc
+--- a/gcc-4.8.3/gcc/config.gcc	2014-05-06 16:29:04.000000000 -0100
++++ b/gcc-4.8.3/gcc/config.gcc	2014-11-03 20:40:13.135192063 -0100
+@@ -2135,6 +2135,10 @@
+ 	    powerpc*-*-linux*paired*)
+ 		tm_file="${tm_file} rs6000/750cl.h" ;;
+ 	esac
++	case ${target} in
++	    *-linux*-musl*)
++		enable_secureplt=yes ;;
++	esac
+ 	if test x${enable_secureplt} = xyes; then
+ 		tm_file="rs6000/secureplt.h ${tm_file}"
+ 	fi

diff --git a/sys-devel/gcc/gcc-4.7.4-r99.ebuild b/sys-devel/gcc/gcc-4.7.4-r99.ebuild
index 52f95bb..e2735a5 100644
--- a/sys-devel/gcc/gcc-4.7.4-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.7.4-r99.ebuild
@@ -53,6 +53,8 @@ src_prepare() {
 		mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
 		cp -r libitm/config/generic libitm/config/linux/x86
 		epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
+		epatch "${FILESDIR}"/${PN}-4.7.3-powerpc-libc-stack-end.patch
+		epatch "${FILESDIR}"/${PN}-4.7.4-secure-plt.patch
 	fi
 
 	use vanilla && return 0

diff --git a/sys-devel/gcc/gcc-4.8.3-r99.ebuild b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
index 43e2ecf..99f7990 100644
--- a/sys-devel/gcc/gcc-4.8.3-r99.ebuild
+++ b/sys-devel/gcc/gcc-4.8.3-r99.ebuild
@@ -52,7 +52,8 @@ src_prepare() {
 		cp libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver libstdc++-v3/config/os/gnu-linux/
 		mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
 		cp -r libitm/config/generic libitm/config/linux/x86
-		epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
+		epatch "${FILESDIR}"/${PN}-4.8.3-musl-linker-path.patch
+		epatch "${FILESDIR}"/${PN}-4.8.3-secure-plt.patch
 		epatch "${FILESDIR}"/${PN}-4.8.3-musl-res_state.patch
 		epatch "${FILESDIR}"/${PN}-4.8.3-musl-fix-libc5-assumption.patch
 	fi


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-04 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-25 19:51 [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/, sys-devel/gcc/files/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2014-02-27 13:15 Anthony G. Basile
2014-08-31 16:56 Anthony G. Basile
2014-08-31 16:56 Anthony G. Basile
2014-10-24 21:51 Anthony G. Basile
2014-11-04 18:53 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox