Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: toolchain.eclass
Date: Fri, 02 Dec 2011 23:39:12
Message-Id: 20111202233903.31DA42004B@flycatcher.gentoo.org
1 vapier 11/12/02 23:39:03
2
3 Modified: toolchain.eclass
4 Log:
5 delete hardened code that is only used in gcc-3.x versions (as we no longer support those)
6
7 Revision Changes Path
8 1.485 eclass/toolchain.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.485&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.485&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.484&r2=1.485
13
14 Index: toolchain.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v
17 retrieving revision 1.484
18 retrieving revision 1.485
19 diff -u -r1.484 -r1.485
20 --- toolchain.eclass 2 Dec 2011 21:03:39 -0000 1.484
21 +++ toolchain.eclass 2 Dec 2011 23:39:03 -0000 1.485
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2011 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.484 2011/12/02 21:03:39 vapier Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.485 2011/12/02 23:39:03 vapier Exp $
27 #
28 # Maintainer: Toolchain Ninjas <toolchain@g.o>
29
30 @@ -498,11 +498,6 @@
31 }
32 want_ssp() { _want_stuff PP_VER !nossp ; }
33
34 -# SPLIT_SPECS are deprecated for >=GCC 4.4
35 -want_split_specs() {
36 - tc_version_is_at_least 4.4 && return 1
37 - [[ ${SPLIT_SPECS} == "true" ]] && want_pie
38 -}
39 want_minispecs() {
40 if tc_version_is_at_least 4.3.2 && use hardened ; then
41 if ! want_pie ; then
42 @@ -611,52 +606,6 @@
43 BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
44 }
45
46 -# now we generate different spec files so that the user can select a compiler
47 -# that enforces certain features in gcc itself and so we don't have to worry
48 -# about a certain package ignoring CFLAGS/LDFLAGS
49 -_create_specs_file() {
50 - # Usage: _create_specs_file <USE flag> <specs name> <CFLAGS>
51 - local uflag=$1 name=$2 flags=${*:3}
52 - ebegin "Creating a ${name} gcc specs file"
53 - pushd "${WORKDIR}"/build/gcc > /dev/null
54 - if [[ -z ${uflag} ]] || use ${uflag} ; then
55 - # backup the compiler first
56 - cp Makefile Makefile.orig
57 - sed -i -e '/^HARD_CFLAGS/s:=.*:='"${flags}"':' Makefile
58 - mv xgcc xgcc.foo
59 - mv gcc.o gcc.o.foo
60 - emake -s xgcc
61 - $(XGCC) -dumpspecs > "${WORKDIR}"/build/${name}.specs
62 - # restore everything to normal
63 - mv gcc.o.foo gcc.o
64 - mv xgcc.foo xgcc
65 - mv Makefile.orig Makefile
66 - else
67 - $(XGCC) -dumpspecs > "${WORKDIR}"/build/${name}.specs
68 - fi
69 - popd > /dev/null
70 - eend $([[ -s ${WORKDIR}/build/${name}.specs ]] ; echo $?)
71 -}
72 -create_vanilla_specs_file() { _create_specs_file hardened vanilla ; }
73 -create_hardened_specs_file() { _create_specs_file !hardened hardened ${gcc_common_hard} -DEFAULT_PIE_SSP ; }
74 -create_hardenednossp_specs_file() { _create_specs_file "" hardenednossp ${gcc_common_hard} -DEFAULT_PIE ; }
75 -create_hardenednopie_specs_file() { _create_specs_file "" hardenednopie ${gcc_common_hard} -DEFAULT_SSP ; }
76 -create_hardenednopiessp_specs_file() { _create_specs_file "" hardenednopiessp ${gcc_common_hard} ; }
77 -
78 -split_out_specs_files() {
79 - local s spec_list="hardenednopiessp vanilla"
80 - if hardened_gcc_works ; then
81 - spec_list="${spec_list} hardened hardenednossp hardenednopie"
82 - elif hardened_gcc_works pie ; then
83 - spec_list="${spec_list} hardenednossp"
84 - elif hardened_gcc_works ssp ; then
85 - spec_list="${spec_list} hardenednopie"
86 - fi
87 - for s in ${spec_list} ; do
88 - create_${s}_specs_file || return 1
89 - done
90 -}
91 -
92 create_gcc_env_entry() {
93 dodir /etc/env.d/gcc
94 local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}"
95 @@ -1664,12 +1613,6 @@
96 einfo "Compiling ${PN} ..."
97 gcc_do_make ${GCC_MAKE_TARGET}
98
99 - # Do not create multiple specs files for PIE+SSP if boundschecking is in
100 - # USE, as we disable PIE+SSP when it is.
101 - if want_split_specs && ! want_minispecs; then
102 - split_out_specs_files || die "failed to split out specs"
103 - fi
104 -
105 popd > /dev/null
106 }
107
108 @@ -1711,22 +1654,6 @@
109 dodir /etc/env.d/gcc
110 create_gcc_env_entry
111
112 - if want_split_specs ; then
113 - if use hardened ; then
114 - create_gcc_env_entry vanilla
115 - fi
116 - ! use hardened && hardened_gcc_works && create_gcc_env_entry hardened
117 - if hardened_gcc_works || hardened_gcc_works pie ; then
118 - create_gcc_env_entry hardenednossp
119 - fi
120 - if hardened_gcc_works || hardened_gcc_works ssp ; then
121 - create_gcc_env_entry hardenednopie
122 - fi
123 - create_gcc_env_entry hardenednopiessp
124 -
125 - insinto ${LIBPATH}
126 - doins "${WORKDIR}"/build/*.specs || die "failed to install specs"
127 - fi
128 # Setup the gcc_env_entry for hardened gcc 4 with minispecs
129 if want_minispecs ; then
130 copy_minispecs_gcc_specs
131 @@ -2021,12 +1948,6 @@
132 #
133 # GENTOO_PATCH_EXCLUDE
134 # List of filenames, relative to ${WORKDIR}/patch/
135 -#
136 -# PIEPATCH_EXCLUDE
137 -# List of filenames, relative to ${WORKDIR}/piepatch/
138 -#
139 -# Travis Tilley <lv@g.o> (03 Sep 2004)
140 -#
141 exclude_gcc_patches() {
142 local i
143 for i in ${GENTOO_PATCH_EXCLUDE} ; do
144 @@ -2035,12 +1956,6 @@
145 rm -f "${WORKDIR}"/patch/${i} || die "failed to delete ${i}"
146 fi
147 done
148 - for i in ${PIEPATCH_EXCLUDE} ; do
149 - if [[ -f ${WORKDIR}/piepatch/${i} ]] ; then
150 - einfo "Excluding piepatch ${i}"
151 - rm -f "${WORKDIR}"/piepatch/${i} || die "failed to delete ${i}"
152 - fi
153 - done
154 }
155
156 # Try to apply some stub patches so that gcc won't error out when