Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-devel/gcc/
Date: Sun, 26 Jan 2014 16:27:06
Message-Id: 1390753631.6dda96651d6a1ec966640d16b4c771c93bad8f57.blueness@gentoo
1 commit: 6dda96651d6a1ec966640d16b4c771c93bad8f57
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Sun Jan 26 16:23:58 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 26 16:27:11 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=6dda9665
7
8 sys-devel/gcc: use /usr/etc/ld-musl-x86_64.path for library paths
9
10 Package-Manager: portage-2.2.7
11
12 ---
13 sys-devel/gcc/gcc-4.7.3-r99.ebuild | 44 ++++++++++++++++++++------------------
14 1 file changed, 23 insertions(+), 21 deletions(-)
15
16 diff --git a/sys-devel/gcc/gcc-4.7.3-r99.ebuild b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
17 index 3a5a93d..f5c9989 100644
18 --- a/sys-devel/gcc/gcc-4.7.3-r99.ebuild
19 +++ b/sys-devel/gcc/gcc-4.7.3-r99.ebuild
20 @@ -1,10 +1,10 @@
21 -# Copyright 1999-2013 Gentoo Foundation
22 +# Copyright 1999-2014 Gentoo Foundation
23 # Distributed under the terms of the GNU General Public License v2
24 # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.7.3.ebuild,v 1.2 2013/05/20 10:56:06 aballier Exp $
25
26 -EAPI=4
27 +EAPI="2"
28
29 -PATCH_VER="1.0"
30 +PATCH_VER="1.4"
31 UCLIBC_VER="1.0"
32
33 # Hardened gcc 4 stuff
34 @@ -20,20 +20,29 @@ SSP_STABLE="amd64 x86 ppc ppc64 arm"
35 SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
36 #end Hardened stuff
37
38 -inherit toolchain eutils
39 +inherit eutils toolchain
40
41 DESCRIPTION="The GNU Compiler Collection"
42
43 LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
44
45 -KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -amd64-fbsd -x86-fbsd"
46 +KEYWORDS="amd64"
47
48 RDEPEND=""
49 DEPEND="${RDEPEND}
50 + elibc_glibc? ( >=sys-libs/glibc-2.8 )
51 >=${CATEGORY}/binutils-2.18"
52
53 -src_unpack() {
54 - toolchain_src_unpack
55 +if [[ ${CATEGORY} != cross-* ]] ; then
56 + PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
57 +fi
58 +
59 +src_prepare() {
60 + if has_version '<sys-libs/glibc-2.12' ; then
61 + ewarn "Your host glibc is too old; disabling automatic fortify."
62 + ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
63 + EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
64 + fi
65
66 if use elibc_musl; then
67 cd "${S}"
68 @@ -43,24 +52,17 @@ src_unpack() {
69 cp libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver libstdc++-v3/config/os/gnu-linux/
70 mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
71 cp -r libitm/config/generic libitm/config/linux/x86
72 -
73 epatch "${FILESDIR}"/${P}-musl-linker-path.patch
74 fi
75
76 - use vanilla && return 0
77 -
78 - [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
79 -}
80 + # drop the x32 stuff once 4.7 goes stable
81 + if [[ ${CTARGET} != x86_64* ]] || ! has x32 $(get_all_abis TARGET) ; then
82 + EPATCH_EXCLUDE+=" 90_all_gcc-4.7-x32.patch"
83 + fi
84
85 -src_install() {
86 - toolchain_src_install
87 + toolchain_src_prepare
88
89 - # Because /usr/lib/gcc/.. is not in musl search path
90 - # cp-ing libgcc_s.so.1 is the safest way but it does
91 - # mess up gcc-config which will need patching for this.
92 - cp "${D}"/usr/lib/gcc/${CHOST}/${PV}/libgcc_s.so.1 "${D}"/usr/lib
93 -}
94 + use vanilla && return 0
95
96 -pkg_setup() {
97 - toolchain_pkg_setup
98 + [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
99 }