1 |
commit: c98d2ea822845643bc10a40e349eaf16e7ed9291 |
2 |
Author: XU Benda <heroxbd <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Aug 31 21:55:36 2013 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 31 21:55:36 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=c98d2ea8 |
7 |
|
8 |
rap toolchain update |
9 |
|
10 |
--- |
11 |
eclass/toolchain-binutils.eclass | 476 +++++ |
12 |
eclass/toolchain.eclass | 2128 ++++++++++++++++++++ |
13 |
eclass/wxwidgets.eclass | 285 +++ |
14 |
.../default/linux/amd64/13.0/rap/make.defaults | 3 + |
15 |
profiles/default/linux/amd64/13.0/rap/parent | 2 + |
16 |
.../linux/arm/13.0/armv7a/rap/make.defaults | 3 + |
17 |
profiles/default/linux/arm/13.0/armv7a/rap/parent | 2 + |
18 |
profiles/default/linux/x86/13.0/rap/make.defaults | 3 + |
19 |
profiles/default/linux/x86/13.0/rap/parent | 2 + |
20 |
profiles/features/rap/make.defaults | 2 + |
21 |
profiles/features/rap/packages | 11 + |
22 |
profiles/features/rap/profile.bashrc | 9 + |
23 |
profiles/features/rap/use.force | 5 + |
24 |
profiles/features/rap/use.mask | 8 + |
25 |
profiles/prefix/features/with-libc/packages | 3 + |
26 |
...ges.78a8f6ffc32b4d5af3a26b6758688d4f.unison.tmp | 2 + |
27 |
profiles/prefix/linux/arm/with-libc/parent | 2 + |
28 |
profiles/prefix/linux/x86/with-libc/make.defaults | 6 + |
29 |
profiles/prefix/linux/x86/with-libc/parent | 2 + |
30 |
sys-devel/binutils/Manifest | 3 +- |
31 |
sys-devel/binutils/binutils-2.23.ebuild | 5 +- |
32 |
.../files/binutils-2.23-runtime-sysroot.patch | 116 ++ |
33 |
sys-devel/gcc/Manifest | 16 +- |
34 |
sys-devel/gcc/files/gcc-4.2-rap.patch | 28 + |
35 |
.../gcc/files/gcc-4.7.3-no-sysroot-to-ld.patch | 13 - |
36 |
sys-devel/gcc/gcc-3.3.6-r1.ebuild | 41 - |
37 |
sys-devel/gcc/gcc-3.4.6-r2.ebuild | 90 - |
38 |
sys-devel/gcc/gcc-4.2.4-r1.ebuild | 38 + |
39 |
28 files changed, 3146 insertions(+), 158 deletions(-) |
40 |
|
41 |
diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass |
42 |
new file mode 100644 |
43 |
index 0000000..d9197e0 |
44 |
--- /dev/null |
45 |
+++ b/eclass/toolchain-binutils.eclass |
46 |
@@ -0,0 +1,476 @@ |
47 |
+# Copyright 1999-2012 Gentoo Foundation |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.123 2013/02/09 04:32:48 vapier Exp $ |
50 |
+# |
51 |
+# Maintainer: Toolchain Ninjas <toolchain@g.o> |
52 |
+# |
53 |
+# We install binutils into CTARGET-VERSION specific directories. This lets |
54 |
+# us easily merge multiple versions for multiple targets (if we wish) and |
55 |
+# then switch the versions on the fly (with `binutils-config`). |
56 |
+# |
57 |
+# binutils-99999999 -> live cvs |
58 |
+# binutils-9999 -> live git |
59 |
+# binutils-9999_preYYMMDD -> nightly snapshot date YYMMDD |
60 |
+# binutils-# -> normal release |
61 |
+ |
62 |
+extra_eclass="" |
63 |
+if [[ -n ${BINUTILS_TYPE} ]] ; then |
64 |
+ BTYPE=${BINUTILS_TYPE} |
65 |
+else |
66 |
+ case ${PV} in |
67 |
+ 99999999) BTYPE="cvs";; |
68 |
+ 9999) BTYPE="git";; |
69 |
+ 9999_pre*) BTYPE="snap";; |
70 |
+ *.*.90) BTYPE="snap";; |
71 |
+ *.*.*.*.*) BTYPE="hjlu";; |
72 |
+ *) BTYPE="rel";; |
73 |
+ esac |
74 |
+fi |
75 |
+ |
76 |
+case ${BTYPE} in |
77 |
+cvs) |
78 |
+ extra_eclass="cvs" |
79 |
+ ECVS_SERVER="sourceware.org:/cvs/src" |
80 |
+ ECVS_MODULE="binutils" |
81 |
+ ECVS_USER="anoncvs" |
82 |
+ ECVS_PASS="anoncvs" |
83 |
+ BVER="cvs" |
84 |
+ ;; |
85 |
+git) |
86 |
+ extra_eclass="git-2" |
87 |
+ BVER="git" |
88 |
+ EGIT_REPO_URI="git://sourceware.org/git/binutils.git" |
89 |
+ ;; |
90 |
+snap) |
91 |
+ BVER=${PV/9999_pre} |
92 |
+ ;; |
93 |
+*) |
94 |
+ BVER=${BINUTILS_VER:-${PV}} |
95 |
+ ;; |
96 |
+esac |
97 |
+ |
98 |
+inherit eutils libtool flag-o-matic gnuconfig multilib versionator unpacker ${extra_eclass} |
99 |
+EXPORT_FUNCTIONS src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
100 |
+ |
101 |
+export CTARGET=${CTARGET:-${CHOST}} |
102 |
+if [[ ${CTARGET} == ${CHOST} ]] ; then |
103 |
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then |
104 |
+ export CTARGET=${CATEGORY/cross-} |
105 |
+ fi |
106 |
+fi |
107 |
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } |
108 |
+ |
109 |
+DESCRIPTION="Tools necessary to build programs" |
110 |
+HOMEPAGE="http://sourceware.org/binutils/" |
111 |
+ |
112 |
+case ${BTYPE} in |
113 |
+ cvs|git) SRC_URI="" ;; |
114 |
+ snap) |
115 |
+ SRC_URI="ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2 |
116 |
+ ftp://sourceware.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2" ;; |
117 |
+ hjlu) |
118 |
+ SRC_URI="mirror://kernel/linux/devel/binutils/binutils-${BVER}.tar." |
119 |
+ version_is_at_least 2.21.51.0.5 && SRC_URI+="xz" || SRC_URI+="bz2" ;; |
120 |
+ rel) SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.bz2" ;; |
121 |
+esac |
122 |
+add_src_uri() { |
123 |
+ [[ -z $2 ]] && return |
124 |
+ local a=$1 |
125 |
+ if version_is_at_least 2.22.52.0.2 ; then |
126 |
+ a+=".xz" |
127 |
+ else |
128 |
+ a+=".bz2" |
129 |
+ fi |
130 |
+ set -- mirror://gentoo http://dev.gentoo.org/~vapier/dist |
131 |
+ SRC_URI="${SRC_URI} ${@/%//${a}}" |
132 |
+} |
133 |
+add_src_uri binutils-${BVER}-patches-${PATCHVER}.tar ${PATCHVER} |
134 |
+add_src_uri binutils-${BVER}-uclibc-patches-${UCLIBC_PATCHVER}.tar ${UCLIBC_PATCHVER} |
135 |
+add_src_uri elf2flt-${ELF2FLT_VER}.tar ${ELF2FLT_VER} |
136 |
+ |
137 |
+if version_is_at_least 2.18 ; then |
138 |
+ LICENSE="|| ( GPL-3 LGPL-3 )" |
139 |
+else |
140 |
+ LICENSE="|| ( GPL-2 LGPL-2 )" |
141 |
+fi |
142 |
+IUSE="cxx nls multitarget multislot static-libs test vanilla" |
143 |
+if version_is_at_least 2.19 ; then |
144 |
+ IUSE+=" zlib" |
145 |
+fi |
146 |
+if use multislot ; then |
147 |
+ SLOT="${BVER}" |
148 |
+else |
149 |
+ SLOT="0" |
150 |
+fi |
151 |
+ |
152 |
+RDEPEND=">=sys-devel/binutils-config-1.9" |
153 |
+in_iuse zlib && RDEPEND+=" zlib? ( sys-libs/zlib )" |
154 |
+DEPEND="${RDEPEND} |
155 |
+ test? ( dev-util/dejagnu ) |
156 |
+ nls? ( sys-devel/gettext ) |
157 |
+ sys-devel/flex |
158 |
+ virtual/yacc" |
159 |
+ |
160 |
+S=${WORKDIR}/binutils |
161 |
+case ${BVER} in |
162 |
+cvs|git) ;; |
163 |
+*) S=${S}-${BVER} ;; |
164 |
+esac |
165 |
+ |
166 |
+LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER} |
167 |
+INCPATH=${LIBPATH}/include |
168 |
+DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER} |
169 |
+MY_BUILDDIR=${WORKDIR}/build |
170 |
+if is_cross ; then |
171 |
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER} |
172 |
+else |
173 |
+ BINPATH=/usr/${CTARGET}/binutils-bin/${BVER} |
174 |
+fi |
175 |
+ |
176 |
+tc-binutils_unpack() { |
177 |
+ case ${BTYPE} in |
178 |
+ cvs) cvs_src_unpack ;; |
179 |
+ git) git-2_src_unpack ;; |
180 |
+ *) unpacker ${A} ;; |
181 |
+ esac |
182 |
+ mkdir -p "${MY_BUILDDIR}" |
183 |
+ [[ -d ${WORKDIR}/patch ]] && mkdir "${WORKDIR}"/patch/skip |
184 |
+} |
185 |
+ |
186 |
+# In case the ebuild wants to add a few of their own. |
187 |
+PATCHES=() |
188 |
+ |
189 |
+tc-binutils_apply_patches() { |
190 |
+ cd "${S}" |
191 |
+ |
192 |
+ if ! use vanilla ; then |
193 |
+ if [[ -n ${PATCHVER} ]] ; then |
194 |
+ EPATCH_SOURCE=${WORKDIR}/patch |
195 |
+ if [[ ${CTARGET} == mips* ]] ; then |
196 |
+ # remove gnu-hash for mips (bug #233233) |
197 |
+ EPATCH_EXCLUDE+=" 77_all_generate-gnu-hash.patch" |
198 |
+ fi |
199 |
+ [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \ |
200 |
+ && EPATCH_SUFFIX="patch.bz2" \ |
201 |
+ || EPATCH_SUFFIX="patch" |
202 |
+ epatch |
203 |
+ fi |
204 |
+ if [[ -n ${UCLIBC_PATCHVER} ]] ; then |
205 |
+ EPATCH_SOURCE=${WORKDIR}/uclibc-patches |
206 |
+ [[ -n $(ls "${EPATCH_SOURCE}"/*.bz2 2>/dev/null) ]] \ |
207 |
+ && EPATCH_SUFFIX="patch.bz2" \ |
208 |
+ || EPATCH_SUFFIX="patch" |
209 |
+ EPATCH_MULTI_MSG="Applying uClibc fixes ..." \ |
210 |
+ epatch |
211 |
+ elif [[ ${CTARGET} == *-uclibc* ]] ; then |
212 |
+ # starting with binutils-2.17.50.0.17, we no longer need |
213 |
+ # uClibc patchsets :D |
214 |
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then |
215 |
+ die "sorry, but this binutils doesn't yet support uClibc :(" |
216 |
+ fi |
217 |
+ fi |
218 |
+ [[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}" |
219 |
+ epatch_user |
220 |
+ fi |
221 |
+ |
222 |
+ # fix locale issues if possible #122216 |
223 |
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then |
224 |
+ einfo "Fixing misc issues in configure files" |
225 |
+ for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do |
226 |
+ ebegin " Updating ${f/${S}\/}" |
227 |
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \ |
228 |
+ || eerror "Please file a bug about this" |
229 |
+ eend $? |
230 |
+ done |
231 |
+ fi |
232 |
+ # fix conflicts with newer glibc #272594 |
233 |
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then |
234 |
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c |
235 |
+ fi |
236 |
+ |
237 |
+ # Fix po Makefile generators |
238 |
+ sed -i \ |
239 |
+ -e '/^datadir = /s:$(prefix)/@DATADIRNAME@:@datadir@:' \ |
240 |
+ -e '/^gnulocaledir = /s:$(prefix)/share:$(datadir):' \ |
241 |
+ */po/Make-in || die "sed po's failed" |
242 |
+ |
243 |
+ # Run misc portage update scripts |
244 |
+ gnuconfig_update |
245 |
+ elibtoolize --portage --no-uclibc |
246 |
+} |
247 |
+ |
248 |
+toolchain-binutils_src_unpack() { |
249 |
+ tc-binutils_unpack |
250 |
+ tc-binutils_apply_patches |
251 |
+} |
252 |
+ |
253 |
+toolchain-binutils_src_compile() { |
254 |
+ # prevent makeinfo from running in releases. it may not always be |
255 |
+ # installed, and older binutils may fail with newer texinfo. |
256 |
+ # besides, we never patch the doc files anyways, so regenerating |
257 |
+ # in the first place is useless. #193364 |
258 |
+ find . '(' -name '*.info' -o -name '*.texi' ')' -print0 | xargs -0 touch -r . |
259 |
+ |
260 |
+ # make sure we filter $LINGUAS so that only ones that |
261 |
+ # actually work make it through #42033 |
262 |
+ strip-linguas -u */po |
263 |
+ |
264 |
+ # keep things sane |
265 |
+ strip-flags |
266 |
+ |
267 |
+ local x |
268 |
+ echo |
269 |
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do |
270 |
+ einfo "$(printf '%10s' ${x}:) ${!x}" |
271 |
+ done |
272 |
+ echo |
273 |
+ |
274 |
+ cd "${MY_BUILDDIR}" |
275 |
+ local myconf=() |
276 |
+ |
277 |
+ # enable gold if available (installed as ld.gold) |
278 |
+ if use cxx ; then |
279 |
+ if grep -q 'enable-gold=default' "${S}"/configure ; then |
280 |
+ myconf+=( --enable-gold ) |
281 |
+ # old ways - remove when 2.21 is stable |
282 |
+ elif grep -q 'enable-gold=both/ld' "${S}"/configure ; then |
283 |
+ myconf+=( --enable-gold=both/ld ) |
284 |
+ elif grep -q 'enable-gold=both/bfd' "${S}"/configure ; then |
285 |
+ myconf+=( --enable-gold=both/bfd ) |
286 |
+ fi |
287 |
+ if grep -q -e '--enable-plugins' "${S}"/ld/configure ; then |
288 |
+ myconf+=( --enable-plugins ) |
289 |
+ fi |
290 |
+ fi |
291 |
+ |
292 |
+ use nls \ |
293 |
+ && myconf+=( --without-included-gettext ) \ |
294 |
+ || myconf+=( --disable-nls ) |
295 |
+ |
296 |
+ if in_iuse zlib ; then |
297 |
+ # older versions did not have an explicit configure flag |
298 |
+ export ac_cv_search_zlibVersion=$(usex zlib -lz no) |
299 |
+ myconf+=( $(use_with zlib) ) |
300 |
+ fi |
301 |
+ |
302 |
+ # For bi-arch systems, enable a 64bit bfd. This matches |
303 |
+ # the bi-arch logic in toolchain.eclass. #446946 |
304 |
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522 |
305 |
+ case $(tc-arch) in |
306 |
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;; |
307 |
+ esac |
308 |
+ |
309 |
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd ) |
310 |
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} ) |
311 |
+ is_cross && myconf+=( --with-sysroot="${EPREFIX}"/usr/${CTARGET} ) |
312 |
+ |
313 |
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+ |
314 |
+ # on everyone in alpha (for now), we'll just enable it when possible |
315 |
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt ) |
316 |
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt ) |
317 |
+ |
318 |
+ myconf+=( |
319 |
+ --prefix="${EPREFIX}"/usr |
320 |
+ --host=${CHOST} |
321 |
+ --target=${CTARGET} |
322 |
+ --datadir="${EPREFIX}"${DATAPATH} |
323 |
+ --infodir="${EPREFIX}"${DATAPATH}/info |
324 |
+ --mandir="${EPREFIX}"${DATAPATH}/man |
325 |
+ --bindir="${EPREFIX}"${BINPATH} |
326 |
+ --libdir="${EPREFIX}"${LIBPATH} |
327 |
+ --libexecdir="${EPREFIX}"${LIBPATH} |
328 |
+ --includedir="${EPREFIX}"${INCPATH} |
329 |
+ --enable-obsolete |
330 |
+ --enable-shared |
331 |
+ --enable-threads |
332 |
+ --disable-werror |
333 |
+ --with-bugurl=http://bugs.gentoo.org/ |
334 |
+ $(use_enable static-libs static) |
335 |
+ ${EXTRA_ECONF} |
336 |
+ ) |
337 |
+ echo ./configure "${myconf[@]}" |
338 |
+ "${S}"/configure "${myconf[@]}" || die |
339 |
+ |
340 |
+ emake all || die "emake failed" |
341 |
+ |
342 |
+ # only build info pages if we user wants them, and if |
343 |
+ # we have makeinfo (may not exist when we bootstrap) |
344 |
+ if type -p makeinfo > /dev/null ; then |
345 |
+ emake info || die "make info failed" |
346 |
+ fi |
347 |
+ # we nuke the manpages when we're left with junk |
348 |
+ # (like when we bootstrap, no perl -> no manpages) |
349 |
+ find . -name '*.1' -a -size 0 | xargs rm -f |
350 |
+ |
351 |
+ # elf2flt only works on some arches / targets |
352 |
+ if [[ -n ${ELF2FLT_VER} ]] && [[ ${CTARGET} == *linux* || ${CTARGET} == *-elf* ]] ; then |
353 |
+ cd "${WORKDIR}"/elf2flt-${ELF2FLT_VER} |
354 |
+ |
355 |
+ local x supported_arches=$(sed -n '/defined(TARGET_/{s:^.*TARGET_::;s:)::;p}' elf2flt.c | sort -u) |
356 |
+ for x in ${supported_arches} UNSUPPORTED ; do |
357 |
+ [[ ${CTARGET} == ${x}* ]] && break |
358 |
+ done |
359 |
+ |
360 |
+ if [[ ${x} != "UNSUPPORTED" ]] ; then |
361 |
+ append-flags -I"${S}"/include |
362 |
+ myconf+=( |
363 |
+ --with-bfd-include-dir=${MY_BUILDDIR}/bfd |
364 |
+ --with-libbfd=${MY_BUILDDIR}/bfd/libbfd.a |
365 |
+ --with-libiberty=${MY_BUILDDIR}/libiberty/libiberty.a |
366 |
+ --with-binutils-ldscript-dir="${EPREFIX}"${LIBPATH}/ldscripts |
367 |
+ ) |
368 |
+ echo ./configure "${myconf[@]}" |
369 |
+ ./configure "${myconf[@]}" || die |
370 |
+ emake || die "make elf2flt failed" |
371 |
+ fi |
372 |
+ fi |
373 |
+} |
374 |
+ |
375 |
+toolchain-binutils_src_test() { |
376 |
+ cd "${MY_BUILDDIR}" |
377 |
+ emake -k check || die "check failed :(" |
378 |
+} |
379 |
+ |
380 |
+toolchain-binutils_src_install() { |
381 |
+ local x d |
382 |
+ |
383 |
+ cd "${MY_BUILDDIR}" |
384 |
+ emake DESTDIR="${D}" tooldir="${EPREFIX}/${LIBPATH}" install || die |
385 |
+ rm -rf "${ED}"/${LIBPATH}/bin |
386 |
+ use static-libs || find "${ED}" -name '*.la' -delete |
387 |
+ |
388 |
+ # Newer versions of binutils get fancy with ${LIBPATH} #171905 |
389 |
+ cd "${ED}"/${LIBPATH} |
390 |
+ for d in ../* ; do |
391 |
+ [[ ${d} == ../${BVER} ]] && continue |
392 |
+ mv ${d}/* . || die |
393 |
+ rmdir ${d} || die |
394 |
+ done |
395 |
+ |
396 |
+ # Now we collect everything intp the proper SLOT-ed dirs |
397 |
+ # When something is built to cross-compile, it installs into |
398 |
+ # /usr/$CHOST/ by default ... we have to 'fix' that :) |
399 |
+ if is_cross ; then |
400 |
+ cd "${ED}"/${BINPATH} |
401 |
+ for x in * ; do |
402 |
+ mv ${x} ${x/${CTARGET}-} |
403 |
+ done |
404 |
+ |
405 |
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then |
406 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH} |
407 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/ |
408 |
+ rm -r "${ED}"/usr/${CHOST}/{include,lib} |
409 |
+ fi |
410 |
+ fi |
411 |
+ insinto ${INCPATH} |
412 |
+ local libiberty_headers=( |
413 |
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir. |
414 |
+ demangle.h |
415 |
+ dyn-string.h |
416 |
+ fibheap.h |
417 |
+ hashtab.h |
418 |
+ libiberty.h |
419 |
+ objalloc.h |
420 |
+ splay-tree.h |
421 |
+ ) |
422 |
+ doins "${libiberty_headers[@]/#/${S}/include/}" || die |
423 |
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then |
424 |
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ |
425 |
+ rm -r "${ED}"/${LIBPATH}/lib |
426 |
+ fi |
427 |
+ |
428 |
+ # Insert elf2flt where appropriate |
429 |
+ if [[ -x ${WORKDIR}/elf2flt-${ELF2FLT_VER}/elf2flt ]] ; then |
430 |
+ cd "${WORKDIR}"/elf2flt-${ELF2FLT_VER} |
431 |
+ insinto ${LIBPATH}/ldscripts |
432 |
+ doins elf2flt.ld || die "doins elf2flt.ld failed" |
433 |
+ exeinto ${BINPATH} |
434 |
+ doexe elf2flt flthdr || die "doexe elf2flt flthdr failed" |
435 |
+ mv "${ED}"/${BINPATH}/{ld,ld.real} || die |
436 |
+ newexe ld-elf2flt ld || die "doexe ld-elf2flt failed" |
437 |
+ newdoc README README.elf2flt |
438 |
+ fi |
439 |
+ |
440 |
+ # Now, some binutils are tricky and actually provide |
441 |
+ # for multiple TARGETS. Really, we're talking just |
442 |
+ # 32bit/64bit support (like mips/ppc/sparc). Here |
443 |
+ # we want to tell binutils-config that it's cool if |
444 |
+ # it generates multiple sets of binutil symlinks. |
445 |
+ # e.g. sparc gets {sparc,sparc64}-unknown-linux-gnu |
446 |
+ local targ=${CTARGET/-*} src="" dst="" |
447 |
+ local FAKE_TARGETS=${CTARGET} |
448 |
+ case ${targ} in |
449 |
+ mips*) src="mips" dst="mips64";; |
450 |
+ powerpc*) src="powerpc" dst="powerpc64";; |
451 |
+ s390*) src="s390" dst="s390x";; |
452 |
+ sparc*) src="sparc" dst="sparc64";; |
453 |
+ esac |
454 |
+ case ${targ} in |
455 |
+ mips64*|powerpc64*|s390x*|sparc64*) targ=${src} src=${dst} dst=${targ};; |
456 |
+ esac |
457 |
+ [[ -n ${src}${dst} ]] && FAKE_TARGETS="${FAKE_TARGETS} ${CTARGET/${src}/${dst}}" |
458 |
+ |
459 |
+ # Generate an env.d entry for this binutils |
460 |
+ cd "${S}" |
461 |
+ insinto /etc/env.d/binutils |
462 |
+ cat <<-EOF > env.d |
463 |
+ TARGET="${CTARGET}" |
464 |
+ VER="${BVER}" |
465 |
+ LIBPATH="${EPREFIX}/${LIBPATH}" |
466 |
+ FAKE_TARGETS="${FAKE_TARGETS}" |
467 |
+ EOF |
468 |
+ newins env.d ${CTARGET}-${BVER} |
469 |
+ |
470 |
+ # Handle documentation |
471 |
+ if ! is_cross ; then |
472 |
+ cd "${S}" |
473 |
+ dodoc README |
474 |
+ docinto bfd |
475 |
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO |
476 |
+ docinto binutils |
477 |
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README |
478 |
+ docinto gas |
479 |
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README* |
480 |
+ docinto gprof |
481 |
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl |
482 |
+ docinto ld |
483 |
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO |
484 |
+ docinto libiberty |
485 |
+ dodoc libiberty/ChangeLog* libiberty/README |
486 |
+ docinto opcodes |
487 |
+ dodoc opcodes/ChangeLog* |
488 |
+ fi |
489 |
+ # Remove shared info pages |
490 |
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} |
491 |
+ # Trim all empty dirs |
492 |
+ find "${ED}" -type d | xargs rmdir >& /dev/null |
493 |
+} |
494 |
+ |
495 |
+toolchain-binutils_pkg_postinst() { |
496 |
+ # Make sure this ${CTARGET} has a binutils version selected |
497 |
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 |
498 |
+ binutils-config ${CTARGET}-${BVER} |
499 |
+} |
500 |
+ |
501 |
+toolchain-binutils_pkg_postrm() { |
502 |
+ local current_profile=$(binutils-config -c ${CTARGET}) |
503 |
+ |
504 |
+ # If no other versions exist, then uninstall for this |
505 |
+ # target ... otherwise, switch to the newest version |
506 |
+ # Note: only do this if this version is unmerged. We |
507 |
+ # rerun binutils-config if this is a remerge, as |
508 |
+ # we want the mtimes on the symlinks updated (if |
509 |
+ # it is the same as the current selected profile) |
510 |
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then |
511 |
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') |
512 |
+ choice=${choice//$'\n'/ } |
513 |
+ choice=${choice/* } |
514 |
+ if [[ -z ${choice} ]] ; then |
515 |
+ env -i ROOT="${ROOT}" binutils-config -u ${CTARGET} |
516 |
+ else |
517 |
+ binutils-config ${choice} |
518 |
+ fi |
519 |
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then |
520 |
+ binutils-config ${CTARGET}-${BVER} |
521 |
+ fi |
522 |
+} |
523 |
|
524 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
525 |
new file mode 100644 |
526 |
index 0000000..76d92e6 |
527 |
--- /dev/null |
528 |
+++ b/eclass/toolchain.eclass |
529 |
@@ -0,0 +1,2128 @@ |
530 |
+# Copyright 1999-2013 Gentoo Foundation |
531 |
+# Distributed under the terms of the GNU General Public License v2 |
532 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.597 2013/07/24 01:34:38 dirtyepic Exp $ |
533 |
+ |
534 |
+# Maintainer: Toolchain Ninjas <toolchain@g.o> |
535 |
+ |
536 |
+#---->> eclass stuff <<---- |
537 |
+DESCRIPTION="The GNU Compiler Collection" |
538 |
+HOMEPAGE="http://gcc.gnu.org/" |
539 |
+LICENSE="GPL-2 LGPL-2.1" |
540 |
+RESTRICT="strip" # cross-compilers need controlled stripping |
541 |
+ |
542 |
+inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib fixheadtails pax-utils prefix |
543 |
+ |
544 |
+if [[ ${PV} == *_pre9999* ]] ; then |
545 |
+ EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git" |
546 |
+ # naming style: |
547 |
+ # gcc-4.7.1_pre9999 -> gcc-4_7-branch |
548 |
+ # Note that the micro version is required or lots of stuff will break. |
549 |
+ # To checkout master set gcc_LIVE_BRANCH="master" in the ebuild before |
550 |
+ # inheriting this eclass. |
551 |
+ EGIT_BRANCH="${PN}-${PV%.?_pre9999}-branch" |
552 |
+ EGIT_BRANCH=${EGIT_BRANCH//./_} |
553 |
+ inherit git-2 |
554 |
+fi |
555 |
+ |
556 |
+FEATURES=${FEATURES/multilib-strict/} |
557 |
+ |
558 |
+EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
559 |
+#----<< eclass stuff >>---- |
560 |
+ |
561 |
+#---->> globals <<---- |
562 |
+export CTARGET=${CTARGET:-${CHOST}} |
563 |
+if [[ ${CTARGET} = ${CHOST} ]] ; then |
564 |
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then |
565 |
+ export CTARGET=${CATEGORY/cross-} |
566 |
+ fi |
567 |
+fi |
568 |
+: ${TARGET_ABI:=${ABI}} |
569 |
+: ${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}} |
570 |
+: ${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}} |
571 |
+ |
572 |
+is_crosscompile() { |
573 |
+ [[ ${CHOST} != ${CTARGET} ]] |
574 |
+} |
575 |
+ |
576 |
+# General purpose version check. Without a second arg matches up to minor version (x.x.x) |
577 |
+# (ie. 4.6.0_pre9999 matches 4 or 4.6 or 4.6.0 but not 4.6.1) |
578 |
+tc_version_is_at_least() { |
579 |
+ version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}" |
580 |
+} |
581 |
+ |
582 |
+GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}} |
583 |
+GCC_PVR=${GCC_PV} |
584 |
+[[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR} |
585 |
+GCC_RELEASE_VER=$(get_version_component_range 1-3 ${GCC_PV}) |
586 |
+GCC_BRANCH_VER=$(get_version_component_range 1-2 ${GCC_PV}) |
587 |
+GCCMAJOR=$(get_version_component_range 1 ${GCC_PV}) |
588 |
+GCCMINOR=$(get_version_component_range 2 ${GCC_PV}) |
589 |
+GCCMICRO=$(get_version_component_range 3 ${GCC_PV}) |
590 |
+[[ ${BRANCH_UPDATE-notset} == "notset" ]] && \ |
591 |
+ BRANCH_UPDATE=$(get_version_component_range 4 ${GCC_PV}) |
592 |
+ |
593 |
+# According to gcc/c-cppbuiltin.c, GCC_CONFIG_VER MUST match this regex. |
594 |
+# ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? |
595 |
+GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(replace_version_separator 3 '-' ${GCC_PV})} |
596 |
+ |
597 |
+# Pre-release support |
598 |
+if [[ ${GCC_PV} != ${GCC_PV/_pre/-} ]] ; then |
599 |
+ PRERELEASE=${GCC_PV/_pre/-} |
600 |
+fi |
601 |
+ |
602 |
+# make _alpha and _beta ebuilds automatically use a snapshot |
603 |
+if [[ ${GCC_PV} == *_alpha* ]] ; then |
604 |
+ SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_alpha} |
605 |
+elif [[ ${GCC_PV} == *_beta* ]] ; then |
606 |
+ SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_beta} |
607 |
+elif [[ ${GCC_PV} == *_rc* ]] ; then |
608 |
+ SNAPSHOT=${GCC_PV%_rc*}-RC-${GCC_PV##*_rc} |
609 |
+fi |
610 |
+ |
611 |
+export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}} |
612 |
+PREFIX=${TOOLCHAIN_PREFIX:-/usr} |
613 |
+ |
614 |
+if tc_version_is_at_least 3.4.0 ; then |
615 |
+ LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}} |
616 |
+else |
617 |
+ LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}} |
618 |
+fi |
619 |
+INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include} |
620 |
+ |
621 |
+if is_crosscompile ; then |
622 |
+ BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} |
623 |
+else |
624 |
+ BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} |
625 |
+fi |
626 |
+ |
627 |
+DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}} |
628 |
+ |
629 |
+# Dont install in /usr/include/g++-v3/, but in gcc internal directory. |
630 |
+# We will handle /usr/include/g++-v3/ with gcc-config ... |
631 |
+STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VER/\.*/}} |
632 |
+#----<< globals >>---- |
633 |
+ |
634 |
+#---->> SLOT+IUSE logic <<---- |
635 |
+IUSE="multislot nls nptl regression-test vanilla" |
636 |
+ |
637 |
+if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then |
638 |
+ IUSE+=" altivec cxx fortran" |
639 |
+ [[ -n ${PIE_VER} ]] && IUSE+=" nopie" |
640 |
+ [[ -n ${HTB_VER} ]] && IUSE+=" boundschecking" |
641 |
+ [[ -n ${D_VER} ]] && IUSE+=" d" |
642 |
+ [[ -n ${SPECS_VER} ]] && IUSE+=" nossp" |
643 |
+ tc_version_is_at_least 3 && IUSE+=" doc gcj gtk hardened multilib objc" |
644 |
+ tc_version_is_at_least 4.0 && IUSE+=" objc-gc mudflap" |
645 |
+ tc_version_is_at_least 4.1 && IUSE+=" libssp objc++" |
646 |
+ tc_version_is_at_least 4.2 && IUSE+=" openmp" |
647 |
+ tc_version_is_at_least 4.3 && IUSE+=" fixed-point" |
648 |
+ tc_version_is_at_least 4.6 && IUSE+=" graphite" |
649 |
+ tc_version_is_at_least 4.6 && IUSE+=" lto" |
650 |
+ tc_version_is_at_least 4.7 && IUSE+=" go" |
651 |
+fi |
652 |
+ |
653 |
+# Support upgrade paths here or people get pissed |
654 |
+if use multislot ; then |
655 |
+ SLOT="${GCC_CONFIG_VER}" |
656 |
+else |
657 |
+ SLOT="${GCC_BRANCH_VER}" |
658 |
+fi |
659 |
+#----<< SLOT+IUSE logic >>---- |
660 |
+ |
661 |
+#---->> DEPEND <<---- |
662 |
+RDEPEND="sys-libs/zlib |
663 |
+ nls? ( sys-devel/gettext )" |
664 |
+ |
665 |
+tc_version_is_at_least 3 && RDEPEND+=" virtual/libiconv" |
666 |
+ |
667 |
+if tc_version_is_at_least 4 ; then |
668 |
+ GMP_MPFR_DEPS=">=dev-libs/gmp-4.3.2 >=dev-libs/mpfr-2.4.2" |
669 |
+ if tc_version_is_at_least 4.3 ; then |
670 |
+ RDEPEND+=" ${GMP_MPFR_DEPS}" |
671 |
+ elif in_iuse fortran ; then |
672 |
+ RDEPEND+=" fortran? ( ${GMP_MPFR_DEPS} )" |
673 |
+ fi |
674 |
+fi |
675 |
+ |
676 |
+tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1" |
677 |
+ |
678 |
+if in_iuse graphite ; then |
679 |
+ if tc_version_is_at_least 4.8 ; then |
680 |
+ RDEPEND+=" |
681 |
+ graphite? ( |
682 |
+ >=dev-libs/cloog-0.18.0 |
683 |
+ >=dev-libs/isl-0.11.1 |
684 |
+ )" |
685 |
+ else |
686 |
+ RDEPEND+=" |
687 |
+ graphite? ( |
688 |
+ >=dev-libs/cloog-ppl-0.15.10 |
689 |
+ >=dev-libs/ppl-0.11 |
690 |
+ )" |
691 |
+ fi |
692 |
+fi |
693 |
+ |
694 |
+DEPEND="${RDEPEND} |
695 |
+ >=sys-devel/bison-1.875 |
696 |
+ >=sys-devel/flex-2.5.4 |
697 |
+ regression-test? ( |
698 |
+ >=dev-util/dejagnu-1.4.4 |
699 |
+ >=sys-devel/autogen-5.5.4 |
700 |
+ )" |
701 |
+ |
702 |
+if in_iuse gcj ; then |
703 |
+ GCJ_DEPS=">=media-libs/libart_lgpl-2.1" |
704 |
+ GCJ_GTK_DEPS=" |
705 |
+ x11-libs/libXt |
706 |
+ x11-libs/libX11 |
707 |
+ x11-libs/libXtst |
708 |
+ x11-proto/xproto |
709 |
+ x11-proto/xextproto |
710 |
+ =x11-libs/gtk+-2* |
711 |
+ virtual/pkgconfig |
712 |
+ amd64? ( multilib? ( |
713 |
+ app-emulation/emul-linux-x86-gtklibs |
714 |
+ app-emulation/emul-linux-x86-xlibs |
715 |
+ ) ) |
716 |
+ " |
717 |
+ tc_version_is_at_least 3.4 && GCJ_GTK_DEPS+=" x11-libs/pango" |
718 |
+ tc_version_is_at_least 4.2 && GCJ_DEPS+=" app-arch/zip app-arch/unzip" |
719 |
+ DEPEND+=" gcj? ( gtk? ( ${GCJ_GTK_DEPS} ) ${GCJ_DEPS} )" |
720 |
+fi |
721 |
+ |
722 |
+PDEPEND=">=sys-devel/gcc-config-1.7" |
723 |
+#----<< DEPEND >>---- |
724 |
+ |
725 |
+#---->> S + SRC_URI essentials <<---- |
726 |
+ |
727 |
+# Set the source directory depending on whether we're using |
728 |
+# a prerelease, snapshot, or release tarball. |
729 |
+S=$( |
730 |
+ if [[ -n ${PRERELEASE} ]] ; then |
731 |
+ echo ${WORKDIR}/gcc-${PRERELEASE} |
732 |
+ elif [[ -n ${SNAPSHOT} ]] ; then |
733 |
+ echo ${WORKDIR}/gcc-${SNAPSHOT} |
734 |
+ else |
735 |
+ echo ${WORKDIR}/gcc-${GCC_RELEASE_VER} |
736 |
+ fi |
737 |
+) |
738 |
+ |
739 |
+# This function handles the basics of setting the SRC_URI for a gcc ebuild. |
740 |
+# To use, set SRC_URI with: |
741 |
+# |
742 |
+# SRC_URI="$(get_gcc_src_uri)" |
743 |
+# |
744 |
+# Other than the variables normally set by portage, this function's behavior |
745 |
+# can be altered by setting the following: |
746 |
+# |
747 |
+# SNAPSHOT |
748 |
+# If set, this variable signals that we should be using a snapshot of |
749 |
+# gcc. It is expected to be in the format "YYYY-MM-DD". Note that if |
750 |
+# the ebuild has a _pre suffix, this variable is ignored and the |
751 |
+# prerelease tarball is used instead. |
752 |
+# |
753 |
+# BRANCH_UPDATE |
754 |
+# If set, this variable signals that we should be using the main |
755 |
+# release tarball (determined by ebuild version) and applying a |
756 |
+# CVS branch update patch against it. The location of this branch |
757 |
+# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}. |
758 |
+# Just like with SNAPSHOT, this variable is ignored if the ebuild |
759 |
+# has a _pre suffix. |
760 |
+# |
761 |
+# PATCH_VER |
762 |
+# PATCH_GCC_VER |
763 |
+# This should be set to the version of the gentoo patch tarball. |
764 |
+# The resulting filename of this tarball will be: |
765 |
+# gcc-${PATCH_GCC_VER:-${GCC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2 |
766 |
+# |
767 |
+# PIE_VER |
768 |
+# PIE_GCC_VER |
769 |
+# These variables control patching in various updates for the logic |
770 |
+# controlling Position Independant Executables. PIE_VER is expected |
771 |
+# to be the version of this patch, and PIE_GCC_VER the gcc version of |
772 |
+# the patch: |
773 |
+# An example: |
774 |
+# PIE_VER="8.7.6.5" |
775 |
+# PIE_GCC_VER="3.4.0" |
776 |
+# The resulting filename of this tarball will be: |
777 |
+# gcc-${PIE_GCC_VER:-${GCC_RELEASE_VER}}-piepatches-v${PIE_VER}.tar.bz2 |
778 |
+# |
779 |
+# SPECS_VER |
780 |
+# SPECS_GCC_VER |
781 |
+# This is for the minispecs files included in the hardened gcc-4.x |
782 |
+# The specs files for hardenedno*, vanilla and for building the "specs" file. |
783 |
+# SPECS_VER is expected to be the version of this patch, SPECS_GCC_VER |
784 |
+# the gcc version of the patch. |
785 |
+# An example: |
786 |
+# SPECS_VER="8.7.6.5" |
787 |
+# SPECS_GCC_VER="3.4.0" |
788 |
+# The resulting filename of this tarball will be: |
789 |
+# gcc-${SPECS_GCC_VER:-${GCC_RELEASE_VER}}-specs-${SPECS_VER}.tar.bz2 |
790 |
+# |
791 |
+# HTB_VER |
792 |
+# HTB_GCC_VER |
793 |
+# These variables control whether or not an ebuild supports Herman |
794 |
+# ten Brugge's bounds-checking patches. If you want to use a patch |
795 |
+# for an older gcc version with a new gcc, make sure you set |
796 |
+# HTB_GCC_VER to that version of gcc. |
797 |
+# |
798 |
+gentoo_urls() { |
799 |
+ local devspace="HTTP~vapier/dist/URI HTTP~dirtyepic/dist/URI |
800 |
+ HTTP~halcy0n/patches/URI HTTP~zorry/patches/gcc/URI" |
801 |
+ devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/} |
802 |
+ echo mirror://gentoo/$1 ${devspace//URI/$1} |
803 |
+} |
804 |
+ |
805 |
+get_gcc_src_uri() { |
806 |
+ export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} |
807 |
+ export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} |
808 |
+ export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} |
809 |
+ export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} |
810 |
+ export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} |
811 |
+ |
812 |
+ # Set where to download gcc itself depending on whether we're using a |
813 |
+ # prerelease, snapshot, or release tarball. |
814 |
+ if [[ -n ${PRERELEASE} ]] ; then |
815 |
+ GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/prerelease-${PRERELEASE}/gcc-${PRERELEASE}.tar.bz2" |
816 |
+ elif [[ -n ${SNAPSHOT} ]] ; then |
817 |
+ GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.bz2" |
818 |
+ elif [[ ${PV} != *9999* ]] ; then |
819 |
+ GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2" |
820 |
+ # we want all branch updates to be against the main release |
821 |
+ [[ -n ${BRANCH_UPDATE} ]] && \ |
822 |
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)" |
823 |
+ fi |
824 |
+ |
825 |
+ [[ -n ${UCLIBC_VER} ]] && \ |
826 |
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)" |
827 |
+ [[ -n ${PATCH_VER} ]] && \ |
828 |
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)" |
829 |
+ |
830 |
+ # strawberry pie, Cappuccino and a Gauloises (it's a good thing) |
831 |
+ [[ -n ${PIE_VER} ]] && \ |
832 |
+ PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} && \ |
833 |
+ GCC_SRC_URI+=" $(gentoo_urls ${PIE_CORE})" |
834 |
+ |
835 |
+ # gcc minispec for the hardened gcc 4 compiler |
836 |
+ [[ -n ${SPECS_VER} ]] && \ |
837 |
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)" |
838 |
+ |
839 |
+ # gcc bounds checking patch |
840 |
+ if [[ -n ${HTB_VER} ]] ; then |
841 |
+ local HTBFILE="bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" |
842 |
+ GCC_SRC_URI+=" |
843 |
+ boundschecking? ( |
844 |
+ mirror://sourceforge/boundschecking/${HTBFILE} |
845 |
+ $(gentoo_urls ${HTBFILE}) |
846 |
+ )" |
847 |
+ fi |
848 |
+ |
849 |
+ [[ -n ${D_VER} ]] && \ |
850 |
+ GCC_SRC_URI+=" d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )" |
851 |
+ |
852 |
+ if in_iuse gcj ; then |
853 |
+ if tc_version_is_at_least 4.5 ; then |
854 |
+ GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.5.jar )" |
855 |
+ elif tc_version_is_at_least 4.3 ; then |
856 |
+ GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )" |
857 |
+ fi |
858 |
+ fi |
859 |
+ |
860 |
+ echo "${GCC_SRC_URI}" |
861 |
+} |
862 |
+SRC_URI=$(get_gcc_src_uri) |
863 |
+#---->> S + SRC_URI essentials >>---- |
864 |
+ |
865 |
+#---->> support checks <<---- |
866 |
+ |
867 |
+# Grab a variable from the build system (taken from linux-info.eclass) |
868 |
+get_make_var() { |
869 |
+ local var=$1 makefile=${2:-${WORKDIR}/build/Makefile} |
870 |
+ echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \ |
871 |
+ r=${makefile%/*} emake --no-print-directory -s -f - 2>/dev/null |
872 |
+} |
873 |
+XGCC() { get_make_var GCC_FOR_TARGET ; } |
874 |
+ |
875 |
+# The gentoo piessp patches allow for 3 configurations: |
876 |
+# 1) PIE+SSP by default |
877 |
+# 2) PIE by default |
878 |
+# 3) SSP by default |
879 |
+hardened_gcc_works() { |
880 |
+ if [[ $1 == "pie" ]] ; then |
881 |
+ # $gcc_cv_ld_pie is unreliable as it simply take the output of |
882 |
+ # `ld --help | grep -- -pie`, that reports the option in all cases, also if |
883 |
+ # the loader doesn't actually load the resulting executables. |
884 |
+ # To avoid breakage, blacklist FreeBSD here at least |
885 |
+ [[ ${CTARGET} == *-freebsd* ]] && return 1 |
886 |
+ |
887 |
+ want_pie || return 1 |
888 |
+ use_if_iuse nopie && return 1 |
889 |
+ hardened_gcc_is_stable pie |
890 |
+ return $? |
891 |
+ elif [[ $1 == "ssp" ]] ; then |
892 |
+ [[ -n ${SPECS_VER} ]] || return 1 |
893 |
+ use_if_iuse nossp && return 1 |
894 |
+ hardened_gcc_is_stable ssp |
895 |
+ return $? |
896 |
+ else |
897 |
+ # laziness ;) |
898 |
+ hardened_gcc_works pie || return 1 |
899 |
+ hardened_gcc_works ssp || return 1 |
900 |
+ return 0 |
901 |
+ fi |
902 |
+} |
903 |
+ |
904 |
+hardened_gcc_is_stable() { |
905 |
+ local tocheck |
906 |
+ if [[ $1 == "pie" ]] ; then |
907 |
+ if [[ ${CTARGET} == *-uclibc* ]] ; then |
908 |
+ tocheck=${PIE_UCLIBC_STABLE} |
909 |
+ else |
910 |
+ tocheck=${PIE_GLIBC_STABLE} |
911 |
+ fi |
912 |
+ elif [[ $1 == "ssp" ]] ; then |
913 |
+ if [[ ${CTARGET} == *-uclibc* ]] ; then |
914 |
+ tocheck=${SSP_UCLIBC_STABLE} |
915 |
+ else |
916 |
+ tocheck=${SSP_STABLE} |
917 |
+ fi |
918 |
+ else |
919 |
+ die "hardened_gcc_stable needs to be called with pie or ssp" |
920 |
+ fi |
921 |
+ |
922 |
+ has $(tc-arch) ${tocheck} && return 0 |
923 |
+ return 1 |
924 |
+} |
925 |
+ |
926 |
+want_pie() { |
927 |
+ ! use hardened && [[ -n ${PIE_VER} ]] && use nopie && return 1 |
928 |
+ [[ -n ${PIE_VER} ]] && [[ -n ${SPECS_VER} ]] && return 0 |
929 |
+ tc_version_is_at_least 4.3.2 && return 1 |
930 |
+ [[ -z ${PIE_VER} ]] && return 1 |
931 |
+ use !nopie && return 0 |
932 |
+ return 1 |
933 |
+} |
934 |
+ |
935 |
+want_minispecs() { |
936 |
+ if tc_version_is_at_least 4.3.2 && use hardened ; then |
937 |
+ if ! want_pie ; then |
938 |
+ ewarn "PIE_VER or SPECS_VER is not defined in the GCC ebuild." |
939 |
+ elif use vanilla ; then |
940 |
+ ewarn "You will not get hardened features if you have the vanilla USE-flag." |
941 |
+ elif use nopie && use nossp ; then |
942 |
+ ewarn "You will not get hardened features if you have the nopie and nossp USE-flag." |
943 |
+ elif ! hardened_gcc_works ; then |
944 |
+ ewarn "Your $(tc-arch) arch is not supported." |
945 |
+ else |
946 |
+ return 0 |
947 |
+ fi |
948 |
+ ewarn "Hope you know what you are doing. Hardened will not work." |
949 |
+ return 0 |
950 |
+ fi |
951 |
+ return 1 |
952 |
+} |
953 |
+ |
954 |
+# This is to make sure we don't accidentally try to enable support for a |
955 |
+# language that doesnt exist. GCC 3.4 supports f77, while 4.0 supports f95, etc. |
956 |
+# |
957 |
+# Also add a hook so special ebuilds (kgcc64) can control which languages |
958 |
+# exactly get enabled |
959 |
+gcc-lang-supported() { |
960 |
+ grep ^language=\"${1}\" "${S}"/gcc/*/config-lang.in > /dev/null || return 1 |
961 |
+ [[ -z ${TOOLCHAIN_ALLOWED_LANGS} ]] && return 0 |
962 |
+ has $1 ${TOOLCHAIN_ALLOWED_LANGS} |
963 |
+} |
964 |
+#----<< support checks >>---- |
965 |
+ |
966 |
+#---->> specs + env.d logic <<---- |
967 |
+ |
968 |
+# configure to build with the hardened GCC specs as the default |
969 |
+make_gcc_hard() { |
970 |
+ # defaults to enable for all hardened toolchains |
971 |
+ local gcc_hard_flags="-DEFAULT_RELRO -DEFAULT_BIND_NOW" |
972 |
+ |
973 |
+ if hardened_gcc_works ; then |
974 |
+ einfo "Updating gcc to use automatic PIE + SSP building ..." |
975 |
+ gcc_hard_flags+=" -DEFAULT_PIE_SSP" |
976 |
+ elif hardened_gcc_works pie ; then |
977 |
+ einfo "Updating gcc to use automatic PIE building ..." |
978 |
+ ewarn "SSP has not been enabled by default" |
979 |
+ gcc_hard_flags+=" -DEFAULT_PIE" |
980 |
+ elif hardened_gcc_works ssp ; then |
981 |
+ einfo "Updating gcc to use automatic SSP building ..." |
982 |
+ ewarn "PIE has not been enabled by default" |
983 |
+ gcc_hard_flags+=" -DEFAULT_SSP" |
984 |
+ else |
985 |
+ # do nothing if hardened isnt supported, but dont die either |
986 |
+ ewarn "hardened is not supported for this arch in this gcc version" |
987 |
+ ebeep |
988 |
+ return 0 |
989 |
+ fi |
990 |
+ |
991 |
+ sed -i \ |
992 |
+ -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \ |
993 |
+ "${S}"/gcc/Makefile.in || die |
994 |
+ |
995 |
+ # rebrand to make bug reports easier |
996 |
+ BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} |
997 |
+} |
998 |
+ |
999 |
+create_gcc_env_entry() { |
1000 |
+ dodir /etc/env.d/gcc |
1001 |
+ local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}" |
1002 |
+ |
1003 |
+ local gcc_specs_file |
1004 |
+ local gcc_envd_file="${ED}${gcc_envd_base}" |
1005 |
+ if [[ -z $1 ]] ; then |
1006 |
+ # I'm leaving the following commented out to remind me that it |
1007 |
+ # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset |
1008 |
+ # on chroot or in non-toolchain.eclass gcc ebuilds! |
1009 |
+ #gcc_specs_file="${LIBPATH}/specs" |
1010 |
+ gcc_specs_file="" |
1011 |
+ else |
1012 |
+ gcc_envd_file+="-$1" |
1013 |
+ gcc_specs_file="${EPREFIX}${LIBPATH}/$1.specs" |
1014 |
+ fi |
1015 |
+ |
1016 |
+ # We want to list the default ABI's LIBPATH first so libtool |
1017 |
+ # searches that directory first. This is a temporary |
1018 |
+ # workaround for libtool being stupid and using .la's from |
1019 |
+ # conflicting ABIs by using the first one in the search path |
1020 |
+ local ldpaths mosdirs |
1021 |
+ if tc_version_is_at_least 3.2 ; then |
1022 |
+ local mdir mosdir abi ldpath |
1023 |
+ for abi in $(get_all_abis TARGET) ; do |
1024 |
+ mdir=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) |
1025 |
+ ldpath=${EPREFIX}${LIBPATH} |
1026 |
+ [[ ${mdir} != "." ]] && ldpath+="/${mdir}" |
1027 |
+ ldpaths="${ldpath}${ldpaths:+:${ldpaths}}" |
1028 |
+ |
1029 |
+ mosdir=$($(XGCC) $(get_abi_CFLAGS ${abi}) -print-multi-os-directory) |
1030 |
+ mosdirs="${mosdir}${mosdirs:+:${mosdirs}}" |
1031 |
+ done |
1032 |
+ else |
1033 |
+ # Older gcc's didn't do multilib, so logic is simple. |
1034 |
+ ldpaths=${EPREFIX}${LIBPATH} |
1035 |
+ fi |
1036 |
+ |
1037 |
+ cat <<-EOF > ${gcc_envd_file} |
1038 |
+ PATH="${EPREFIX}${BINPATH}" |
1039 |
+ ROOTPATH="${EPREFIX}${BINPATH}" |
1040 |
+ GCC_PATH="${EPREFIX}${BINPATH}" |
1041 |
+ LDPATH="${ldpaths}" |
1042 |
+ MANPATH="${EPREFIX}${DATAPATH}/man" |
1043 |
+ INFOPATH="${EPREFIX}${DATAPATH}/info" |
1044 |
+ STDCXX_INCDIR="${STDCXX_INCDIR##*/}" |
1045 |
+ CTARGET="${CTARGET}" |
1046 |
+ GCC_SPECS="${gcc_specs_file}" |
1047 |
+ MULTIOSDIRS="${mosdirs}" |
1048 |
+ EOF |
1049 |
+} |
1050 |
+ |
1051 |
+setup_minispecs_gcc_build_specs() { |
1052 |
+ # Setup the "build.specs" file for gcc 4.3 to use when building. |
1053 |
+ if hardened_gcc_works pie ; then |
1054 |
+ cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs |
1055 |
+ fi |
1056 |
+ if hardened_gcc_works ssp ; then |
1057 |
+ for s in ssp sspall ; do |
1058 |
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
1059 |
+ done |
1060 |
+ fi |
1061 |
+ for s in nostrict znow ; do |
1062 |
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
1063 |
+ done |
1064 |
+ export GCC_SPECS="${WORKDIR}"/build.specs |
1065 |
+} |
1066 |
+ |
1067 |
+copy_minispecs_gcc_specs() { |
1068 |
+ # setup the hardenedno* specs files and the vanilla specs file. |
1069 |
+ if hardened_gcc_works ; then |
1070 |
+ create_gcc_env_entry hardenednopiessp |
1071 |
+ fi |
1072 |
+ if hardened_gcc_works pie ; then |
1073 |
+ create_gcc_env_entry hardenednopie |
1074 |
+ fi |
1075 |
+ if hardened_gcc_works ssp ; then |
1076 |
+ create_gcc_env_entry hardenednossp |
1077 |
+ fi |
1078 |
+ create_gcc_env_entry vanilla |
1079 |
+ insinto ${LIBPATH} |
1080 |
+ doins "${WORKDIR}"/specs/*.specs || die "failed to install specs" |
1081 |
+ # Build system specs file which, if it exists, must be a complete set of |
1082 |
+ # specs as it completely and unconditionally overrides the builtin specs. |
1083 |
+ if ! tc_version_is_at_least 4.4 ; then |
1084 |
+ $(XGCC) -dumpspecs > "${WORKDIR}"/specs/specs |
1085 |
+ cat "${WORKDIR}"/build.specs >> "${WORKDIR}"/specs/specs |
1086 |
+ doins "${WORKDIR}"/specs/specs || die "failed to install the specs file" |
1087 |
+ fi |
1088 |
+} |
1089 |
+ |
1090 |
+#----<< specs + env.d logic >>---- |
1091 |
+ |
1092 |
+#---->> pkg_* <<---- |
1093 |
+toolchain_pkg_setup() { |
1094 |
+ if [[ -n ${PRERELEASE}${SNAPSHOT} || ${PV} == *9999* ]] && |
1095 |
+ [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then |
1096 |
+ die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` or define it" \ |
1097 |
+ "in your make.conf if you want to use this version." |
1098 |
+ fi |
1099 |
+ |
1100 |
+ local realEPREFIX=$(python -c 'import os; print(os.path.realpath("'"${EPREFIX}"'"))') |
1101 |
+ if [[ ${EPREFIX} != ${realEPREFIX} ]] ; then |
1102 |
+ ewarn "Your \${EPREFIX} contains one or more symlinks. GCC has a" |
1103 |
+ ewarn "bug which prevents it from working properly when there are" |
1104 |
+ ewarn "symlinks in your \${EPREFIX}." |
1105 |
+ ewarn "See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29831" |
1106 |
+ fi |
1107 |
+ |
1108 |
+ # we dont want to use the installed compiler's specs to build gcc! |
1109 |
+ unset GCC_SPECS |
1110 |
+ |
1111 |
+ if ! use_if_iuse cxx ; then |
1112 |
+ use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' |
1113 |
+ use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' |
1114 |
+ use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"' |
1115 |
+ fi |
1116 |
+ |
1117 |
+ want_minispecs |
1118 |
+ |
1119 |
+ unset LANGUAGES #265283 |
1120 |
+} |
1121 |
+ |
1122 |
+toolchain_pkg_postinst() { |
1123 |
+ do_gcc_config |
1124 |
+ |
1125 |
+ if ! is_crosscompile ; then |
1126 |
+ echo |
1127 |
+ ewarn "If you have issues with packages unable to locate libstdc++.la," |
1128 |
+ ewarn "then try running 'fix_libtool_files.sh' on the old gcc versions." |
1129 |
+ echo |
1130 |
+ ewarn "You might want to review the GCC upgrade guide when moving between" |
1131 |
+ ewarn "major versions (like 4.2 to 4.3):" |
1132 |
+ ewarn "http://www.gentoo.org/doc/en/gcc-upgrading.xml" |
1133 |
+ echo |
1134 |
+ |
1135 |
+ # Clean up old paths |
1136 |
+ rm -f "${EROOT}"/*/rcscripts/awk/fixlafiles.awk "${EROOT}"/sbin/fix_libtool_files.sh |
1137 |
+ rmdir "${EROOT}"/*/rcscripts{/awk,} 2>/dev/null |
1138 |
+ |
1139 |
+ mkdir -p "${EROOT}"/usr/{share/gcc-data,sbin,bin} |
1140 |
+ cp "${EROOT}/${DATAPATH}"/fixlafiles.awk "${EROOT}"/usr/share/gcc-data/ || die |
1141 |
+ cp "${EROOT}/${DATAPATH}"/fix_libtool_files.sh "${EROOT}"/usr/sbin/ || die |
1142 |
+ |
1143 |
+ # Since these aren't critical files and portage sucks with |
1144 |
+ # handling of binpkgs, don't require these to be found |
1145 |
+ cp "${EROOT}/${DATAPATH}"/c{89,99} "${EROOT}"/usr/bin/ 2>/dev/null |
1146 |
+ fi |
1147 |
+ |
1148 |
+ if use regression-test ; then |
1149 |
+ elog "Testsuite results have been installed into /usr/share/doc/${PF}/testsuite" |
1150 |
+ echo |
1151 |
+ fi |
1152 |
+} |
1153 |
+ |
1154 |
+toolchain_pkg_postrm() { |
1155 |
+ # to make our lives easier (and saner), we do the fix_libtool stuff here. |
1156 |
+ # rather than checking SLOT's and trying in upgrade paths, we just see if |
1157 |
+ # the common libstdc++.la exists in the ${LIBPATH} of the gcc that we are |
1158 |
+ # unmerging. if it does, that means this was a simple re-emerge. |
1159 |
+ |
1160 |
+ # clean up the cruft left behind by cross-compilers |
1161 |
+ if is_crosscompile ; then |
1162 |
+ if [[ -z $(ls "${EROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then |
1163 |
+ rm -f "${EROOT}"/etc/env.d/gcc/config-${CTARGET} |
1164 |
+ rm -f "${EROOT}"/etc/env.d/??gcc-${CTARGET} |
1165 |
+ rm -f "${EROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} |
1166 |
+ fi |
1167 |
+ return 0 |
1168 |
+ fi |
1169 |
+ |
1170 |
+ # ROOT isnt handled by the script |
1171 |
+ [[ ${ROOT} != "/" ]] && return 0 |
1172 |
+ |
1173 |
+ if [[ ! -e ${EPREFIX}${LIBPATH}/libstdc++.so ]] ; then |
1174 |
+ # make sure the profile is sane during same-slot upgrade #289403 |
1175 |
+ do_gcc_config |
1176 |
+ |
1177 |
+ einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}'" |
1178 |
+ "${EPREFIX}"/usr/sbin/fix_libtool_files.sh ${GCC_RELEASE_VER} |
1179 |
+ if [[ -n ${BRANCH_UPDATE} ]] ; then |
1180 |
+ einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE}'" |
1181 |
+ "${EPREFIX}"/usr/sbin/fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE} |
1182 |
+ fi |
1183 |
+ fi |
1184 |
+ |
1185 |
+ return 0 |
1186 |
+} |
1187 |
+ |
1188 |
+#---->> pkg_* <<---- |
1189 |
+ |
1190 |
+#---->> src_* <<---- |
1191 |
+ |
1192 |
+guess_patch_type_in_dir() { |
1193 |
+ [[ -n $(ls "$1"/*.bz2 2>/dev/null) ]] \ |
1194 |
+ && EPATCH_SUFFIX="patch.bz2" \ |
1195 |
+ || EPATCH_SUFFIX="patch" |
1196 |
+} |
1197 |
+ |
1198 |
+do_gcc_rename_java_bins() { |
1199 |
+ # bug #139918 - conflict between gcc and java-config-2 for ownership of |
1200 |
+ # /usr/bin/rmi{c,registry}. Done with mv & sed rather than a patch |
1201 |
+ # because patches would be large (thanks to the rename of man files), |
1202 |
+ # and it's clear from the sed invocations that all that changes is the |
1203 |
+ # rmi{c,registry} names to grmi{c,registry} names. |
1204 |
+ # Kevin F. Quinn 2006-07-12 |
1205 |
+ einfo "Renaming jdk executables rmic and rmiregistry to grmic and grmiregistry." |
1206 |
+ # 1) Move the man files if present (missing prior to gcc-3.4) |
1207 |
+ for manfile in rmic rmiregistry ; do |
1208 |
+ [[ -f ${S}/gcc/doc/${manfile}.1 ]] || continue |
1209 |
+ mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1 |
1210 |
+ done |
1211 |
+ # 2) Fixup references in the docs if present (mission prior to gcc-3.4) |
1212 |
+ for jfile in gcc/doc/gcj.info gcc/doc/grmic.1 gcc/doc/grmiregistry.1 gcc/java/gcj.texi ; do |
1213 |
+ [[ -f ${S}/${jfile} ]] || continue |
1214 |
+ sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} || |
1215 |
+ die "Failed to fixup file ${jfile} for rename to grmiregistry" |
1216 |
+ sed -i -e 's:rmic:grmic:g' "${S}"/${jfile} || |
1217 |
+ die "Failed to fixup file ${jfile} for rename to grmic" |
1218 |
+ done |
1219 |
+ # 3) Fixup Makefiles to build the changed executable names |
1220 |
+ # These are present in all 3.x versions, and are the important bit |
1221 |
+ # to get gcc to build with the new names. |
1222 |
+ for jfile in libjava/Makefile.am libjava/Makefile.in gcc/java/Make-lang.in ; do |
1223 |
+ sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} || |
1224 |
+ die "Failed to fixup file ${jfile} for rename to grmiregistry" |
1225 |
+ # Careful with rmic on these files; it's also the name of a directory |
1226 |
+ # which should be left unchanged. Replace occurrences of 'rmic$', |
1227 |
+ # 'rmic_' and 'rmic '. |
1228 |
+ sed -i -e 's:rmic\([$_ ]\):grmic\1:g' "${S}"/${jfile} || |
1229 |
+ die "Failed to fixup file ${jfile} for rename to grmic" |
1230 |
+ done |
1231 |
+} |
1232 |
+ |
1233 |
+toolchain_src_unpack() { |
1234 |
+ [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && \ |
1235 |
+ die "Sorry, this version does not support uClibc" |
1236 |
+ |
1237 |
+ if [[ ${PV} == *9999* ]]; then |
1238 |
+ git-2_src_unpack |
1239 |
+ else |
1240 |
+ gcc_quick_unpack |
1241 |
+ fi |
1242 |
+ |
1243 |
+ export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}" |
1244 |
+ cd "${S}" |
1245 |
+ |
1246 |
+ if ! use vanilla ; then |
1247 |
+ if [[ -n ${PATCH_VER} ]] ; then |
1248 |
+ guess_patch_type_in_dir "${WORKDIR}"/patch |
1249 |
+ EPATCH_MULTI_MSG="Applying Gentoo patches ..." \ |
1250 |
+ epatch "${WORKDIR}"/patch |
1251 |
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}" |
1252 |
+ fi |
1253 |
+ if [[ -n ${UCLIBC_VER} ]] ; then |
1254 |
+ guess_patch_type_in_dir "${WORKDIR}"/uclibc |
1255 |
+ EPATCH_MULTI_MSG="Applying uClibc patches ..." \ |
1256 |
+ epatch "${WORKDIR}"/uclibc |
1257 |
+ fi |
1258 |
+ fi |
1259 |
+ do_gcc_HTB_patches |
1260 |
+ do_gcc_PIE_patches |
1261 |
+ epatch_user |
1262 |
+ |
1263 |
+ use hardened && make_gcc_hard |
1264 |
+ |
1265 |
+ # install the libstdc++ python into the right location |
1266 |
+ # http://gcc.gnu.org/PR51368 |
1267 |
+ if tc_version_is_at_least 4.5 && ! tc_version_is_at_least 4.7 ; then |
1268 |
+ sed -i \ |
1269 |
+ '/^pythondir =/s:=.*:= $(datadir)/python:' \ |
1270 |
+ "${S}"/libstdc++-v3/python/Makefile.in || die |
1271 |
+ fi |
1272 |
+ |
1273 |
+ # make sure the pkg config files install into multilib dirs. |
1274 |
+ # since we configure with just one --libdir, we can't use that |
1275 |
+ # (as gcc itself takes care of building multilibs). #435728 |
1276 |
+ find "${S}" -name Makefile.in \ |
1277 |
+ -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} + |
1278 |
+ |
1279 |
+ # No idea when this first started being fixed, but let's go with 4.3.x for now |
1280 |
+ if ! tc_version_is_at_least 4.3 ; then |
1281 |
+ fix_files="" |
1282 |
+ for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do |
1283 |
+ [[ -e ${x} ]] && fix_files="${fix_files} ${x}" |
1284 |
+ done |
1285 |
+ ht_fix_file ${fix_files} */configure *.sh */Makefile.in |
1286 |
+ fi |
1287 |
+ |
1288 |
+ setup_multilib_osdirnames |
1289 |
+ gcc_version_patch |
1290 |
+ |
1291 |
+ if tc_version_is_at_least 4.1 ; then |
1292 |
+ if [[ -n ${SNAPSHOT} || -n ${PRERELEASE} ]] ; then |
1293 |
+ # BASE-VER must be a three-digit version number |
1294 |
+ # followed by an optional -pre string |
1295 |
+ # eg. 4.5.1, 4.6.2-pre20120213, 4.7.0-pre9999 |
1296 |
+ # If BASE-VER differs from ${PV/_/-} then libraries get installed in |
1297 |
+ # the wrong directory. |
1298 |
+ echo ${PV/_/-} > "${S}"/gcc/BASE-VER |
1299 |
+ fi |
1300 |
+ fi |
1301 |
+ |
1302 |
+ # >= gcc-4.3 doesn't bundle ecj.jar, so copy it |
1303 |
+ if tc_version_is_at_least 4.3 && use gcj ; then |
1304 |
+ if tc_version_is_at_least 4.5 ; then |
1305 |
+ einfo "Copying ecj-4.5.jar" |
1306 |
+ cp -pPR "${DISTDIR}/ecj-4.5.jar" "${S}/ecj.jar" || die |
1307 |
+ else |
1308 |
+ einfo "Copying ecj-4.3.jar" |
1309 |
+ cp -pPR "${DISTDIR}/ecj-4.3.jar" "${S}/ecj.jar" || die |
1310 |
+ fi |
1311 |
+ fi |
1312 |
+ |
1313 |
+ # disable --as-needed from being compiled into gcc specs |
1314 |
+ # natively when using a gcc version < 3.4.4 |
1315 |
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14992 |
1316 |
+ if ! tc_version_is_at_least 3.4.4 ; then |
1317 |
+ sed -i -e s/HAVE_LD_AS_NEEDED/USE_LD_AS_NEEDED/g "${S}"/gcc/config.in |
1318 |
+ fi |
1319 |
+ |
1320 |
+ # In gcc 3.3.x and 3.4.x, rename the java bins to gcc-specific names |
1321 |
+ # in line with gcc-4. |
1322 |
+ if tc_version_is_at_least 3.3 && ! tc_version_is_at_least 4.0 ; then |
1323 |
+ do_gcc_rename_java_bins |
1324 |
+ fi |
1325 |
+ |
1326 |
+ # Prevent libffi from being installed |
1327 |
+ if tc_version_is_at_least 3.0 && ! tc_version_is_at_least 4.8 ; then |
1328 |
+ sed -i -e 's/\(install.*:\) install-.*recursive/\1/' "${S}"/libffi/Makefile.in || die |
1329 |
+ sed -i -e 's/\(install-data-am:\).*/\1/' "${S}"/libffi/include/Makefile.in || die |
1330 |
+ fi |
1331 |
+ |
1332 |
+ # Fixup libtool to correctly generate .la files with portage |
1333 |
+ elibtoolize --portage --shallow --no-uclibc |
1334 |
+ |
1335 |
+ gnuconfig_update |
1336 |
+ |
1337 |
+ # update configure files |
1338 |
+ local f |
1339 |
+ einfo "Fixing misc issues in configure files" |
1340 |
+ # TODO - check if we can drop this now that we don't gen info files |
1341 |
+ tc_version_is_at_least 4.1 && epatch "${GCC_FILESDIR}"/gcc-configure-texinfo.patch |
1342 |
+ for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do |
1343 |
+ ebegin " Updating ${f/${S}\/} [LANG]" |
1344 |
+ patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \ |
1345 |
+ || eerror "Please file a bug about this" |
1346 |
+ eend $? |
1347 |
+ done |
1348 |
+ sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828 |
1349 |
+ |
1350 |
+ if [[ -x contrib/gcc_update ]] ; then |
1351 |
+ einfo "Touching generated files" |
1352 |
+ ./contrib/gcc_update --touch | \ |
1353 |
+ while read f ; do |
1354 |
+ einfo " ${f%%...}" |
1355 |
+ done |
1356 |
+ fi |
1357 |
+} |
1358 |
+ |
1359 |
+gcc-abi-map() { |
1360 |
+ # Convert the ABI name we use in Gentoo to what gcc uses |
1361 |
+ local map=() |
1362 |
+ case ${CTARGET} in |
1363 |
+ mips*) map=("o32 32" "n32 n32" "n64 64") ;; |
1364 |
+ x86_64*) map=("amd64 m64" "x86 m32" "x32 mx32") ;; |
1365 |
+ esac |
1366 |
+ |
1367 |
+ local m |
1368 |
+ for m in "${map[@]}" ; do |
1369 |
+ l=( ${m} ) |
1370 |
+ [[ $1 == ${l[0]} ]] && echo ${l[1]} && break |
1371 |
+ done |
1372 |
+} |
1373 |
+ |
1374 |
+gcc-multilib-configure() { |
1375 |
+ if ! is_multilib ; then |
1376 |
+ confgcc+=( --disable-multilib ) |
1377 |
+ # Fun times: if we are building for a target that has multiple |
1378 |
+ # possible ABI formats, and the user has told us to pick one |
1379 |
+ # that isn't the default, then not specifying it via the list |
1380 |
+ # below will break that on us. |
1381 |
+ else |
1382 |
+ confgcc+=( --enable-multilib ) |
1383 |
+ fi |
1384 |
+ |
1385 |
+ # translate our notion of multilibs into gcc's |
1386 |
+ local abi list |
1387 |
+ for abi in $(get_all_abis TARGET) ; do |
1388 |
+ local l=$(gcc-abi-map ${abi}) |
1389 |
+ [[ -n ${l} ]] && list+=",${l}" |
1390 |
+ done |
1391 |
+ if [[ -n ${list} ]] ; then |
1392 |
+ case ${CTARGET} in |
1393 |
+ x86_64*) |
1394 |
+ tc_version_is_at_least 4.7 && confgcc+=( --with-multilib-list=${list:1} ) |
1395 |
+ ;; |
1396 |
+ esac |
1397 |
+ fi |
1398 |
+} |
1399 |
+ |
1400 |
+gcc-compiler-configure() { |
1401 |
+ gcc-multilib-configure |
1402 |
+ |
1403 |
+ if tc_version_is_at_least 4.0 ; then |
1404 |
+ if in_iuse mudflap ; then |
1405 |
+ confgcc+=( $(use_enable mudflap libmudflap) ) |
1406 |
+ else |
1407 |
+ confgcc+=( --disable-libmudflap ) |
1408 |
+ fi |
1409 |
+ |
1410 |
+ if use_if_iuse libssp ; then |
1411 |
+ confgcc+=( --enable-libssp ) |
1412 |
+ else |
1413 |
+ export gcc_cv_libc_provides_ssp=yes |
1414 |
+ confgcc+=( --disable-libssp ) |
1415 |
+ fi |
1416 |
+ |
1417 |
+ # If we want hardened support with the newer piepatchset for >=gcc 4.4 |
1418 |
+ if tc_version_is_at_least 4.4 && want_minispecs ; then |
1419 |
+ confgcc+=( $(use_enable hardened esp) ) |
1420 |
+ fi |
1421 |
+ |
1422 |
+ if tc_version_is_at_least 4.2 ; then |
1423 |
+ if in_iuse openmp ; then |
1424 |
+ # Make sure target has pthreads support. #326757 #335883 |
1425 |
+ # There shouldn't be a chicken&egg problem here as openmp won't |
1426 |
+ # build without a C library, and you can't build that w/out |
1427 |
+ # already having a compiler ... |
1428 |
+ if ! is_crosscompile || \ |
1429 |
+ $(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& /dev/null |
1430 |
+ then |
1431 |
+ confgcc+=( $(use_enable openmp libgomp) ) |
1432 |
+ else |
1433 |
+ # Force disable as the configure script can be dumb #359855 |
1434 |
+ confgcc+=( --disable-libgomp ) |
1435 |
+ fi |
1436 |
+ else |
1437 |
+ # For gcc variants where we don't want openmp (e.g. kgcc) |
1438 |
+ confgcc+=( --disable-libgomp ) |
1439 |
+ fi |
1440 |
+ fi |
1441 |
+ |
1442 |
+ # Stick the python scripts in their own slotted directory |
1443 |
+ # bug #279252 |
1444 |
+ # |
1445 |
+ # --with-python-dir=DIR |
1446 |
+ # Specifies where to install the Python modules used for aot-compile. DIR |
1447 |
+ # should not include the prefix used in installation. For example, if the |
1448 |
+ # Python modules are to be installed in /usr/lib/python2.5/site-packages, |
1449 |
+ # then --with-python-dir=/lib/python2.5/site-packages should be passed. |
1450 |
+ # |
1451 |
+ # This should translate into "/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}/python" |
1452 |
+ if tc_version_is_at_least 4.4 ; then |
1453 |
+ confgcc+=( --with-python-dir=${DATAPATH/$PREFIX/}/python ) |
1454 |
+ fi |
1455 |
+ fi |
1456 |
+ |
1457 |
+ # Enable build warnings by default with cross-compilers when system |
1458 |
+ # paths are included (e.g. via -I flags). |
1459 |
+ is_crosscompile && confgcc+=( --enable-poison-system-directories ) |
1460 |
+ |
1461 |
+ # For newer versions of gcc, use the default ("release"), because no |
1462 |
+ # one (even upstream apparently) tests with it disabled. #317217 |
1463 |
+ if tc_version_is_at_least 4 || [[ -n ${GCC_CHECKS_LIST} ]] ; then |
1464 |
+ confgcc+=( --enable-checking=${GCC_CHECKS_LIST:-release} ) |
1465 |
+ else |
1466 |
+ confgcc+=( --disable-checking ) |
1467 |
+ fi |
1468 |
+ |
1469 |
+ # GTK+ is preferred over xlib in 3.4.x (xlib is unmaintained |
1470 |
+ # right now). Much thanks to <csm@×××.org> for the heads up. |
1471 |
+ # Travis Tilley <lv@g.o> (11 Jul 2004) |
1472 |
+ if ! is_gcj ; then |
1473 |
+ confgcc+=( --disable-libgcj ) |
1474 |
+ elif use gtk ; then |
1475 |
+ confgcc+=( --enable-java-awt=gtk ) |
1476 |
+ fi |
1477 |
+ |
1478 |
+ # allow gcc to search for clock funcs in the main C lib. |
1479 |
+ # if it can't find them, then tough cookies -- we aren't |
1480 |
+ # going to link in -lrt to all C++ apps. #411681 |
1481 |
+ if tc_version_is_at_least 4.4 && is_cxx ; then |
1482 |
+ confgcc+=( --enable-libstdcxx-time ) |
1483 |
+ fi |
1484 |
+ |
1485 |
+ # newer gcc versions like to bootstrap themselves with C++, |
1486 |
+ # so we need to manually disable it ourselves |
1487 |
+ if tc_version_is_at_least 4.7 && ! is_cxx ; then |
1488 |
+ confgcc+=( --disable-build-with-cxx --disable-build-poststage1-with-cxx ) |
1489 |
+ fi |
1490 |
+ |
1491 |
+ # newer gcc's come with libquadmath, but only fortran uses |
1492 |
+ # it, so auto punt it when we don't care |
1493 |
+ if tc_version_is_at_least 4.6 && ! is_fortran ; then |
1494 |
+ confgcc+=( --disable-libquadmath ) |
1495 |
+ fi |
1496 |
+ |
1497 |
+ local with_abi_map=() |
1498 |
+ case $(tc-arch) in |
1499 |
+ arm) #264534 #414395 |
1500 |
+ local a arm_arch=${CTARGET%%-*} |
1501 |
+ # Remove trailing endian variations first: eb el be bl b l |
1502 |
+ for a in e{b,l} {b,l}e b l ; do |
1503 |
+ if [[ ${arm_arch} == *${a} ]] ; then |
1504 |
+ arm_arch=${arm_arch%${a}} |
1505 |
+ break |
1506 |
+ fi |
1507 |
+ done |
1508 |
+ # Convert armv7{a,r,m} to armv7-{a,r,m} |
1509 |
+ [[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-} |
1510 |
+ # See if this is a valid --with-arch flag |
1511 |
+ if (srcdir=${S}/gcc target=${CTARGET} with_arch=${arm_arch}; |
1512 |
+ . "${srcdir}"/config.gcc) &>/dev/null |
1513 |
+ then |
1514 |
+ confgcc+=( --with-arch=${arm_arch} ) |
1515 |
+ fi |
1516 |
+ |
1517 |
+ # Make default mode thumb for microcontroller classes #418209 |
1518 |
+ [[ ${arm_arch} == *-m ]] && confgcc+=( --with-mode=thumb ) |
1519 |
+ |
1520 |
+ # Enable hardvfp |
1521 |
+ if [[ $(tc-is-softfloat) == "no" ]] && \ |
1522 |
+ [[ ${CTARGET} == armv[67]* ]] && \ |
1523 |
+ tc_version_is_at_least 4.5 |
1524 |
+ then |
1525 |
+ # Follow the new arm hardfp distro standard by default |
1526 |
+ confgcc+=( --with-float=hard ) |
1527 |
+ case ${CTARGET} in |
1528 |
+ armv6*) confgcc+=( --with-fpu=vfp ) ;; |
1529 |
+ armv7*) confgcc+=( --with-fpu=vfpv3-d16 ) ;; |
1530 |
+ esac |
1531 |
+ fi |
1532 |
+ ;; |
1533 |
+ mips) |
1534 |
+ # Add --with-abi flags to set default ABI |
1535 |
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) ) |
1536 |
+ ;; |
1537 |
+ amd64) |
1538 |
+ # drop the older/ABI checks once this get's merged into some |
1539 |
+ # version of gcc upstream |
1540 |
+ if tc_version_is_at_least 4.7 && has x32 $(get_all_abis TARGET) ; then |
1541 |
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) ) |
1542 |
+ fi |
1543 |
+ ;; |
1544 |
+ x86) |
1545 |
+ # Default arch for x86 is normally i386, lets give it a bump |
1546 |
+ # since glibc will do so based on CTARGET anyways |
1547 |
+ confgcc+=( --with-arch=${CTARGET%%-*} ) |
1548 |
+ ;; |
1549 |
+ hppa) |
1550 |
+ # Enable sjlj exceptions for backward compatibility on hppa |
1551 |
+ [[ ${GCCMAJOR} == "3" ]] && confgcc+=( --enable-sjlj-exceptions ) |
1552 |
+ ;; |
1553 |
+ ppc) |
1554 |
+ # Set up defaults based on current CFLAGS |
1555 |
+ is-flagq -mfloat-gprs=double && confgcc+=( --enable-e500-double ) |
1556 |
+ [[ ${CTARGET//_/-} == *-e500v2-* ]] && confgcc+=( --enable-e500-double ) |
1557 |
+ ;; |
1558 |
+ esac |
1559 |
+ |
1560 |
+ local GCC_LANG="c" |
1561 |
+ is_cxx && GCC_LANG+=",c++" |
1562 |
+ is_d && GCC_LANG+=",d" |
1563 |
+ is_gcj && GCC_LANG+=",java" |
1564 |
+ is_go && GCC_LANG+=",go" |
1565 |
+ if is_objc || is_objcxx ; then |
1566 |
+ GCC_LANG+=",objc" |
1567 |
+ if tc_version_is_at_least 4 ; then |
1568 |
+ use objc-gc && confgcc+=( --enable-objc-gc ) |
1569 |
+ fi |
1570 |
+ is_objcxx && GCC_LANG+=",obj-c++" |
1571 |
+ fi |
1572 |
+ is_treelang && GCC_LANG+=",treelang" |
1573 |
+ |
1574 |
+ # fortran support just got sillier! the lang value can be f77 for |
1575 |
+ # fortran77, f95 for fortran95, or just plain old fortran for the |
1576 |
+ # currently supported standard depending on gcc version. |
1577 |
+ is_fortran && GCC_LANG+=",fortran" |
1578 |
+ is_f77 && GCC_LANG+=",f77" |
1579 |
+ is_f95 && GCC_LANG+=",f95" |
1580 |
+ |
1581 |
+ # We do NOT want 'ADA support' in here! |
1582 |
+ # is_ada && GCC_LANG+=",ada" |
1583 |
+ |
1584 |
+ einfo "configuring for GCC_LANG: ${GCC_LANG}" |
1585 |
+ confgcc+=( --enable-languages=${GCC_LANG} ) |
1586 |
+} |
1587 |
+ |
1588 |
+gcc_do_configure() { |
1589 |
+ local confgcc=( |
1590 |
+ --prefix="${EPREFIX}${PREFIX}" |
1591 |
+ --bindir="${EPREFIX}${BINPATH}" |
1592 |
+ --includedir="${EPREFIX}${INCLUDEPATH}" |
1593 |
+ --datadir="${EPREFIX}${DATAPATH}" |
1594 |
+ --mandir="${EPREFIX}${DATAPATH}/man" |
1595 |
+ --infodir="${EPREFIX}${DATAPATH}/info" |
1596 |
+ --with-gxx-include-dir="${EPREFIX}${STDCXX_INCDIR}" |
1597 |
+ ) |
1598 |
+ # On Darwin we need libdir to be set in order to get correct install names |
1599 |
+ # for things like libobjc-gnu, libgcj and libfortran. If we enable it on |
1600 |
+ # non-Darwin we screw up the behaviour this eclass relies on. We in |
1601 |
+ # particular need this over --libdir for bug #255315. |
1602 |
+ [[ ${CTARGET} == *-darwin* ]] && \ |
1603 |
+ confgcc+=( --enable-version-specific-runtime-libs ) |
1604 |
+ |
1605 |
+ # All our cross-compile logic goes here ! woo ! |
1606 |
+ confgcc+=( --host=${CHOST} ) |
1607 |
+ if is_crosscompile || tc-is-cross-compiler ; then |
1608 |
+ # Straight from the GCC install doc: |
1609 |
+ # "GCC has code to correctly determine the correct value for target |
1610 |
+ # for nearly all native systems. Therefore, we highly recommend you |
1611 |
+ # not provide a configure target when configuring a native compiler." |
1612 |
+ confgcc+=( --target=${CTARGET} ) |
1613 |
+ fi |
1614 |
+ [[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} ) |
1615 |
+ |
1616 |
+ # ppc altivec support |
1617 |
+ confgcc+=( $(use_enable altivec) ) |
1618 |
+ |
1619 |
+ # gcc has fixed-point arithmetic support in 4.3 for mips targets that can |
1620 |
+ # significantly increase compile time by several hours. This will allow |
1621 |
+ # users to control this feature in the event they need the support. |
1622 |
+ tc_version_is_at_least 4.3 && confgcc+=( $(use_enable fixed-point) ) |
1623 |
+ |
1624 |
+ # graphite was added in 4.4 but we only support it in 4.6+ due to external |
1625 |
+ # library issues. 4.6/4.7 uses cloog-ppl which is a fork of CLooG with a |
1626 |
+ # PPL backend. 4.8+ uses upstream CLooG with the ISL backend. We install |
1627 |
+ # cloog-ppl into a non-standard location to prevent collisions. |
1628 |
+ if tc_version_is_at_least 4.8 ; then |
1629 |
+ confgcc+=( $(use_with graphite cloog) ) |
1630 |
+ use graphite && confgcc+=( --disable-isl-version-check ) |
1631 |
+ elif tc_version_is_at_least 4.6 ; then |
1632 |
+ confgcc+=( $(use_with graphite cloog) ) |
1633 |
+ confgcc+=( $(use_with graphite ppl) ) |
1634 |
+ use graphite && confgcc+=( --with-cloog-include="${EPREFIX}"/usr/include/cloog-ppl ) |
1635 |
+ use graphite && confgcc+=( --disable-ppl-version-check ) |
1636 |
+ elif tc_version_is_at_least 4.4 ; then |
1637 |
+ confgcc+=( --without-cloog ) |
1638 |
+ confgcc+=( --without-ppl ) |
1639 |
+ fi |
1640 |
+ |
1641 |
+ if tc_version_is_at_least 4.6 ; then |
1642 |
+ confgcc+=( $(use_enable lto) ) |
1643 |
+ elif tc_version_is_at_least 4.5 ; then |
1644 |
+ confgcc+=( --disable-lto ) |
1645 |
+ fi |
1646 |
+ |
1647 |
+ case $(tc-is-softfloat) in |
1648 |
+ yes) confgcc+=( --with-float=soft ) ;; |
1649 |
+ softfp) confgcc+=( --with-float=softfp ) ;; |
1650 |
+ *) |
1651 |
+ # If they've explicitly opt-ed in, do hardfloat, |
1652 |
+ # otherwise let the gcc default kick in. |
1653 |
+ [[ ${CTARGET//_/-} == *-hardfloat-* ]] \ |
1654 |
+ && confgcc+=( --with-float=hard ) |
1655 |
+ ;; |
1656 |
+ esac |
1657 |
+ |
1658 |
+ # Native Language Support |
1659 |
+ if use nls ; then |
1660 |
+ confgcc+=( --enable-nls --without-included-gettext ) |
1661 |
+ else |
1662 |
+ confgcc+=( --disable-nls ) |
1663 |
+ fi |
1664 |
+ |
1665 |
+ # reasonably sane globals (hopefully) |
1666 |
+ confgcc+=( |
1667 |
+ --with-system-zlib |
1668 |
+ --enable-obsolete |
1669 |
+ --disable-werror |
1670 |
+ --enable-secureplt |
1671 |
+ ) |
1672 |
+ |
1673 |
+ gcc-compiler-configure || die |
1674 |
+ |
1675 |
+ if is_crosscompile ; then |
1676 |
+ # When building a stage1 cross-compiler (just C compiler), we have to |
1677 |
+ # disable a bunch of features or gcc goes boom |
1678 |
+ local needed_libc="" |
1679 |
+ case ${CTARGET} in |
1680 |
+ *-linux) needed_libc=no-fucking-clue;; |
1681 |
+ *-dietlibc) needed_libc=dietlibc;; |
1682 |
+ *-elf|*-eabi) needed_libc=newlib;; |
1683 |
+ *-freebsd*) needed_libc=freebsd-lib;; |
1684 |
+ *-gnu*) needed_libc=glibc;; |
1685 |
+ *-klibc) needed_libc=klibc;; |
1686 |
+ *-musl*) needed_libc=musl;; |
1687 |
+ *-uclibc*) |
1688 |
+ if ! echo '#include <features.h>' | \ |
1689 |
+ $(tc-getCPP ${CTARGET}) -E -dD - 2>/dev/null | \ |
1690 |
+ grep -q __HAVE_SHARED__ |
1691 |
+ then #291870 |
1692 |
+ confgcc+=( --disable-shared ) |
1693 |
+ fi |
1694 |
+ needed_libc=uclibc |
1695 |
+ ;; |
1696 |
+ *-cygwin) needed_libc=cygwin;; |
1697 |
+ x86_64-*-mingw*|\ |
1698 |
+ *-w64-mingw*) needed_libc=mingw64-runtime;; |
1699 |
+ mingw*|*-mingw*) needed_libc=mingw-runtime;; |
1700 |
+ avr) confgcc+=( --enable-shared --disable-threads );; |
1701 |
+ *-apple-darwin*) confgcc+=( --with-sysroot="${EPREFIX}"${PREFIX}/${CTARGET} );; |
1702 |
+ *-solaris*) confgcc+=( --with-sysroot="${EPREFIX}"${PREFIX}/${CTARGET} );; |
1703 |
+ *-freebsd*) confgcc+=( --with-sysroot="${EPREFIX}"${PREFIX}/${CTARGET} );; |
1704 |
+ esac |
1705 |
+ if [[ -n ${needed_libc} ]] ; then |
1706 |
+ local confgcc_no_libc=( --disable-shared ) |
1707 |
+ tc_version_is_at_least 4.8 && confgcc_no_libc+=( --disable-libatomic ) |
1708 |
+ if ! has_version ${CATEGORY}/${needed_libc} ; then |
1709 |
+ confgcc+=( |
1710 |
+ "${confgcc_no_libc[@]}" |
1711 |
+ --disable-threads |
1712 |
+ --without-headers |
1713 |
+ ) |
1714 |
+ elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then |
1715 |
+ confgcc+=( |
1716 |
+ "${confgcc_no_libc[@]}" |
1717 |
+ --with-sysroot="${EPREFIX}"${PREFIX}/${CTARGET} |
1718 |
+ ) |
1719 |
+ else |
1720 |
+ confgcc+=( --with-sysroot="${EPREFIX}"${PREFIX}/${CTARGET} ) |
1721 |
+ fi |
1722 |
+ fi |
1723 |
+ |
1724 |
+ tc_version_is_at_least 4.2 && confgcc+=( --disable-bootstrap ) |
1725 |
+ else |
1726 |
+ if tc-is-static-only ; then |
1727 |
+ confgcc+=( --disable-shared ) |
1728 |
+ else |
1729 |
+ confgcc+=( --enable-shared ) |
1730 |
+ fi |
1731 |
+ case ${CHOST} in |
1732 |
+ mingw*|*-mingw*|*-cygwin) |
1733 |
+ confgcc+=( --enable-threads=win32 ) ;; |
1734 |
+ *) |
1735 |
+ confgcc+=( --enable-threads=posix ) ;; |
1736 |
+ esac |
1737 |
+ |
1738 |
+ if use prefix ; then |
1739 |
+ # should be /usr, because it's the path to search includes for, |
1740 |
+ # which is unrelated to TOOLCHAIN_PREFIX, a.k.a. PREFIX |
1741 |
+ confgcc+=( --with-local-prefix="${TPREFIX}"/usr ) |
1742 |
+ fi |
1743 |
+ fi |
1744 |
+ # __cxa_atexit is "essential for fully standards-compliant handling of |
1745 |
+ # destructors", but apparently requires glibc. |
1746 |
+ case ${CTARGET} in |
1747 |
+ *-uclibc*) |
1748 |
+ confgcc+=( |
1749 |
+ --disable-__cxa_atexit |
1750 |
+ $(use_enable nptl tls) |
1751 |
+ ) |
1752 |
+ [[ ${GCCMAJOR}.${GCCMINOR} == 3.3 ]] && confgcc+=( --enable-sjlj-exceptions ) |
1753 |
+ if tc_version_is_at_least 3.4 && ! tc_version_is_at_least 4.3 ; then |
1754 |
+ confgcc+=( --enable-clocale=uclibc ) |
1755 |
+ fi |
1756 |
+ ;; |
1757 |
+ *-elf|*-eabi) |
1758 |
+ confgcc+=( --with-newlib ) |
1759 |
+ ;; |
1760 |
+ *-gnu*) |
1761 |
+ confgcc+=( |
1762 |
+ --enable-__cxa_atexit |
1763 |
+ --enable-clocale=gnu |
1764 |
+ ) |
1765 |
+ ;; |
1766 |
+ *-freebsd*) |
1767 |
+ confgcc+=( --enable-__cxa_atexit ) |
1768 |
+ ;; |
1769 |
+ *-solaris*) |
1770 |
+ confgcc+=( --enable-__cxa_atexit ) |
1771 |
+ ;; |
1772 |
+ esac |
1773 |
+ |
1774 |
+ tc_version_is_at_least 3.4 || confgcc+=( --disable-libunwind-exceptions ) |
1775 |
+ |
1776 |
+ # if the target can do biarch (-m32/-m64), enable it. overhead should |
1777 |
+ # be small, and should simplify building of 64bit kernels in a 32bit |
1778 |
+ # userland by not needing sys-devel/kgcc64. #349405 |
1779 |
+ if ! use prefix ; then |
1780 |
+ case $(tc-arch) in |
1781 |
+ ppc|ppc64) tc_version_is_at_least 3.4 && confgcc+=( --enable-targets=all ) ;; |
1782 |
+ sparc) tc_version_is_at_least 4.4 && confgcc+=( --enable-targets=all ) ;; |
1783 |
+ amd64|x86) tc_version_is_at_least 4.3 && confgcc+=( --enable-targets=all ) ;; |
1784 |
+ esac |
1785 |
+ fi |
1786 |
+ |
1787 |
+ tc_version_is_at_least 4.3 && confgcc+=( |
1788 |
+ --with-bugurl=http://bugs.gentoo.org/ |
1789 |
+ --with-pkgversion="${BRANDING_GCC_PKGVERSION}" |
1790 |
+ ) |
1791 |
+ |
1792 |
+ confgcc+=( |
1793 |
+ "$@" |
1794 |
+ ${EXTRA_ECONF} |
1795 |
+ ) |
1796 |
+ |
1797 |
+ # Disable gcc info regeneration -- it ships with generated info pages |
1798 |
+ # already. Our custom version/urls/etc... trigger it. #464008 |
1799 |
+ export gcc_cv_prog_makeinfo_modern=no |
1800 |
+ |
1801 |
+ # Do not let the X detection get in our way. We know things can be found |
1802 |
+ # via system paths, so no need to hardcode things that'll break multilib. |
1803 |
+ # Older gcc versions will detect ac_x_libraries=/usr/lib64 which ends up |
1804 |
+ # killing the 32bit builds which want /usr/lib. |
1805 |
+ export ac_cv_have_x='have_x=yes ac_x_includes= ac_x_libraries=' |
1806 |
+ |
1807 |
+ # Nothing wrong with a good dose of verbosity |
1808 |
+ echo |
1809 |
+ einfo "EPREFIX: ${EPREFIX}" |
1810 |
+ einfo "PREFIX: ${PREFIX}" |
1811 |
+ einfo "BINPATH: ${BINPATH}" |
1812 |
+ einfo "LIBPATH: ${LIBPATH}" |
1813 |
+ einfo "DATAPATH: ${DATAPATH}" |
1814 |
+ einfo "STDCXX_INCDIR: ${STDCXX_INCDIR}" |
1815 |
+ echo |
1816 |
+ einfo "Configuring GCC with: ${confgcc[@]//--/\n\t--}" |
1817 |
+ echo |
1818 |
+ |
1819 |
+ # Build in a separate build tree |
1820 |
+ mkdir -p "${WORKDIR}"/build |
1821 |
+ pushd "${WORKDIR}"/build > /dev/null |
1822 |
+ |
1823 |
+ # and now to do the actual configuration |
1824 |
+ addwrite /dev/zero |
1825 |
+ echo "${S}"/configure "${confgcc[@]}" |
1826 |
+ "${S}"/configure "${confgcc[@]}" || die "failed to run configure" |
1827 |
+ |
1828 |
+ # return to whatever directory we were in before |
1829 |
+ popd > /dev/null |
1830 |
+} |
1831 |
+ |
1832 |
+has toolchain_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" toolchain_death_notice" |
1833 |
+toolchain_death_notice() { |
1834 |
+ pushd "${WORKDIR}"/build >/dev/null |
1835 |
+ tar jcf gcc-build-logs.tar.bz2 $(find -name config.log) |
1836 |
+ eerror |
1837 |
+ eerror "Please include ${PWD}/gcc-build-logs.tar.bz2 in your bug report" |
1838 |
+ eerror |
1839 |
+ popd >/dev/null |
1840 |
+} |
1841 |
+ |
1842 |
+# This function accepts one optional argument, the make target to be used. |
1843 |
+# If ommitted, gcc_do_make will try to guess whether it should use all, |
1844 |
+# profiledbootstrap, or bootstrap-lean depending on CTARGET and arch. An |
1845 |
+# example of how to use this function: |
1846 |
+# |
1847 |
+# gcc_do_make all-target-libstdc++-v3 |
1848 |
+# |
1849 |
+# In addition to the target to be used, the following variables alter the |
1850 |
+# behavior of this function: |
1851 |
+# |
1852 |
+# LDFLAGS |
1853 |
+# Flags to pass to ld |
1854 |
+# |
1855 |
+# STAGE1_CFLAGS |
1856 |
+# CFLAGS to use during stage1 of a gcc bootstrap |
1857 |
+# |
1858 |
+# BOOT_CFLAGS |
1859 |
+# CFLAGS to use during stages 2+3 of a gcc bootstrap. |
1860 |
+# |
1861 |
+# Travis Tilley <lv@g.o> (04 Sep 2004) |
1862 |
+# |
1863 |
+gcc_do_make() { |
1864 |
+ # Set make target to $1 if passed |
1865 |
+ [[ -n $1 ]] && GCC_MAKE_TARGET=$1 |
1866 |
+ # default target |
1867 |
+ if is_crosscompile || tc-is-cross-compiler ; then |
1868 |
+ # 3 stage bootstrapping doesnt quite work when you cant run the |
1869 |
+ # resulting binaries natively ^^; |
1870 |
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all} |
1871 |
+ else |
1872 |
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean} |
1873 |
+ fi |
1874 |
+ |
1875 |
+ # the gcc docs state that parallel make isnt supported for the |
1876 |
+ # profiledbootstrap target, as collisions in profile collecting may occur. |
1877 |
+ # boundschecking also seems to introduce parallel build issues. |
1878 |
+ if [[ ${GCC_MAKE_TARGET} == "profiledbootstrap" ]] || |
1879 |
+ use_if_iuse boundschecking |
1880 |
+ then |
1881 |
+ export MAKEOPTS="${MAKEOPTS} -j1" |
1882 |
+ fi |
1883 |
+ |
1884 |
+ if [[ ${GCC_MAKE_TARGET} == "all" ]] ; then |
1885 |
+ STAGE1_CFLAGS=${STAGE1_CFLAGS-"${CFLAGS}"} |
1886 |
+ elif [[ $(gcc-version) == "3.4" && ${GCC_BRANCH_VER} == "3.4" ]] && gcc-specs-ssp ; then |
1887 |
+ # See bug #79852 |
1888 |
+ STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} |
1889 |
+ fi |
1890 |
+ |
1891 |
+ if is_crosscompile; then |
1892 |
+ # In 3.4, BOOT_CFLAGS is never used on a crosscompile... |
1893 |
+ # but I'll leave this in anyways as someone might have had |
1894 |
+ # some reason for putting it in here... --eradicator |
1895 |
+ BOOT_CFLAGS=${BOOT_CFLAGS-"-O2"} |
1896 |
+ else |
1897 |
+ # we only want to use the system's CFLAGS if not building a |
1898 |
+ # cross-compiler. |
1899 |
+ BOOT_CFLAGS=${BOOT_CFLAGS-"$(get_abi_CFLAGS ${TARGET_DEFAULT_ABI}) ${CFLAGS}"} |
1900 |
+ fi |
1901 |
+ |
1902 |
+ pushd "${WORKDIR}"/build >/dev/null |
1903 |
+ |
1904 |
+ # we "undef" T because the GCC makefiles use this variable, and if it's set |
1905 |
+ # in the environment (like Portage does) the build fails, bug #286494 |
1906 |
+ emake \ |
1907 |
+ T= \ |
1908 |
+ LDFLAGS="${LDFLAGS}" \ |
1909 |
+ STAGE1_CFLAGS="${STAGE1_CFLAGS}" \ |
1910 |
+ LIBPATH="${EPREFIX}${LIBPATH}" \ |
1911 |
+ BOOT_CFLAGS="${BOOT_CFLAGS}" \ |
1912 |
+ ${GCC_MAKE_TARGET} \ |
1913 |
+ || die "emake failed with ${GCC_MAKE_TARGET}" |
1914 |
+ |
1915 |
+ if ! is_crosscompile && use cxx && use_if_iuse doc ; then |
1916 |
+ if type -p doxygen > /dev/null ; then |
1917 |
+ if tc_version_is_at_least 4.3 ; then |
1918 |
+ cd "${CTARGET}"/libstdc++-v3/doc |
1919 |
+ emake doc-man-doxygen || ewarn "failed to make docs" |
1920 |
+ elif tc_version_is_at_least 3.0 ; then |
1921 |
+ cd "${CTARGET}"/libstdc++-v3 |
1922 |
+ emake doxygen-man || ewarn "failed to make docs" |
1923 |
+ fi |
1924 |
+ else |
1925 |
+ ewarn "Skipping libstdc++ manpage generation since you don't have doxygen installed" |
1926 |
+ fi |
1927 |
+ fi |
1928 |
+ |
1929 |
+ popd >/dev/null |
1930 |
+} |
1931 |
+ |
1932 |
+gcc_do_filter_flags() { |
1933 |
+ |
1934 |
+ strip-flags |
1935 |
+ |
1936 |
+ # In general gcc does not like optimization, and add -O2 where |
1937 |
+ # it is safe. This is especially true for gcc 3.3 + 3.4 |
1938 |
+ replace-flags -O? -O2 |
1939 |
+ |
1940 |
+ # ... sure, why not? |
1941 |
+ strip-unsupported-flags |
1942 |
+ |
1943 |
+ # dont want to funk ourselves |
1944 |
+ filter-flags '-mabi*' -m31 -m32 -m64 |
1945 |
+ |
1946 |
+ case ${GCC_BRANCH_VER} in |
1947 |
+ 3.2|3.3) |
1948 |
+ replace-cpu-flags k8 athlon64 opteron i686 x86-64 |
1949 |
+ replace-cpu-flags pentium-m pentium3m pentium3 |
1950 |
+ case $(tc-arch) in |
1951 |
+ amd64|x86) filter-flags '-mtune=*' ;; |
1952 |
+ # in gcc 3.3 there is a bug on ppc64 where if -mcpu is used, |
1953 |
+ # the compiler wrongly assumes a 32bit target |
1954 |
+ ppc64) filter-flags "-mcpu=*";; |
1955 |
+ esac |
1956 |
+ case $(tc-arch) in |
1957 |
+ amd64) replace-cpu-flags core2 nocona;; |
1958 |
+ x86) replace-cpu-flags core2 prescott;; |
1959 |
+ esac |
1960 |
+ |
1961 |
+ replace-cpu-flags G3 750 |
1962 |
+ replace-cpu-flags G4 7400 |
1963 |
+ replace-cpu-flags G5 7400 |
1964 |
+ |
1965 |
+ # XXX: should add a sed or something to query all supported flags |
1966 |
+ # from the gcc source and trim everything else ... |
1967 |
+ filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs |
1968 |
+ filter-flags -f{no-,}stack-protector{,-all} |
1969 |
+ filter-flags -fvisibility-inlines-hidden -fvisibility=hidden |
1970 |
+ ;; |
1971 |
+ 3.4|4.*) |
1972 |
+ case $(tc-arch) in |
1973 |
+ x86|amd64) filter-flags '-mcpu=*';; |
1974 |
+ *-macos) |
1975 |
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25127 |
1976 |
+ [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \ |
1977 |
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' |
1978 |
+ ;; |
1979 |
+ esac |
1980 |
+ ;; |
1981 |
+ esac |
1982 |
+ |
1983 |
+ case ${GCC_BRANCH_VER} in |
1984 |
+ 4.6) |
1985 |
+ # https://bugs.gentoo.org/411333 |
1986 |
+ # https://bugs.gentoo.org/466454 |
1987 |
+ replace-cpu-flags c3-2 pentium2 pentium3 pentium3m pentium-m i686 |
1988 |
+ ;; |
1989 |
+ esac |
1990 |
+ |
1991 |
+ # TODO: Move to gcc_do_make() |
1992 |
+ |
1993 |
+ # CFLAGS logic (verified with 3.4.3): |
1994 |
+ # CFLAGS: |
1995 |
+ # This conflicts when creating a crosscompiler, so set to a sane |
1996 |
+ # default in this case: |
1997 |
+ # used in ./configure and elsewhere for the native compiler |
1998 |
+ # used by gcc when creating libiberty.a |
1999 |
+ # used by xgcc when creating libstdc++ (and probably others)! |
2000 |
+ # this behavior should be removed... |
2001 |
+ # |
2002 |
+ # CXXFLAGS: |
2003 |
+ # used by xgcc when creating libstdc++ |
2004 |
+ # |
2005 |
+ # STAGE1_CFLAGS (not used in creating a crosscompile gcc): |
2006 |
+ # used by ${CHOST}-gcc for building stage1 compiler |
2007 |
+ # |
2008 |
+ # BOOT_CFLAGS (not used in creating a crosscompile gcc): |
2009 |
+ # used by xgcc for building stage2/3 compiler |
2010 |
+ |
2011 |
+ if is_crosscompile ; then |
2012 |
+ # Set this to something sane for both native and target |
2013 |
+ CFLAGS="-O2 -pipe" |
2014 |
+ FFLAGS=${CFLAGS} |
2015 |
+ FCFLAGS=${CFLAGS} |
2016 |
+ |
2017 |
+ local VAR="CFLAGS_"${CTARGET//-/_} |
2018 |
+ CXXFLAGS=${!VAR} |
2019 |
+ fi |
2020 |
+ |
2021 |
+ export GCJFLAGS=${GCJFLAGS:-${CFLAGS}} |
2022 |
+} |
2023 |
+ |
2024 |
+toolchain_src_compile() { |
2025 |
+ gcc_do_filter_flags |
2026 |
+ einfo "CFLAGS=\"${CFLAGS}\"" |
2027 |
+ einfo "CXXFLAGS=\"${CXXFLAGS}\"" |
2028 |
+ |
2029 |
+ # Force internal zip based jar script to avoid random |
2030 |
+ # issues with 3rd party jar implementations. #384291 |
2031 |
+ export JAR=no |
2032 |
+ |
2033 |
+ # For hardened gcc 4.3 piepatchset to build the hardened specs |
2034 |
+ # file (build.specs) to use when building gcc. |
2035 |
+ if ! tc_version_is_at_least 4.4 && want_minispecs ; then |
2036 |
+ setup_minispecs_gcc_build_specs |
2037 |
+ fi |
2038 |
+ # Build in a separate build tree |
2039 |
+ mkdir -p "${WORKDIR}"/build |
2040 |
+ pushd "${WORKDIR}"/build > /dev/null |
2041 |
+ |
2042 |
+ einfo "Configuring ${PN} ..." |
2043 |
+ gcc_do_configure |
2044 |
+ |
2045 |
+ touch "${S}"/gcc/c-gperf.h |
2046 |
+ |
2047 |
+ # Do not make manpages if we do not have perl ... |
2048 |
+ [[ ! -x ${EPREFIX}/usr/bin/perl ]] \ |
2049 |
+ && find "${WORKDIR}"/build -name '*.[17]' | xargs touch |
2050 |
+ |
2051 |
+ einfo "Compiling ${PN} ..." |
2052 |
+ gcc_do_make ${GCC_MAKE_TARGET} |
2053 |
+ |
2054 |
+ popd > /dev/null |
2055 |
+} |
2056 |
+ |
2057 |
+toolchain_src_test() { |
2058 |
+ if use regression-test ; then |
2059 |
+ cd "${WORKDIR}"/build |
2060 |
+ emake -k check |
2061 |
+ fi |
2062 |
+} |
2063 |
+ |
2064 |
+toolchain_src_install() { |
2065 |
+ cd "${WORKDIR}"/build |
2066 |
+ |
2067 |
+ # Do allow symlinks in private gcc include dir as this can break the build |
2068 |
+ find gcc/include*/ -type l -delete |
2069 |
+ |
2070 |
+ # Copy over the info pages. We disabled their generation earlier, but the |
2071 |
+ # build system only expects to install out of the build dir, not the source. #464008 |
2072 |
+ mkdir -p gcc/doc |
2073 |
+ local x= |
2074 |
+ for x in "${S}"/gcc/doc/*.info* ; do |
2075 |
+ if [[ -f ${x} ]] ; then |
2076 |
+ cp "${x}" gcc/doc/ || die |
2077 |
+ fi |
2078 |
+ done |
2079 |
+ |
2080 |
+ # Remove generated headers, as they can cause things to break |
2081 |
+ # (ncurses, openssl, etc). |
2082 |
+ while read x ; do |
2083 |
+ grep -q 'It has been auto-edited by fixincludes from' "${x}" \ |
2084 |
+ && rm -f "${x}" |
2085 |
+ done < <(find gcc/include*/ -name '*.h') |
2086 |
+ |
2087 |
+ # Do the 'make install' from the build directory |
2088 |
+ S="${WORKDIR}"/build emake -j1 DESTDIR="${D}" install || die |
2089 |
+ |
2090 |
+ # Punt some tools which are really only useful while building gcc |
2091 |
+ find "${ED}" -name install-tools -prune -type d -exec rm -rf "{}" \; |
2092 |
+ # This one comes with binutils |
2093 |
+ find "${ED}" -name libiberty.a -delete |
2094 |
+ |
2095 |
+ # Move the libraries to the proper location |
2096 |
+ gcc_movelibs |
2097 |
+ |
2098 |
+ # Basic sanity check |
2099 |
+ if ! is_crosscompile ; then |
2100 |
+ local EXEEXT |
2101 |
+ eval $(grep ^EXEEXT= "${WORKDIR}"/build/gcc/config.log) |
2102 |
+ [[ -r ${ED}${BINPATH}/gcc${EXEEXT} ]] || die "gcc not found in ${ED}" |
2103 |
+ fi |
2104 |
+ |
2105 |
+ dodir /etc/env.d/gcc |
2106 |
+ create_gcc_env_entry |
2107 |
+ |
2108 |
+ # Setup the gcc_env_entry for hardened gcc 4 with minispecs |
2109 |
+ want_minispecs && copy_minispecs_gcc_specs |
2110 |
+ |
2111 |
+ # Make sure we dont have stuff lying around that |
2112 |
+ # can nuke multiple versions of gcc |
2113 |
+ gcc_slot_java |
2114 |
+ |
2115 |
+ dodir /usr/bin |
2116 |
+ cd "${ED}"${BINPATH} |
2117 |
+ # Ugh: we really need to auto-detect this list. |
2118 |
+ # It's constantly out of date. |
2119 |
+ for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do |
2120 |
+ # For some reason, g77 gets made instead of ${CTARGET}-g77... |
2121 |
+ # this should take care of that |
2122 |
+ [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x} |
2123 |
+ |
2124 |
+ if [[ -f ${CTARGET}-${x} ]] ; then |
2125 |
+ if ! is_crosscompile ; then |
2126 |
+ ln -sf ${CTARGET}-${x} ${x} |
2127 |
+ dosym ${BINPATH}/${CTARGET}-${x} \ |
2128 |
+ /usr/bin/${x}-${GCC_CONFIG_VER} |
2129 |
+ fi |
2130 |
+ # Create versioned symlinks |
2131 |
+ dosym ${BINPATH}/${CTARGET}-${x} \ |
2132 |
+ /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER} |
2133 |
+ fi |
2134 |
+ |
2135 |
+ if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then |
2136 |
+ rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER} |
2137 |
+ ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} |
2138 |
+ fi |
2139 |
+ done |
2140 |
+ |
2141 |
+ # Now do the fun stripping stuff |
2142 |
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${ED}${BINPATH}" |
2143 |
+ env RESTRICT="" CHOST=${CTARGET} prepstrip "${ED}${LIBPATH}" |
2144 |
+ # gcc used to install helper binaries in lib/ but then moved to libexec/ |
2145 |
+ [[ -d ${ED}${PREFIX}/libexec/gcc ]] && \ |
2146 |
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${ED}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}" |
2147 |
+ |
2148 |
+ cd "${S}" |
2149 |
+ if is_crosscompile; then |
2150 |
+ rm -rf "${ED}"/usr/share/{man,info} |
2151 |
+ rm -rf "${ED}"${DATAPATH}/{man,info} |
2152 |
+ else |
2153 |
+ if tc_version_is_at_least 3.0 ; then |
2154 |
+ local cxx_mandir=$(find "${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man) |
2155 |
+ if [[ -d ${cxx_mandir} ]] ; then |
2156 |
+ # clean bogus manpages #113902 |
2157 |
+ find "${cxx_mandir}" -name '*_build_*' -exec rm {} \; |
2158 |
+ cp -r "${cxx_mandir}"/man? "${ED}/${DATAPATH}"/man/ |
2159 |
+ fi |
2160 |
+ fi |
2161 |
+ has noinfo ${FEATURES} \ |
2162 |
+ && rm -r "${ED}/${DATAPATH}"/info \ |
2163 |
+ || prepinfo "${DATAPATH}" |
2164 |
+ has noman ${FEATURES} \ |
2165 |
+ && rm -r "${ED}/${DATAPATH}"/man \ |
2166 |
+ || prepman "${DATAPATH}" |
2167 |
+ fi |
2168 |
+ # prune empty dirs left behind |
2169 |
+ find "${ED}" -depth -type d -delete 2>/dev/null |
2170 |
+ |
2171 |
+ # install testsuite results |
2172 |
+ if use regression-test; then |
2173 |
+ docinto testsuite |
2174 |
+ find "${WORKDIR}"/build -type f -name "*.sum" -print0 | xargs -0 dodoc |
2175 |
+ find "${WORKDIR}"/build -type f -path "*/testsuite/*.log" -print0 \ |
2176 |
+ | xargs -0 dodoc |
2177 |
+ fi |
2178 |
+ |
2179 |
+ # Rather install the script, else portage with changing $FILESDIR |
2180 |
+ # between binary and source package borks things .... |
2181 |
+ if ! is_crosscompile ; then |
2182 |
+ cp "${GCC_FILESDIR}"/fix_libtool_files.sh "${T}" |
2183 |
+ cp "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la "${T}" |
2184 |
+ cp "${GCC_FILESDIR}"/awk/fixlafiles.awk "${T}" |
2185 |
+ eprefixify \ |
2186 |
+ "${T}"/fix_libtool_files.sh \ |
2187 |
+ "${T}"/fixlafiles.awk-no_gcc_la \ |
2188 |
+ "${T}"/fixlafiles.awk |
2189 |
+ |
2190 |
+ insinto "${DATAPATH}" |
2191 |
+ if tc_version_is_at_least 4.0 ; then |
2192 |
+ newins "${T}"/fixlafiles.awk-no_gcc_la fixlafiles.awk || die |
2193 |
+ find "${ED}/${LIBPATH}" -name libstdc++.la -type f -exec rm "{}" \; |
2194 |
+ else |
2195 |
+ doins "${T}"/fixlafiles.awk || die |
2196 |
+ fi |
2197 |
+ exeinto "${DATAPATH}" |
2198 |
+ doexe "${T}"/fix_libtool_files.sh || die |
2199 |
+ doexe "${GCC_FILESDIR}"/c{89,99} || die |
2200 |
+ fi |
2201 |
+ |
2202 |
+ # Use gid of 0 because some stupid ports don't have |
2203 |
+ # the group 'root' set to gid 0. Send to /dev/null |
2204 |
+ # for people who are testing as non-root. |
2205 |
+ chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${ED}"${LIBPATH} 2>/dev/null |
2206 |
+ |
2207 |
+ # Move pretty-printers to gdb datadir to shut ldconfig up |
2208 |
+ local py gdbdir=/usr/share/gdb/auto-load${LIBPATH/\/lib\//\/$(get_libdir)\/} |
2209 |
+ pushd "${ED}"${LIBPATH} >/dev/null |
2210 |
+ for py in $(find . -name '*-gdb.py') ; do |
2211 |
+ local multidir=${py%/*} |
2212 |
+ insinto "${gdbdir}/${multidir}" |
2213 |
+ sed -i "/^libdir =/s:=.*:= '${LIBPATH}/${multidir}':" "${py}" || die #348128 |
2214 |
+ doins "${py}" || die |
2215 |
+ rm "${py}" || die |
2216 |
+ done |
2217 |
+ popd >/dev/null |
2218 |
+ |
2219 |
+ # Don't scan .gox files for executable stacks - false positives |
2220 |
+ export QA_EXECSTACK="usr/lib*/go/*/*.gox" |
2221 |
+ export QA_WX_LOAD="usr/lib*/go/*/*.gox" |
2222 |
+ |
2223 |
+ # Disable RANDMMAP so PCH works. #301299 |
2224 |
+ if tc_version_is_at_least 4.3 ; then |
2225 |
+ pax-mark -r "${ED}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1" |
2226 |
+ pax-mark -r "${ED}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1plus" |
2227 |
+ fi |
2228 |
+} |
2229 |
+ |
2230 |
+gcc_slot_java() { |
2231 |
+ local x |
2232 |
+ |
2233 |
+ # Move Java headers to compiler-specific dir |
2234 |
+ for x in "${ED}"${PREFIX}/include/gc*.h "${ED}"${PREFIX}/include/j*.h ; do |
2235 |
+ [[ -f ${x} ]] && mv -f "${x}" "${ED}"${LIBPATH}/include/ |
2236 |
+ done |
2237 |
+ for x in gcj gnu java javax org ; do |
2238 |
+ if [[ -d ${ED}${PREFIX}/include/${x} ]] ; then |
2239 |
+ dodir /${LIBPATH}/include/${x} |
2240 |
+ mv -f "${ED}"${PREFIX}/include/${x}/* "${ED}"${LIBPATH}/include/${x}/ |
2241 |
+ rm -rf "${ED}"${PREFIX}/include/${x} |
2242 |
+ fi |
2243 |
+ done |
2244 |
+ |
2245 |
+ if [[ -d ${ED}${PREFIX}/lib/security ]] || [[ -d ${ED}${PREFIX}/$(get_libdir)/security ]] ; then |
2246 |
+ dodir /${LIBPATH}/security |
2247 |
+ mv -f "${ED}"${PREFIX}/lib*/security/* "${ED}"${LIBPATH}/security |
2248 |
+ rm -rf "${ED}"${PREFIX}/lib*/security |
2249 |
+ fi |
2250 |
+ |
2251 |
+ # Move random gcj files to compiler-specific directories |
2252 |
+ for x in libgcj.spec logging.properties ; do |
2253 |
+ x="${ED}${PREFIX}/lib/${x}" |
2254 |
+ [[ -f ${x} ]] && mv -f "${x}" "${ED}"${LIBPATH}/ |
2255 |
+ done |
2256 |
+ |
2257 |
+ # Rename jar because it could clash with Kaffe's jar if this gcc is |
2258 |
+ # primary compiler (aka don't have the -<version> extension) |
2259 |
+ cd "${ED}"${BINPATH} |
2260 |
+ [[ -f jar ]] && mv -f jar gcj-jar |
2261 |
+} |
2262 |
+ |
2263 |
+# Move around the libs to the right location. For some reason, |
2264 |
+# when installing gcc, it dumps internal libraries into /usr/lib |
2265 |
+# instead of the private gcc lib path |
2266 |
+gcc_movelibs() { |
2267 |
+ # older versions of gcc did not support --print-multi-os-directory |
2268 |
+ tc_version_is_at_least 3.2 || return 0 |
2269 |
+ |
2270 |
+ local x multiarg removedirs="" |
2271 |
+ for multiarg in $($(XGCC) -print-multi-lib) ; do |
2272 |
+ multiarg=${multiarg#*;} |
2273 |
+ multiarg=${multiarg//@/ -} |
2274 |
+ |
2275 |
+ local OS_MULTIDIR=$($(XGCC) ${multiarg} --print-multi-os-directory) |
2276 |
+ local MULTIDIR=$($(XGCC) ${multiarg} --print-multi-directory) |
2277 |
+ local TODIR=${ED}${LIBPATH}/${MULTIDIR} |
2278 |
+ local FROMDIR= |
2279 |
+ |
2280 |
+ [[ -d ${TODIR} ]] || mkdir -p ${TODIR} |
2281 |
+ |
2282 |
+ for FROMDIR in \ |
2283 |
+ ${LIBPATH}/${OS_MULTIDIR} \ |
2284 |
+ ${LIBPATH}/../${MULTIDIR} \ |
2285 |
+ ${PREFIX}/lib/${OS_MULTIDIR} \ |
2286 |
+ ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} |
2287 |
+ do |
2288 |
+ removedirs="${removedirs} ${FROMDIR}" |
2289 |
+ FROMDIR=${ED}${FROMDIR} |
2290 |
+ if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then |
2291 |
+ local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null) |
2292 |
+ if [[ -n ${files} ]] ; then |
2293 |
+ mv ${files} "${TODIR}" |
2294 |
+ fi |
2295 |
+ fi |
2296 |
+ done |
2297 |
+ fix_libtool_libdir_paths "${LIBPATH}/${MULTIDIR}" |
2298 |
+ |
2299 |
+ # SLOT up libgcj.pc if it's available (and let gcc-config worry about links) |
2300 |
+ FROMDIR="${PREFIX}/lib/${OS_MULTIDIR}" |
2301 |
+ for x in "${ED}${FROMDIR}"/pkgconfig/libgcj*.pc ; do |
2302 |
+ [[ -f ${x} ]] || continue |
2303 |
+ sed -i "/^libdir=/s:=.*:=${LIBPATH}/${MULTIDIR}:" "${x}" |
2304 |
+ mv "${x}" "${ED}${FROMDIR}"/pkgconfig/libgcj-${GCC_PV}.pc || die |
2305 |
+ done |
2306 |
+ done |
2307 |
+ |
2308 |
+ # We remove directories separately to avoid this case: |
2309 |
+ # mv SRC/lib/../lib/*.o DEST |
2310 |
+ # rmdir SRC/lib/../lib/ |
2311 |
+ # mv SRC/lib/../lib32/*.o DEST # Bork |
2312 |
+ for FROMDIR in ${removedirs} ; do |
2313 |
+ rmdir "${ED}"${FROMDIR} >& /dev/null |
2314 |
+ done |
2315 |
+ find "${ED}" -type d | xargs rmdir >& /dev/null |
2316 |
+} |
2317 |
+#----<< src_* >>---- |
2318 |
+ |
2319 |
+#---->> unorganized crap in need of refactoring follows |
2320 |
+ |
2321 |
+# gcc_quick_unpack will unpack the gcc tarball and patches in a way that is |
2322 |
+# consistant with the behavior of get_gcc_src_uri. The only patch it applies |
2323 |
+# itself is the branch update if present. |
2324 |
+# |
2325 |
+# Travis Tilley <lv@g.o> (03 Sep 2004) |
2326 |
+# |
2327 |
+gcc_quick_unpack() { |
2328 |
+ pushd "${WORKDIR}" > /dev/null |
2329 |
+ export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} |
2330 |
+ export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} |
2331 |
+ export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} |
2332 |
+ export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} |
2333 |
+ export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} |
2334 |
+ |
2335 |
+ if [[ -n ${GCC_A_FAKEIT} ]] ; then |
2336 |
+ unpack ${GCC_A_FAKEIT} |
2337 |
+ elif [[ -n ${PRERELEASE} ]] ; then |
2338 |
+ unpack gcc-${PRERELEASE}.tar.bz2 |
2339 |
+ elif [[ -n ${SNAPSHOT} ]] ; then |
2340 |
+ unpack gcc-${SNAPSHOT}.tar.bz2 |
2341 |
+ elif [[ ${PV} != *9999* ]] ; then |
2342 |
+ unpack gcc-${GCC_RELEASE_VER}.tar.bz2 |
2343 |
+ # We want branch updates to be against a release tarball |
2344 |
+ if [[ -n ${BRANCH_UPDATE} ]] ; then |
2345 |
+ pushd "${S}" > /dev/null |
2346 |
+ epatch "${DISTDIR}"/gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 |
2347 |
+ popd > /dev/null |
2348 |
+ fi |
2349 |
+ fi |
2350 |
+ |
2351 |
+ if [[ -n ${D_VER} ]] && use d ; then |
2352 |
+ pushd "${S}"/gcc > /dev/null |
2353 |
+ unpack gdc-${D_VER}-src.tar.bz2 |
2354 |
+ cd .. |
2355 |
+ ebegin "Adding support for the D language" |
2356 |
+ ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log |
2357 |
+ if ! eend $? ; then |
2358 |
+ eerror "The D gcc package failed to apply" |
2359 |
+ eerror "Please include this log file when posting a bug report:" |
2360 |
+ eerror " ${T}/dgcc.log" |
2361 |
+ die "failed to include the D language" |
2362 |
+ fi |
2363 |
+ popd > /dev/null |
2364 |
+ fi |
2365 |
+ |
2366 |
+ [[ -n ${PATCH_VER} ]] && \ |
2367 |
+ unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2 |
2368 |
+ |
2369 |
+ [[ -n ${UCLIBC_VER} ]] && \ |
2370 |
+ unpack gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2 |
2371 |
+ |
2372 |
+ if want_pie ; then |
2373 |
+ if [[ -n ${PIE_CORE} ]] ; then |
2374 |
+ unpack ${PIE_CORE} |
2375 |
+ else |
2376 |
+ unpack gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2 |
2377 |
+ fi |
2378 |
+ [[ -n ${SPECS_VER} ]] && \ |
2379 |
+ unpack gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2 |
2380 |
+ fi |
2381 |
+ |
2382 |
+ use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" |
2383 |
+ |
2384 |
+ popd > /dev/null |
2385 |
+} |
2386 |
+ |
2387 |
+do_gcc_HTB_patches() { |
2388 |
+ use_if_iuse boundschecking || return 0 |
2389 |
+ |
2390 |
+ # modify the bounds checking patch with a regression patch |
2391 |
+ epatch "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch" |
2392 |
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}" |
2393 |
+} |
2394 |
+ |
2395 |
+# do various updates to PIE logic |
2396 |
+do_gcc_PIE_patches() { |
2397 |
+ want_pie || return 0 |
2398 |
+ |
2399 |
+ use vanilla && return 0 |
2400 |
+ |
2401 |
+ if tc_version_is_at_least 4.3.2 ; then |
2402 |
+ guess_patch_type_in_dir "${WORKDIR}"/piepatch/ |
2403 |
+ EPATCH_MULTI_MSG="Applying pie patches ..." \ |
2404 |
+ epatch "${WORKDIR}"/piepatch/ |
2405 |
+ else |
2406 |
+ guess_patch_type_in_dir "${WORKDIR}"/piepatch/upstream |
2407 |
+ |
2408 |
+ # corrects startfile/endfile selection and shared/static/pie flag usage |
2409 |
+ EPATCH_MULTI_MSG="Applying upstream pie patches ..." \ |
2410 |
+ epatch "${WORKDIR}"/piepatch/upstream |
2411 |
+ # adds non-default pie support (rs6000) |
2412 |
+ EPATCH_MULTI_MSG="Applying non-default pie patches ..." \ |
2413 |
+ epatch "${WORKDIR}"/piepatch/nondef |
2414 |
+ # adds default pie support (rs6000 too) if DEFAULT_PIE[_SSP] is defined |
2415 |
+ EPATCH_MULTI_MSG="Applying default pie patches ..." \ |
2416 |
+ epatch "${WORKDIR}"/piepatch/def |
2417 |
+ fi |
2418 |
+ |
2419 |
+ # we want to be able to control the pie patch logic via something other |
2420 |
+ # than ALL_CFLAGS... |
2421 |
+ sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \ |
2422 |
+ -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \ |
2423 |
+ -i "${S}"/gcc/Makefile.in |
2424 |
+ # Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7 |
2425 |
+ if tc_version_is_at_least 4.7 ; then |
2426 |
+ sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \ |
2427 |
+ -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \ |
2428 |
+ -i "${S}"/gcc/Makefile.in |
2429 |
+ fi |
2430 |
+ |
2431 |
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}" |
2432 |
+} |
2433 |
+ |
2434 |
+should_we_gcc_config() { |
2435 |
+ # if the current config is invalid, we definitely want a new one |
2436 |
+ # Note: due to bash quirkiness, the following must not be 1 line |
2437 |
+ local curr_config |
2438 |
+ curr_config=$(env -i ROOT="${ROOT}" "${EPREFIX}"/usr/bin/gcc-config -c ${CTARGET} 2>&1) || return 0 |
2439 |
+ |
2440 |
+ # if the previously selected config has the same major.minor (branch) as |
2441 |
+ # the version we are installing, then it will probably be uninstalled |
2442 |
+ # for being in the same SLOT, make sure we run gcc-config. |
2443 |
+ local curr_config_ver=$(env -i ROOT="${ROOT}" "${EPREFIX}"/usr/bin/gcc-config -S ${curr_config} | awk '{print $2}') |
2444 |
+ |
2445 |
+ local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) |
2446 |
+ |
2447 |
+ # If we're using multislot, just run gcc-config if we're installing |
2448 |
+ # to the same profile as the current one. |
2449 |
+ use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]]) |
2450 |
+ |
2451 |
+ if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then |
2452 |
+ return 0 |
2453 |
+ else |
2454 |
+ # if we're installing a genuinely different compiler version, |
2455 |
+ # we should probably tell the user -how- to switch to the new |
2456 |
+ # gcc version, since we're not going to do it for him/her. |
2457 |
+ # We don't want to switch from say gcc-3.3 to gcc-3.4 right in |
2458 |
+ # the middle of an emerge operation (like an 'emerge -e world' |
2459 |
+ # which could install multiple gcc versions). |
2460 |
+ # Only warn if we're installing a pkg as we might be called from |
2461 |
+ # the pkg_{pre,post}rm steps. #446830 |
2462 |
+ if [[ ${EBUILD_PHASE} == *"inst" ]] ; then |
2463 |
+ einfo "The current gcc config appears valid, so it will not be" |
2464 |
+ einfo "automatically switched for you. If you would like to" |
2465 |
+ einfo "switch to the newly installed gcc version, do the" |
2466 |
+ einfo "following:" |
2467 |
+ echo |
2468 |
+ einfo "gcc-config ${CTARGET}-${GCC_CONFIG_VER}" |
2469 |
+ einfo "source /etc/profile" |
2470 |
+ echo |
2471 |
+ fi |
2472 |
+ return 1 |
2473 |
+ fi |
2474 |
+} |
2475 |
+ |
2476 |
+do_gcc_config() { |
2477 |
+ if ! should_we_gcc_config ; then |
2478 |
+ env -i ROOT="${ROOT}" "${EPREFIX}"/usr/bin/gcc-config --use-old --force |
2479 |
+ return 0 |
2480 |
+ fi |
2481 |
+ |
2482 |
+ local current_gcc_config="" current_specs="" use_specs="" |
2483 |
+ |
2484 |
+ current_gcc_config=$(env -i ROOT="${ROOT}" "${EPREFIX}"/usr/bin/gcc-config -c ${CTARGET} 2>/dev/null) |
2485 |
+ if [[ -n ${current_gcc_config} ]] ; then |
2486 |
+ # figure out which specs-specific config is active |
2487 |
+ current_specs=$(gcc-config -S ${current_gcc_config} | awk '{print $3}') |
2488 |
+ [[ -n ${current_specs} ]] && use_specs=-${current_specs} |
2489 |
+ fi |
2490 |
+ if [[ -n ${use_specs} ]] && \ |
2491 |
+ [[ ! -e ${EROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] |
2492 |
+ then |
2493 |
+ ewarn "The currently selected specs-specific gcc config," |
2494 |
+ ewarn "${current_specs}, doesn't exist anymore. This is usually" |
2495 |
+ ewarn "due to enabling/disabling hardened or switching to a version" |
2496 |
+ ewarn "of gcc that doesnt create multiple specs files. The default" |
2497 |
+ ewarn "config will be used, and the previous preference forgotten." |
2498 |
+ use_specs="" |
2499 |
+ fi |
2500 |
+ |
2501 |
+ gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs} |
2502 |
+} |
2503 |
+ |
2504 |
+# This function allows us to gentoo-ize GCCs version number and bugzilla |
2505 |
+# URL without needing to use patches. |
2506 |
+gcc_version_patch() { |
2507 |
+ # gcc-4.3+ has configure flags (whoo!) |
2508 |
+ tc_version_is_at_least 4.3 && return 0 |
2509 |
+ |
2510 |
+ local version_string=${GCC_CONFIG_VER} |
2511 |
+ [[ -n ${BRANCH_UPDATE} ]] && version_string+=" ${BRANCH_UPDATE}" |
2512 |
+ |
2513 |
+ einfo "patching gcc version: ${version_string} (${BRANDING_GCC_PKGVERSION})" |
2514 |
+ |
2515 |
+ local gcc_sed=( -e 's:gcc\.gnu\.org/bugs\.html:bugs\.gentoo\.org/:' ) |
2516 |
+ if grep -qs VERSUFFIX "${S}"/gcc/version.c ; then |
2517 |
+ gcc_sed+=( -e "/VERSUFFIX \"\"/s:\"\":\" (${BRANDING_GCC_PKGVERSION})\":" ) |
2518 |
+ else |
2519 |
+ version_string="${version_string} (${BRANDING_GCC_PKGVERSION})" |
2520 |
+ gcc_sed+=( -e "/const char version_string\[\] = /s:= \".*\":= \"${version_string}\":" ) |
2521 |
+ fi |
2522 |
+ sed -i "${gcc_sed[@]}" "${S}"/gcc/version.c || die |
2523 |
+} |
2524 |
+ |
2525 |
+# This is a historical wart. The original Gentoo/amd64 port used: |
2526 |
+# lib32 - 32bit binaries (x86) |
2527 |
+# lib64 - 64bit binaries (x86_64) |
2528 |
+# lib - "native" binaries (a symlink to lib64) |
2529 |
+# Most other distros use the logic (including mainline gcc): |
2530 |
+# lib - 32bit binaries (x86) |
2531 |
+# lib64 - 64bit binaries (x86_64) |
2532 |
+# Over time, Gentoo is migrating to the latter form. |
2533 |
+# |
2534 |
+# Unfortunately, due to distros picking the lib32 behavior, newer gcc |
2535 |
+# versions will dynamically detect whether to use lib or lib32 for its |
2536 |
+# 32bit multilib. So, to keep the automagic from getting things wrong |
2537 |
+# while people are transitioning from the old style to the new style, |
2538 |
+# we always set the MULTILIB_OSDIRNAMES var for relevant targets. |
2539 |
+setup_multilib_osdirnames() { |
2540 |
+ is_multilib || return 0 |
2541 |
+ |
2542 |
+ local config |
2543 |
+ local libdirs="../lib64 ../lib32" |
2544 |
+ |
2545 |
+ # this only makes sense for some Linux targets |
2546 |
+ case ${CTARGET} in |
2547 |
+ x86_64*-linux*) config="i386" ;; |
2548 |
+ powerpc64*-linux*) config="rs6000" ;; |
2549 |
+ sparc64*-linux*) config="sparc" ;; |
2550 |
+ s390x*-linux*) config="s390" ;; |
2551 |
+ *) return 0 ;; |
2552 |
+ esac |
2553 |
+ config+="/t-linux64" |
2554 |
+ |
2555 |
+ local sed_args=() |
2556 |
+ if tc_version_is_at_least 4.6 ; then |
2557 |
+ sed_args+=( -e 's:$[(]call if_multiarch[^)]*[)]::g' ) |
2558 |
+ fi |
2559 |
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then |
2560 |
+ einfo "updating multilib directories to be: ${libdirs}" |
2561 |
+ if tc_version_is_at_least 4.6.4 || tc_version_is_at_least 4.7 ; then |
2562 |
+ sed_args+=( -e '/^MULTILIB_OSDIRNAMES.*lib32/s:[$][(]if.*):../lib32:' ) |
2563 |
+ else |
2564 |
+ sed_args+=( -e "/^MULTILIB_OSDIRNAMES/s:=.*:= ${libdirs}:" ) |
2565 |
+ fi |
2566 |
+ else |
2567 |
+ einfo "using upstream multilib; disabling lib32 autodetection" |
2568 |
+ sed_args+=( -r -e 's:[$][(]if.*,(.*)[)]:\1:' ) |
2569 |
+ fi |
2570 |
+ sed -i "${sed_args[@]}" "${S}"/gcc/config/${config} || die |
2571 |
+} |
2572 |
+ |
2573 |
+# make sure the libtool archives have libdir set to where they actually |
2574 |
+# -are-, and not where they -used- to be. also, any dependencies we have |
2575 |
+# on our own .la files need to be updated. |
2576 |
+fix_libtool_libdir_paths() { |
2577 |
+ pushd "${ED}" >/dev/null |
2578 |
+ |
2579 |
+ pushd "./${1}" >/dev/null |
2580 |
+ local dir="${PWD#${D%/}}" |
2581 |
+ local allarchives=$(echo *.la) |
2582 |
+ allarchives="\(${allarchives// /\\|}\)" |
2583 |
+ popd >/dev/null |
2584 |
+ |
2585 |
+ sed -i \ |
2586 |
+ -e "/^libdir=/s:=.*:='${EPREFIX}/${dir##/}':" \ |
2587 |
+ ./${dir}/*.la |
2588 |
+ sed -i \ |
2589 |
+ -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${EPREFIX}/${LIBPATH##/}/\1:g" \ |
2590 |
+ $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \ |
2591 |
+ ./${dir}/*.la |
2592 |
+ |
2593 |
+ popd >/dev/null |
2594 |
+} |
2595 |
+ |
2596 |
+is_multilib() { |
2597 |
+ tc_version_is_at_least 3 || return 1 |
2598 |
+ use multilib |
2599 |
+} |
2600 |
+ |
2601 |
+is_cxx() { |
2602 |
+ gcc-lang-supported 'c++' || return 1 |
2603 |
+ use cxx |
2604 |
+} |
2605 |
+ |
2606 |
+is_d() { |
2607 |
+ gcc-lang-supported d || return 1 |
2608 |
+ use_if_iuse d |
2609 |
+} |
2610 |
+ |
2611 |
+is_f77() { |
2612 |
+ gcc-lang-supported f77 || return 1 |
2613 |
+ use fortran |
2614 |
+} |
2615 |
+ |
2616 |
+is_f95() { |
2617 |
+ gcc-lang-supported f95 || return 1 |
2618 |
+ use fortran |
2619 |
+} |
2620 |
+ |
2621 |
+is_fortran() { |
2622 |
+ gcc-lang-supported fortran || return 1 |
2623 |
+ use fortran |
2624 |
+} |
2625 |
+ |
2626 |
+is_gcj() { |
2627 |
+ gcc-lang-supported java || return 1 |
2628 |
+ use cxx && use_if_iuse gcj |
2629 |
+} |
2630 |
+ |
2631 |
+is_go() { |
2632 |
+ gcc-lang-supported go || return 1 |
2633 |
+ use cxx && use_if_iuse go |
2634 |
+} |
2635 |
+ |
2636 |
+is_objc() { |
2637 |
+ gcc-lang-supported objc || return 1 |
2638 |
+ use_if_iuse objc |
2639 |
+} |
2640 |
+ |
2641 |
+is_objcxx() { |
2642 |
+ gcc-lang-supported 'obj-c++' || return 1 |
2643 |
+ use cxx && use_if_iuse objc++ |
2644 |
+} |
2645 |
+ |
2646 |
+is_ada() { |
2647 |
+ gcc-lang-supported ada || return 1 |
2648 |
+ use ada |
2649 |
+} |
2650 |
+ |
2651 |
+is_treelang() { |
2652 |
+ use_if_iuse boundschecking && return 1 #260532 |
2653 |
+ is_crosscompile && return 1 #199924 |
2654 |
+ gcc-lang-supported treelang || return 1 |
2655 |
+ #use treelang |
2656 |
+ return 0 |
2657 |
+} |
2658 |
|
2659 |
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass |
2660 |
new file mode 100644 |
2661 |
index 0000000..16a0cc5 |
2662 |
--- /dev/null |
2663 |
+++ b/eclass/wxwidgets.eclass |
2664 |
@@ -0,0 +1,285 @@ |
2665 |
+# Copyright 1999-2011 Gentoo Foundation |
2666 |
+# Distributed under the terms of the GNU General Public License v2 |
2667 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.34 2013/08/16 07:59:17 heroxbd Exp $ |
2668 |
+ |
2669 |
+# @ECLASS: wxwidgets.eclass |
2670 |
+# @MAINTAINER: |
2671 |
+# wxwidgets@g.o |
2672 |
+# @BLURB: Manages build configuration for wxGTK-using packages. |
2673 |
+# @DESCRIPTION: |
2674 |
+# The wxGTK libraries come in several different possible configurations |
2675 |
+# (release, debug, ansi, unicode, etc.) most of which can be installed |
2676 |
+# side-by-side. The purpose of this eclass is to provide ebuilds the ability |
2677 |
+# to build against a specific type of profile without interfering with the |
2678 |
+# user-set system configuration. |
2679 |
+# |
2680 |
+# Ebuilds that use wxGTK _must_ inherit this eclass. |
2681 |
+# |
2682 |
+# - Using this eclass - |
2683 |
+# |
2684 |
+# 1. set WX_GTK_VER to a valid wxGTK SLOT |
2685 |
+# 2. inherit wxwidgets |
2686 |
+# 3. add an appropriate DEPEND |
2687 |
+# 4. done |
2688 |
+# |
2689 |
+# @CODE |
2690 |
+# WX_GTK_VER="2.8" |
2691 |
+# |
2692 |
+# inherit wxwidgets |
2693 |
+# |
2694 |
+# DEPEND="x11-libs/wxGTK:2.8[X]" |
2695 |
+# RDEPEND="${DEPEND}" |
2696 |
+# [...] |
2697 |
+# @CODE |
2698 |
+# |
2699 |
+# This will get you the default configuration, which is what you want 99% |
2700 |
+# of the time (in 2.6 the default is "ansi", all other versions default to |
2701 |
+# "unicode"). |
2702 |
+# |
2703 |
+# If your package has optional wxGTK support controlled by a USE flag or you |
2704 |
+# need to use the wxBase libraries (USE="-X") then you should not set |
2705 |
+# WX_GTK_VER before inherit and instead refer to the need-wxwidgets function |
2706 |
+# below. |
2707 |
+# |
2708 |
+# The variable WX_CONFIG is exported, containing the absolute path to the |
2709 |
+# wx-config file to use. Most configure scripts use this path if it's set in |
2710 |
+# the environment or accept --with-wx-config="${WX_CONFIG}". |
2711 |
+ |
2712 |
+inherit eutils multilib |
2713 |
+ |
2714 |
+case "${EAPI:-0}" in |
2715 |
+ 0|1) |
2716 |
+ EXPORT_FUNCTIONS pkg_setup |
2717 |
+ ;; |
2718 |
+ *) |
2719 |
+ ;; |
2720 |
+esac |
2721 |
+ |
2722 |
+# We do this globally so ebuilds can get sane defaults just by inheriting. They |
2723 |
+# can be overridden with need-wxwidgets later if need be. |
2724 |
+ |
2725 |
+# ensure this only runs once |
2726 |
+if [[ -z ${WX_CONFIG} ]]; then |
2727 |
+ # and only if WX_GTK_VER is set before inherit |
2728 |
+ if [[ -n ${WX_GTK_VER} ]]; then |
2729 |
+ if [[ ${WX_GTK_VER} == 2.6 ]]; then |
2730 |
+ wxchar="ansi" |
2731 |
+ else |
2732 |
+ wxchar="unicode" |
2733 |
+ fi |
2734 |
+ for wxtoolkit in gtk2 base; do |
2735 |
+ # newer versions don't have a seperate debug profile |
2736 |
+ for wxdebug in xxx release- debug-; do |
2737 |
+ wxconf="${wxtoolkit}-${wxchar}-${wxdebug/xxx/}${WX_GTK_VER}" |
2738 |
+ if [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then |
2739 |
+ # if this is a wxBase install, die in pkg_setup |
2740 |
+ [[ ${wxtoolkit} == "base" ]] && WXBASE_DIE=1 |
2741 |
+ else |
2742 |
+ continue |
2743 |
+ fi |
2744 |
+ WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}" |
2745 |
+ WX_ECLASS_CONFIG="${WX_CONFIG}" |
2746 |
+ break |
2747 |
+ done |
2748 |
+ [[ -n ${WX_CONFIG} ]] && break |
2749 |
+ done |
2750 |
+ [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG |
2751 |
+ fi |
2752 |
+fi |
2753 |
+ |
2754 |
+# @FUNCTION: wxwidgets_pkg_setup |
2755 |
+# @DESCRIPTION: |
2756 |
+# |
2757 |
+# It's possible for wxGTK to be installed with USE="-X", resulting in something |
2758 |
+# called wxBase. There's only ever been a couple packages in the tree that use |
2759 |
+# wxBase so this is probably not what you want. Whenever possible, use EAPI 2 |
2760 |
+# USE dependencies(tm) to ensure that wxGTK was built with USE="X". This |
2761 |
+# function is only exported for EAPI 0 or 1 and catches any remaining cases. |
2762 |
+# |
2763 |
+# If you do use wxBase, don't set WX_GTK_VER before inherit. Use |
2764 |
+# need-wxwidgets() instead. |
2765 |
+ |
2766 |
+wxwidgets_pkg_setup() { |
2767 |
+ [[ -n $WXBASE_DIE ]] && check_wxuse X |
2768 |
+} |
2769 |
+ |
2770 |
+# @FUNCTION: need-wxwidgets |
2771 |
+# @USAGE: <configuration> |
2772 |
+# @DESCRIPTION: |
2773 |
+# |
2774 |
+# Available configurations are: |
2775 |
+# |
2776 |
+# [2.6] ansi [>=2.8] unicode |
2777 |
+# unicode base-unicode |
2778 |
+# base |
2779 |
+# base-unicode |
2780 |
+# |
2781 |
+# If your package has optional wxGTK support controlled by a USE flag, set |
2782 |
+# WX_GTK_VER inside a conditional rather than before inherit. Some broken |
2783 |
+# configure scripts will force wxGTK on if they find ${WX_CONFIG} set. |
2784 |
+# |
2785 |
+# @CODE |
2786 |
+# src_configure() { |
2787 |
+# if use wxwidgets; then |
2788 |
+# WX_GTK_VER="2.8" |
2789 |
+# if use X; then |
2790 |
+# need-wxwidgets unicode |
2791 |
+# else |
2792 |
+# need-wxwidgets base-unicode |
2793 |
+# fi |
2794 |
+# fi |
2795 |
+# @CODE |
2796 |
+# |
2797 |
+ |
2798 |
+need-wxwidgets() { |
2799 |
+ debug-print-function $FUNCNAME $* |
2800 |
+ |
2801 |
+ local wxtoolkit wxchar wxdebug wxconf |
2802 |
+ |
2803 |
+ if [[ -z ${WX_GTK_VER} ]]; then |
2804 |
+ echo |
2805 |
+ eerror "WX_GTK_VER must be set before calling $FUNCNAME." |
2806 |
+ echo |
2807 |
+ die "WX_GTK_VER missing" |
2808 |
+ fi |
2809 |
+ |
2810 |
+ if [[ ${WX_GTK_VER} != 2.6 && ${WX_GTK_VER} != 2.8 && ${WX_GTK_VER} != 2.9 ]]; then |
2811 |
+ echo |
2812 |
+ eerror "Invalid WX_GTK_VER: ${WX_GTK_VER} - must be set to a valid wxGTK SLOT." |
2813 |
+ echo |
2814 |
+ die "Invalid WX_GTK_VER" |
2815 |
+ fi |
2816 |
+ |
2817 |
+ debug-print "WX_GTK_VER is ${WX_GTK_VER}" |
2818 |
+ |
2819 |
+ case $1 in |
2820 |
+ ansi) |
2821 |
+ debug-print-section ansi |
2822 |
+ if [[ ${WX_GTK_VER} == 2.6 ]]; then |
2823 |
+ wxchar="ansi" |
2824 |
+ else |
2825 |
+ wxchar="unicode" |
2826 |
+ fi |
2827 |
+ check_wxuse X |
2828 |
+ ;; |
2829 |
+ unicode) |
2830 |
+ debug-print-section unicode |
2831 |
+ check_wxuse X |
2832 |
+ [[ ${WX_GTK_VER} == 2.6 ]] && check_wxuse unicode |
2833 |
+ wxchar="unicode" |
2834 |
+ ;; |
2835 |
+ base) |
2836 |
+ debug-print-section base |
2837 |
+ if [[ ${WX_GTK_VER} == 2.6 ]]; then |
2838 |
+ wxchar="ansi" |
2839 |
+ else |
2840 |
+ wxchar="unicode" |
2841 |
+ fi |
2842 |
+ ;; |
2843 |
+ base-unicode) |
2844 |
+ debug-print-section base-unicode |
2845 |
+ [[ ${WX_GTK_VER} == 2.6 ]] && check_wxuse unicode |
2846 |
+ wxchar="unicode" |
2847 |
+ ;; |
2848 |
+ # backwards compatibility |
2849 |
+ gtk2) |
2850 |
+ debug-print-section gtk2 |
2851 |
+ if [[ ${WX_GTK_VER} == 2.6 ]]; then |
2852 |
+ wxchar="ansi" |
2853 |
+ else |
2854 |
+ wxchar="unicode" |
2855 |
+ fi |
2856 |
+ check_wxuse X |
2857 |
+ ;; |
2858 |
+ *) |
2859 |
+ echo |
2860 |
+ eerror "Invalid $FUNCNAME argument: $1" |
2861 |
+ echo |
2862 |
+ die "Invalid argument" |
2863 |
+ ;; |
2864 |
+ esac |
2865 |
+ |
2866 |
+ debug-print "wxchar is ${wxchar}" |
2867 |
+ |
2868 |
+ # TODO: remove built_with_use |
2869 |
+ |
2870 |
+ # wxBase can be provided by both gtk2 and base installations |
2871 |
+ if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* X; then |
2872 |
+ wxtoolkit="gtk2" |
2873 |
+ else |
2874 |
+ wxtoolkit="base" |
2875 |
+ fi |
2876 |
+ |
2877 |
+ debug-print "wxtoolkit is ${wxtoolkit}" |
2878 |
+ |
2879 |
+ # debug or release? |
2880 |
+ if [[ ${WX_GTK_VER} == 2.6 || ${WX_GTK_VER} == 2.8 ]]; then |
2881 |
+ if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* debug; then |
2882 |
+ wxdebug="debug-" |
2883 |
+ else |
2884 |
+ wxdebug="release-" |
2885 |
+ fi |
2886 |
+ fi |
2887 |
+ |
2888 |
+ debug-print "wxdebug is ${wxdebug}" |
2889 |
+ |
2890 |
+ # put it all together |
2891 |
+ wxconf="${wxtoolkit}-${wxchar}-${wxdebug}${WX_GTK_VER}" |
2892 |
+ |
2893 |
+ debug-print "wxconf is ${wxconf}" |
2894 |
+ |
2895 |
+ # if this doesn't work, something is seriously screwed |
2896 |
+ if [[ ! -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then |
2897 |
+ echo |
2898 |
+ eerror "Failed to find configuration ${wxconf}" |
2899 |
+ echo |
2900 |
+ die "Missing wx-config" |
2901 |
+ fi |
2902 |
+ |
2903 |
+ debug-print "Found config ${wxconf} - setting WX_CONFIG" |
2904 |
+ |
2905 |
+ export WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}" |
2906 |
+ |
2907 |
+ debug-print "WX_CONFIG is ${WX_CONFIG}" |
2908 |
+ |
2909 |
+ export WX_ECLASS_CONFIG="${WX_CONFIG}" |
2910 |
+ |
2911 |
+ echo |
2912 |
+ einfo "Requested wxWidgets: ${1} ${WX_GTK_VER}" |
2913 |
+ einfo "Using wxWidgets: ${wxconf}" |
2914 |
+ echo |
2915 |
+} |
2916 |
+ |
2917 |
+ |
2918 |
+# @FUNCTION: check_wxuse |
2919 |
+# @USAGE: <USE flag> |
2920 |
+# @DESCRIPTION: |
2921 |
+# |
2922 |
+# Provides a consistant way to check if wxGTK was built with a particular USE |
2923 |
+# flag enabled. A better way is EAPI 2 USE dependencies (hint hint). |
2924 |
+ |
2925 |
+check_wxuse() { |
2926 |
+ debug-print-function $FUNCNAME $* |
2927 |
+ |
2928 |
+ if [[ -z ${WX_GTK_VER} ]]; then |
2929 |
+ echo |
2930 |
+ eerror "WX_GTK_VER must be set before calling $FUNCNAME." |
2931 |
+ echo |
2932 |
+ die "WX_GTK_VER missing" |
2933 |
+ fi |
2934 |
+ |
2935 |
+ # TODO: Remove built_with_use |
2936 |
+ |
2937 |
+ ebegin "Checking wxGTK-${WX_GTK_VER} for ${1} support" |
2938 |
+ if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* "${1}"; then |
2939 |
+ eend 0 |
2940 |
+ else |
2941 |
+ eend 1 |
2942 |
+ echo |
2943 |
+ eerror "${FUNCNAME} - You have requested functionality that requires ${1} support to" |
2944 |
+ eerror "have been built into x11-libs/wxGTK." |
2945 |
+ eerror |
2946 |
+ eerror "Please re-merge =x11-libs/wxGTK-${WX_GTK_VER}* with the ${1} USE flag enabled." |
2947 |
+ die "Missing USE flags." |
2948 |
+ fi |
2949 |
+} |
2950 |
|
2951 |
diff --git a/profiles/default/linux/amd64/13.0/rap/make.defaults b/profiles/default/linux/amd64/13.0/rap/make.defaults |
2952 |
new file mode 100644 |
2953 |
index 0000000..fc2914e |
2954 |
--- /dev/null |
2955 |
+++ b/profiles/default/linux/amd64/13.0/rap/make.defaults |
2956 |
@@ -0,0 +1,3 @@ |
2957 |
+# accept unstable keyword before RAP matures |
2958 |
+# accept Prefix keyword to use Prefix overlay for transition |
2959 |
+ACCEPT_KEYWORDS="~amd64 ~amd64-linux" |
2960 |
|
2961 |
diff --git a/profiles/default/linux/amd64/13.0/rap/parent b/profiles/default/linux/amd64/13.0/rap/parent |
2962 |
new file mode 100644 |
2963 |
index 0000000..7df3b6e |
2964 |
--- /dev/null |
2965 |
+++ b/profiles/default/linux/amd64/13.0/rap/parent |
2966 |
@@ -0,0 +1,2 @@ |
2967 |
+../no-multilib |
2968 |
+../../../../../features/rap |
2969 |
|
2970 |
diff --git a/profiles/default/linux/arm/13.0/armv7a/rap/make.defaults b/profiles/default/linux/arm/13.0/armv7a/rap/make.defaults |
2971 |
new file mode 100644 |
2972 |
index 0000000..61ca581 |
2973 |
--- /dev/null |
2974 |
+++ b/profiles/default/linux/arm/13.0/armv7a/rap/make.defaults |
2975 |
@@ -0,0 +1,3 @@ |
2976 |
+# accept unstable keyword before RAP matures |
2977 |
+# accept Prefix keyword to use Prefix overlay for transition |
2978 |
+ACCEPT_KEYWORDS="~arm ~arm-linux" |
2979 |
|
2980 |
diff --git a/profiles/default/linux/arm/13.0/armv7a/rap/parent b/profiles/default/linux/arm/13.0/armv7a/rap/parent |
2981 |
new file mode 100644 |
2982 |
index 0000000..8a04a12 |
2983 |
--- /dev/null |
2984 |
+++ b/profiles/default/linux/arm/13.0/armv7a/rap/parent |
2985 |
@@ -0,0 +1,2 @@ |
2986 |
+.. |
2987 |
+../../../../../../features/rap |
2988 |
|
2989 |
diff --git a/profiles/default/linux/x86/13.0/rap/make.defaults b/profiles/default/linux/x86/13.0/rap/make.defaults |
2990 |
new file mode 100644 |
2991 |
index 0000000..5682e93 |
2992 |
--- /dev/null |
2993 |
+++ b/profiles/default/linux/x86/13.0/rap/make.defaults |
2994 |
@@ -0,0 +1,3 @@ |
2995 |
+# accept unstable keyword before RAP matures |
2996 |
+# accept Prefix keyword to use Prefix overlay for transition |
2997 |
+ACCEPT_KEYWORDS="~x86 ~x86-linux" |
2998 |
|
2999 |
diff --git a/profiles/default/linux/x86/13.0/rap/parent b/profiles/default/linux/x86/13.0/rap/parent |
3000 |
new file mode 100644 |
3001 |
index 0000000..3659747 |
3002 |
--- /dev/null |
3003 |
+++ b/profiles/default/linux/x86/13.0/rap/parent |
3004 |
@@ -0,0 +1,2 @@ |
3005 |
+.. |
3006 |
+../../../../../features/rap |
3007 |
|
3008 |
diff --git a/profiles/features/rap/make.defaults b/profiles/features/rap/make.defaults |
3009 |
new file mode 100644 |
3010 |
index 0000000..ed808e9 |
3011 |
--- /dev/null |
3012 |
+++ b/profiles/features/rap/make.defaults |
3013 |
@@ -0,0 +1,2 @@ |
3014 |
+# sandbox not prefixified yet. |
3015 |
+FEATURES="-sandbox" |
3016 |
|
3017 |
diff --git a/profiles/features/rap/packages b/profiles/features/rap/packages |
3018 |
new file mode 100644 |
3019 |
index 0000000..c574b8e |
3020 |
--- /dev/null |
3021 |
+++ b/profiles/features/rap/packages |
3022 |
@@ -0,0 +1,11 @@ |
3023 |
+# kmod has not been prefixified |
3024 |
+-*virtual/modutils |
3025 |
+ |
3026 |
+# shadow has not been prefixified |
3027 |
+-*virtual/shadow |
3028 |
+ |
3029 |
+# don't need in rap |
3030 |
+-*virtual/dev-manager |
3031 |
+ |
3032 |
+# permission is not handled by portage for normal users |
3033 |
+-*net-misc/iputils |
3034 |
|
3035 |
diff --git a/profiles/features/rap/profile.bashrc b/profiles/features/rap/profile.bashrc |
3036 |
new file mode 100644 |
3037 |
index 0000000..40cc40c |
3038 |
--- /dev/null |
3039 |
+++ b/profiles/features/rap/profile.bashrc |
3040 |
@@ -0,0 +1,9 @@ |
3041 |
+# use sysroot of toolchain to get include and library at compile time work |
3042 |
+# Benda Xu <heroxbd@g.o> (17 Jun, 2013) |
3043 |
+ |
3044 |
+if [[ ${CATEGORY} == sys-devel ]] && [[ ${PN} == gcc || ${PN} == binutils || ${PN} == libtool ]] \ |
3045 |
+ && [[ ${EBUILD_PHASE} == unpack ]]; then |
3046 |
+ elog "append --with-sysroot=${EPREFIX} to configure for Prefix libc" |
3047 |
+ EXTRA_ECONF+="--with-sysroot=${EPREFIX}" |
3048 |
+fi |
3049 |
+ |
3050 |
|
3051 |
diff --git a/profiles/features/rap/use.force b/profiles/features/rap/use.force |
3052 |
new file mode 100644 |
3053 |
index 0000000..193e6d8 |
3054 |
--- /dev/null |
3055 |
+++ b/profiles/features/rap/use.force |
3056 |
@@ -0,0 +1,5 @@ |
3057 |
+# force Prefix |
3058 |
+prefix |
3059 |
+ |
3060 |
+# force rap (Prefix with libc) |
3061 |
+rap |
3062 |
|
3063 |
diff --git a/profiles/features/rap/use.mask b/profiles/features/rap/use.mask |
3064 |
new file mode 100644 |
3065 |
index 0000000..4c45f2d |
3066 |
--- /dev/null |
3067 |
+++ b/profiles/features/rap/use.mask |
3068 |
@@ -0,0 +1,8 @@ |
3069 |
+# unmask prefix |
3070 |
+-prefix |
3071 |
+ |
3072 |
+# sys-libs/gpm has not been prefixified |
3073 |
+gpm |
3074 |
+ |
3075 |
+# sys-libs/pam has not been prefixified |
3076 |
+pam |
3077 |
|
3078 |
diff --git a/profiles/prefix/features/with-libc/packages b/profiles/prefix/features/with-libc/packages |
3079 |
new file mode 100644 |
3080 |
index 0000000..be6a3cb |
3081 |
--- /dev/null |
3082 |
+++ b/profiles/prefix/features/with-libc/packages |
3083 |
@@ -0,0 +1,3 @@ |
3084 |
+# use OpenRC from gentoo-x86 |
3085 |
+-*sys-apps/baselayout-prefix |
3086 |
+*sys-apps/baselayout |
3087 |
|
3088 |
diff --git a/profiles/prefix/linux/amd64/with-libc/.unison.packages.78a8f6ffc32b4d5af3a26b6758688d4f.unison.tmp b/profiles/prefix/linux/amd64/with-libc/.unison.packages.78a8f6ffc32b4d5af3a26b6758688d4f.unison.tmp |
3089 |
new file mode 100644 |
3090 |
index 0000000..d781c37 |
3091 |
--- /dev/null |
3092 |
+++ b/profiles/prefix/linux/amd64/with-libc/.unison.packages.78a8f6ffc32b4d5af3a26b6758688d4f.unison.tmp |
3093 |
@@ -0,0 +1,2 @@ |
3094 |
+# use OpenRC |
3095 |
+-*sys-apps/baselayout-prefix |
3096 |
|
3097 |
diff --git a/profiles/prefix/linux/arm/with-libc/parent b/profiles/prefix/linux/arm/with-libc/parent |
3098 |
new file mode 100644 |
3099 |
index 0000000..76f4041 |
3100 |
--- /dev/null |
3101 |
+++ b/profiles/prefix/linux/arm/with-libc/parent |
3102 |
@@ -0,0 +1,2 @@ |
3103 |
+../../../features/with-libc |
3104 |
+.. |
3105 |
|
3106 |
diff --git a/profiles/prefix/linux/x86/with-libc/make.defaults b/profiles/prefix/linux/x86/with-libc/make.defaults |
3107 |
new file mode 100644 |
3108 |
index 0000000..3a95173 |
3109 |
--- /dev/null |
3110 |
+++ b/profiles/prefix/linux/x86/with-libc/make.defaults |
3111 |
@@ -0,0 +1,6 @@ |
3112 |
+# Copyright 1999-2009 Gentoo Foundation |
3113 |
+# Distributed under the terms of the GNU General Public License v2 |
3114 |
+# $Header: /var/cvsroot/gentoo-x86/profiles/prefix/linux/x86/make.defaults,v 1.3 2009/11/04 13:25:03 haubi Exp $ |
3115 |
+ |
3116 |
+# add back x86. add ~x86 for testing. |
3117 |
+ACCEPT_KEYWORDS="x86 ~x86 ~x86-linux" |
3118 |
|
3119 |
diff --git a/profiles/prefix/linux/x86/with-libc/parent b/profiles/prefix/linux/x86/with-libc/parent |
3120 |
new file mode 100644 |
3121 |
index 0000000..510455a |
3122 |
--- /dev/null |
3123 |
+++ b/profiles/prefix/linux/x86/with-libc/parent |
3124 |
@@ -0,0 +1,2 @@ |
3125 |
+.. |
3126 |
+../../../features/with-libc |
3127 |
|
3128 |
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest |
3129 |
index 5a6bdd8..c781f7a 100644 |
3130 |
--- a/sys-devel/binutils/Manifest |
3131 |
+++ b/sys-devel/binutils/Manifest |
3132 |
@@ -23,6 +23,7 @@ AUX binutils-2.23-ar-ranlib-truncate.patch 1095 SHA256 6d09ce8e2fbf370fd73f9ff61 |
3133 |
AUX binutils-2.23-mbstate_t.patch 5739 SHA256 ec17ce4d4e47d861f2300dcbdf4f4143c38c7919af9bdb8dd82350e8f0f332e7 SHA512 33eff1d30b93f13dbd11959c9110bf0f787b1e2318f2cd03f9918f8089c136aa6a5188d759825e8b0bb819000ab552234dd18568b121cc6ea9b537538a97e79b WHIRLPOOL 3da5ad51d0a13d0028570cf61b8b60ea19722073a70af6b5d9d07f5845b9970243a65d3359ae91ce58f4167e47837439eecec94db5d3f86a0e3fab03736bfcd0 |
3134 |
AUX binutils-2.23-no-ld-script-sysroot.patch 376 SHA256 0439bfa86a1f4dfd18b56b0104e78a3c670584424ebb6205c673fc6f5015b7e0 SHA512 4624f2ceebba47c2656430d1923c72a6a20cff2c57b58ecb001fd4e67e3a34c7054f1f0f12be7ef21f4789298800106219f4a5dd19cafadf9858ba0d4bee5f43 WHIRLPOOL 40de5dc12ca11855188fe16b85d892085e64cbaedcb04a266085502f2cea9de3d94d2c61036548ed3248f7d48b986ac5748aed7bf750f0f9f78c53af515d3329 |
3135 |
AUX binutils-2.23-no-rpath-sysroot.patch 1008 SHA256 9c35d21c8a5ac0edf8812ea126b6cc7f8ed630a73f4c91db3cc27652b638d8b6 SHA512 d5b311f18f3f6b0e21fbb3da355cd99e98e9ed10d23b9b684a2f0de263966c959b39d22866f93cefb1d81814fd1a7ade14302338c57a12614fd9d64c5b390710 WHIRLPOOL 10b832f32a0f9acc9924bd0d5d81ee99cc13549309691025e8d90a874bf99dfde0efe9a0a357c9c924edf2cd34a2f3371c43a79ea8375d7377507fa5c961d34c |
3136 |
+AUX binutils-2.23-runtime-sysroot.patch 4476 SHA256 123e8de7d74a65ad45dcd0d4f6a6248b45b02938547b9c3fb9f8b2c3f776054e SHA512 48bea81d36d5fa53ae9981d2332490f4063ad50937363f4b7701bbc218c95fb7e1551ca3ca880f317d2ab7e9fbda736075a98d034b1aa969013aab1b0c48e3a1 WHIRLPOOL 8db49092cbea421a3e520bd94ba41ab287e1950ca67d577a369b35da5c93dc318a6a80600bba643bcc6b62ffa16de3055551cba2eb24a06d100827748e2ee211 |
3137 |
DIST binutils-2.19.1-patches-1.2.tar.bz2 10544 SHA256 128c949a46e6c516b5ebb2dbb7be553db7d8f1ee174896d1b63adbd0950030b3 SHA512 6aa2c923748d5b80f8e495176f19d8df8defcaa53915835b57a1da7c7a78668cb63d3380dd027593c8909a35de61adf2ea3d0ace64eeb537171271a6c6cbf33e WHIRLPOOL 04b26a82b2021626d4402c3275776bd9f91139082ae799350f9605bfa7e72fd3d72aac7636fbeb0e1fcdb93b6e903b396320b439502462baad06a61b0a3960e6 |
3138 |
DIST binutils-2.19.1.tar.bz2 16306586 SHA256 2dbd2c554b70d915c5b32fcfd401d03afcbf202529059c7a80af3993885ad1c2 SHA512 22af3cf65ad2f76469440fb992e50a10895fcec1265b98781138db0fc40bf06565af86dc73ca0b97bee764ec797439a89b5dbca2a5da74f375af55383887c436 WHIRLPOOL 340c12072a60c8f7b4b930a857e87d9723bdd2b0c61bef5a06810e11406f3e7955632a93a59c68b60220a882ff99273af3a9995872aa7a11604dd04182ebc6a2 |
3139 |
DIST binutils-2.20.1-patches-1.2.tar.bz2 15747 SHA256 30738e18f492bd653421d4bc4d52b841680fe4b17a69524e081d9befadef6d3b SHA512 23c1026db7748f9f958d32f6bfd2b362dae3bdee33612fb6a0cc4277fcb360a55c5618dc748a7119b12794a1bc22ea70af92c04f5283c0041bc681e5db4266b4 WHIRLPOOL fc73133cbd0aaf9447296425dd22907d3b984a9d8c0631be5155cd887ca44932b5d3651d538783ac10e520c6b43a077fb045ea720d95855f04b4ba47cb9076a2 |
3140 |
@@ -49,6 +50,6 @@ EBUILD binutils-2.23.51.0.3.ebuild 1926 SHA256 d0ced61c78ac4b32e1d2ba5d4175ede6f |
3141 |
EBUILD binutils-2.23.51.0.5.ebuild 1926 SHA256 5acbc0b45224ef8cadfa29ab59dbf656db8a68c5399b5b60bcd392144b1c1b6d SHA512 d16696d16e8fcb39f66daf6a7b6a5b1fc9361e75a5a3d432c0ba828f29d6f12230124b6d9d8cd175c9530a3ff8d59998c3e74080fe5fa39f8a3976ac9eafd0bf WHIRLPOOL adb0754bb3cb1a52137905c32149d281fab69a2e860ccbbbd610b0647b319777bdf6c6ff1a45d6123d41787d25c0d7310e3702f950aea470aaa45234ef974b2f |
3142 |
EBUILD binutils-2.23.51.0.6.ebuild 1926 SHA256 dc592c519f9b3eae5587db82029c61f2377eff12680362d4c611895a21e259bd SHA512 2a3c053484c4edee75aeec65310088046ca53e978a23705a432db57f08ee2f064af7d71548f16dbb38c053586881b1d2d39497a892a31d7f7ab8e49b548108c0 WHIRLPOOL f1ee641ed30639264904d3fc0db5bca3ec9efb5c890eabff79fd400c92558ed6b5a80898bc6b349d110ac7290f39dcd23c8a7fc02533ebfe79896cb9b2a91636 |
3143 |
EBUILD binutils-2.23.51.0.8.ebuild 1926 SHA256 108ad27215ebb8602193ead950a3962c724f1b24e5e14e05277b96a189d63876 SHA512 7a1b7840aa428ee2e52446c8082c16db07f61b7434ba9562d48e1b9e68e3bf449c0a54c31d250ece8fd371f09bb694162a6ed5bdf9f6c8539710c5295601ad20 WHIRLPOOL ed01c0234f6da5f75d700184ded119106d66462c5327b48b9d7ed6d0dd74aec70f866dbc043aaf6bc5bc2d9f98cf313eb11a7df96ae28f7f1ec6dccb9ba3b645 |
3144 |
-EBUILD binutils-2.23.ebuild 2165 SHA256 cacab6f23177dc813907db61a525b233733a28a50c54c0641c9b4897aaa3b881 SHA512 4825fcfbd8713ab242702c23e37f931328906b1868bff479da1eab3d7eff5ec12b378abd211f558a7c279f5abc4ba0102371efb9bf8680d8ee7f5bd075362f54 WHIRLPOOL fbaa3edfcc364c4c0aa7b4abb837a8a7bbcf9dc886650f3be769f1311c3372b7e05fd6e89f1a5bb734f7b6628b9c726baa9fed2da44ed43eaaf9a1911001cfcf |
3145 |
+EBUILD binutils-2.23.ebuild 2135 SHA256 1849d4d616080f5ed8dee63ce5591a443cd55894cef188a93772109b8ac796a4 SHA512 c42bc7ea2f3ccd0ddad0fefbec91db6d1851c7d70f028d119994e445b98c5af5d77f89a0cd6787b1bec25f32a67e08eb35ac141d9e9a3d6455e04db968433090 WHIRLPOOL 8221b0257ee32f5db9746e26b8d34d637c21ac6949fd24e8ecbed5aeebf725e006104bd36a8a08bfb1cb5efdc41be541646616d505a6162251fa824511e64fb2 |
3146 |
MISC ChangeLog 79130 SHA256 eec9a2c9c8eaed424daddcbe78677d8512ebe8072ab5828d6c329cbaf4c74557 SHA512 c0b47a76155c56dcc25863cc8174a379470e1d2620602b34dd452c1b56b9b818af545bed30cabc8e8f4d68f019aa5c87bd10081784bb5c4c9cb6e2adaf1a9f44 WHIRLPOOL fbf0a664cd49d9faa29006768342890ff4906580aedbb4ebfeacba4dd32754badab6c941700f078a8bc020456c985dc255eeb26a9144d7f72a30bdd7b64398a9 |
3147 |
MISC metadata.xml 386 SHA256 58db91727c014c22db0fde315c25cb22c59dc5c15af5d30ee4c01a248500b67c SHA512 f5c6d289f0018d0eeb4ebb2fbbfda7c08aa70a98771f1c0795838137a0e3b848fc9e2b2355cbc7367a72dc00dd5e0a946c0eb5349a86eb3796af43918961733a WHIRLPOOL 92b3371b27092dbaed212837f544b059d5b0b2c547ef8c965836ac1dab1cdee198bb6ab63ab495eccdd1be1c1f5ce9e93624722a9ffd433a7615be202134336a |
3148 |
|
3149 |
diff --git a/sys-devel/binutils/binutils-2.23.ebuild b/sys-devel/binutils/binutils-2.23.ebuild |
3150 |
index a191758..a6c8d42 100644 |
3151 |
--- a/sys-devel/binutils/binutils-2.23.ebuild |
3152 |
+++ b/sys-devel/binutils/binutils-2.23.ebuild |
3153 |
@@ -17,8 +17,7 @@ src_unpack() { |
3154 |
epatch "${FILESDIR}"/${PN}-2.19.50.0.1-mint.patch |
3155 |
epatch "${FILESDIR}"/${PN}-2.23-mbstate_t.patch |
3156 |
epatch "${FILESDIR}"/${PN}-2.23-ar-ranlib-truncate.patch |
3157 |
- is_cross || epatch "${FILESDIR}"/${PN}-2.23-no-ld-script-sysroot.patch |
3158 |
- is_cross || epatch "${FILESDIR}"/${PN}-2.23-no-rpath-sysroot.patch |
3159 |
+ epatch "${FILESDIR}"/${PN}-2.23-runtime-sysroot.patch |
3160 |
} |
3161 |
|
3162 |
src_compile() { |
3163 |
@@ -33,6 +32,8 @@ src_compile() { |
3164 |
*-interix*) EXTRA_ECONF="${EXTRA_ECONF} --without-gnu-ld --without-gnu-as" ;; |
3165 |
esac |
3166 |
|
3167 |
+ use rap && EXTRA_ECONF+=" --disable-runtime-sysroot" |
3168 |
+ |
3169 |
toolchain-binutils_src_compile |
3170 |
} |
3171 |
|
3172 |
|
3173 |
diff --git a/sys-devel/binutils/files/binutils-2.23-runtime-sysroot.patch b/sys-devel/binutils/files/binutils-2.23-runtime-sysroot.patch |
3174 |
new file mode 100644 |
3175 |
index 0000000..436e3df |
3176 |
--- /dev/null |
3177 |
+++ b/sys-devel/binutils/files/binutils-2.23-runtime-sysroot.patch |
3178 |
@@ -0,0 +1,116 @@ |
3179 |
+The feature sysroot originally for cross compiling has two parts. The |
3180 |
+first is to prepend lib path, done in configure phase, which we call |
3181 |
+configure-time sysroot. The second is to prepend rpath in libraries |
3182 |
+and path inside ld scripts when ld is called, which we call runtime |
3183 |
+sysroot. |
3184 |
+ |
3185 |
+In the case of cross compilation, both are needed. While in the case |
3186 |
+of native sysroot, which runs userland in a directory prefix natively, |
3187 |
+only configure-time sysroot is needed. |
3188 |
+ |
3189 |
+Here we add an additional option of --enable-runtime-sysroot to fine |
3190 |
+control such features. |
3191 |
+ |
3192 |
+2013-08-25 Benda Xu <heroxbd@g.o> |
3193 |
+ |
3194 |
+ * configure.in: add enable-runtime-sysroot to control the |
3195 |
+ macro ENABLE_RUNTIME_SYSROOT |
3196 |
+ * emultempl/elf32.em: only prepend rpath with sysroot when |
3197 |
+ ENABLE_RUNTIME_SYSROOT is defined |
3198 |
+ * ldfile.c: only prepend lib path with sysroot when |
3199 |
+ ENABLE_RUNTIME_SYSROOT is defined |
3200 |
+ * ld.texinfo: document this new behavior for ld script |
3201 |
+ |
3202 |
+Index: binutils-2.23/ld/configure.in |
3203 |
+=================================================================== |
3204 |
+--- binutils-2.23.orig/ld/configure.in |
3205 |
++++ binutils-2.23/ld/configure.in |
3206 |
+@@ -70,6 +70,18 @@ AC_SUBST(use_sysroot) |
3207 |
+ AC_SUBST(TARGET_SYSTEM_ROOT) |
3208 |
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) |
3209 |
+ |
3210 |
++AC_ARG_ENABLE(runtime-sysroot, |
3211 |
++[AS_HELP_STRING([--enable-runtime-sysroot], |
3212 |
++ [prepend sysroot to libpath in ld script and rpath, |
3213 |
++ only used in addition to --with-sysroot (default is yes)])], |
3214 |
++[case "${enableval}" in |
3215 |
++ no) ;; |
3216 |
++ *) AC_DEFINE(ENABLE_RUNTIME_SYSROOT, [], \ |
3217 |
++ [prepend sysroot to libpath in ld script and rpath]) ;; |
3218 |
++esac], |
3219 |
++AC_DEFINE(ENABLE_RUNTIME_SYSROOT, [], \ |
3220 |
++ [prepend sysroot to libpath in ld script and rpath])) |
3221 |
++ |
3222 |
+ dnl Use --enable-gold to decide if this linker should be the default. |
3223 |
+ dnl "install_as_default" is set to false if gold is the default linker. |
3224 |
+ dnl "installed_linker" is the installed BFD linker name. |
3225 |
+Index: binutils-2.23/ld/emultempl/elf32.em |
3226 |
+=================================================================== |
3227 |
+--- binutils-2.23.orig/ld/emultempl/elf32.em |
3228 |
++++ binutils-2.23/ld/emultempl/elf32.em |
3229 |
+@@ -525,7 +525,10 @@ static char * |
3230 |
+ gld${EMULATION_NAME}_add_sysroot (const char *path) |
3231 |
+ { |
3232 |
+ int len, colons, i; |
3233 |
+- char *ret, *p; |
3234 |
++ char *ret; |
3235 |
++ |
3236 |
++#ifdef ENABLE_RUNTIME_SYSROOT |
3237 |
++ char *p; |
3238 |
+ |
3239 |
+ len = strlen (path); |
3240 |
+ colons = 0; |
3241 |
+@@ -553,6 +556,11 @@ gld${EMULATION_NAME}_add_sysroot (const |
3242 |
+ *p++ = path[i++]; |
3243 |
+ |
3244 |
+ *p = 0; |
3245 |
++#else |
3246 |
++ ret = xmalloc (strlen (path) + 1); |
3247 |
++ strcpy (ret, path); |
3248 |
++#endif |
3249 |
++ |
3250 |
+ return ret; |
3251 |
+ } |
3252 |
+ |
3253 |
+Index: binutils-2.23/ld/ldfile.c |
3254 |
+=================================================================== |
3255 |
+--- binutils-2.23.orig/ld/ldfile.c |
3256 |
++++ binutils-2.23/ld/ldfile.c |
3257 |
+@@ -463,7 +463,11 @@ try_open (const char *name, bfd_boolean |
3258 |
+ result = fopen (name, "r"); |
3259 |
+ |
3260 |
+ if (result != NULL) |
3261 |
++#ifdef ENABLE_RUNTIME_SYSROOT |
3262 |
+ *sysrooted = is_sysrooted_pathname (name); |
3263 |
++#else |
3264 |
++ *sysrooted = 0; |
3265 |
++#endif |
3266 |
+ |
3267 |
+ if (verbose) |
3268 |
+ { |
3269 |
+Index: binutils-2.23/ld/ld.texinfo |
3270 |
+=================================================================== |
3271 |
+--- binutils-2.23.orig/ld/ld.texinfo |
3272 |
++++ binutils-2.23/ld/ld.texinfo |
3273 |
+@@ -3026,13 +3026,14 @@ then you can put @samp{INPUT (subr.o)} i |
3274 |
+ In fact, if you like, you can list all of your input files in the linker |
3275 |
+ script, and then invoke the linker with nothing but a @samp{-T} option. |
3276 |
+ |
3277 |
+-In case a @dfn{sysroot prefix} is configured, and the filename starts |
3278 |
+-with the @samp{/} character, and the script being processed was |
3279 |
+-located inside the @dfn{sysroot prefix}, the filename will be looked |
3280 |
+-for in the @dfn{sysroot prefix}. Otherwise, the linker will try to |
3281 |
+-open the file in the current directory. If it is not found, the |
3282 |
+-linker will search through the archive library search path. See the |
3283 |
+-description of @samp{-L} in @ref{Options,,Command Line Options}. |
3284 |
++In case a @dfn{sysroot prefix} is configured without explict |
3285 |
++--disable-runtime-sysroot, and the filename starts with the @samp{/} |
3286 |
++character, and the script being processed was located inside the |
3287 |
++@dfn{sysroot prefix}, the filename will be looked for in the |
3288 |
++@dfn{sysroot prefix}. Otherwise, the linker will try to open the file |
3289 |
++in the current directory. If it is not found, the linker will search |
3290 |
++through the archive library search path. See the description of |
3291 |
++@samp{-L} in @ref{Options,,Command Line Options}. |
3292 |
+ |
3293 |
+ If you use @samp{INPUT (-l@var{file})}, @command{ld} will transform the |
3294 |
+ name to @code{lib@var{file}.a}, as with the command line argument |
3295 |
|
3296 |
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest |
3297 |
index f850b69..8377b0c 100644 |
3298 |
--- a/sys-devel/gcc/Manifest |
3299 |
+++ b/sys-devel/gcc/Manifest |
3300 |
@@ -74,6 +74,7 @@ AUX gcc-4.1.2-darwin-fpic.patch 619 SHA256 468cd067347194cd00175a08d88960ba5b8b9 |
3301 |
AUX gcc-4.1.2-freebsd.patch 204 SHA256 de33014a03741e46d027f7210f96221b3db45fd4161abf6c54c62342918b22f0 SHA512 1f550dbac6532a46c9eea70f7560d83d4239d96d788a704f6624e275f83c2ad9cbba67c148e01e5d833b6b7fb42e29c7082815b9f4f2c3b5f73122245d956583 WHIRLPOOL 95494bf1c3b0faa4464cec1343e505025b11b172e6db58e3cae30780704db3377965dfedc8bceb1aa20d4b2cfe69aa24b5d1f41c35d76020f23f61463541385d |
3302 |
AUX gcc-4.2-ia64-hpux-always-pthread.patch 868 SHA256 5a0f38a7df257ccba771b16336682f363e70bbb8c07d72a0b4d3f7f173f413f8 SHA512 d92ec8072309fdece588b4874b4a555d9afcf78302492de0ffb167b46038f9fe1e0d64c65a63cacec9d0672c76984165e517a3e3d3aba1b34894ed58c063a5f3 WHIRLPOOL 2c8f03ba53fbbc9dc5df19a25b883826a4a939d8ccc443d6c83cc8187c871f40471e434b30da297e2426e80d3e68590370a3f4692ed2468137c4e8f4821e3724 |
3303 |
AUX gcc-4.2-pa-hpux-libgcc_s-soname.patch 483 SHA256 6bf38ec9e85b6b4da839e1781ddd06ba689d1b5ad8257e5c8052289343b664c3 SHA512 66b7f1888918d132fd751be5d00f30bb4646b279ac803cb76a00a5388e33fc7b0792689d049c8a3526652ef77dd32a759c2f43f5e1ede42e4cbfc892c717d6f2 WHIRLPOOL 18cf4d80c86b4eb3bc835f00fd27cf55664646a47733666821b6426378507d3c6fc1192f4559c2a62eff501b835b531fb66c3b7e09bdf7752af170b4764b13be |
3304 |
+AUX gcc-4.2-rap.patch 1250 SHA256 1b458c52b2d81a031882547f5784721ea00012ad5377f3557ef176eaa80fd936 SHA512 3ae8db2bd956cb42dc121653506d286f7e098524e5a3b2ca28cacd7622af7c555e1a3fb5fe0a33e02801271a8c9b4bb0a83d86593633f176eb12425b2be198f2 WHIRLPOOL eeb41d50970d1843c9c96c2c31b9f7b6fb33fdecb6f280a35f320b71e582d7f5811db6dcde534de4768f3e4162403276a5d081c9d1c7af930d7ffb9acd490c2f |
3305 |
AUX gcc-4.2.3-aix-largefiles.patch 9519 SHA256 b9b035ec252a118c1725a69900a73ae4c3f22f08350038504face1b9438446af SHA512 bac988d25176a302b3ab2272f0f89b1d37fdebc49f15a7d01fd985d9a7e5adbaf270cb5dceb02298a3e8e420e54ffa906f8c8cdf65fe255eb9f67b721c3bfae0 WHIRLPOOL 794aa70c42af00fc4ad013b4b7450bf2ccc9200c55067e59a9636b6ec642d65e2dd0d123723d8d94a67492e161e7ca0ef2393638d70d4a5e54434546c0226121 |
3306 |
AUX gcc-4.2.3-mint.patch 786101 SHA256 2420dda14ee894b95f322dee1452fc4fde25cdbe77c4b416b0d77d276f1c67bc SHA512 b12bc5c70c9cd6f9fa15f94132e972405f6693d001f4cbb5c902edba4e8a3de6bc1beb3746984fa5b1c268f5f904f6ffee82ac67ea6201cd7a48afe30257c1ce WHIRLPOOL 4656603088dd4e84fbf76ad764721985f7d2075b68d3576ea22aaf75546ecde5071e93d2f54aabae1ea9096e47770c42977616ebd1bb6a219d74229e3a5ce31c |
3307 |
AUX gcc-4.2.3-mint2.patch 19829 SHA256 7c7a5147d74cff334b4946cfe5f7a3ecb99f2c9204ccc39c989424b4c161eda5 SHA512 93f1e7249174127c6492918951be87eee6a180f930c6ed14d5846fcf7dda6aff3ebcdf22d85cdb01e5d0f7b0084995bc6f87aee11ac6efe727fa62f0d9a0b5f5 WHIRLPOOL 08cd3ecaa0740afc8dc480c1f1253690f6441588c61c2af0b1af82ca995417cdf7b83d85f487e3dd8be346d39b42bd6a1cc8585e70c19f9ab8ec2cb031437257 |
3308 |
@@ -86,7 +87,6 @@ AUX gcc-4.4.1-interix-avoid-bs.patch 1916 SHA256 3c3c7019b3164ed463ddbee41131ff7 |
3309 |
AUX gcc-4.4.1-interix.patch 12986 SHA256 33953e755b4de1e5b5d272b3e35a8d63a68a16457e6fe8b10df9eb65e4ca98d3 SHA512 3194dd9477b3a1cff15b0e5034d8f8e0eb33e6ae861a4b2ead725ca25fc129e347cccc8e8300bdf8c60350e359852696727b12bd04351eaf4cbc3165a66ec5ce WHIRLPOOL 3669bf6cb5cc465ab6acdb7f2c755081b34c95f59a0fdb60ea29d5203d5c55ddb33b0ae9f5788be51214edce214b12cc2f71c5725810642b20abd9524b4200a2 |
3310 |
AUX gcc-4.4.1-linux-x86-on-amd64.patch 1559 SHA256 cf300a35076e42ab530d3c6b4a81fb0ebaf0174bfba5e26cf565d63cef5fd670 SHA512 53c929926837487678d80acfbfe24b37a7aec8af0def837d2c699a1df4c9839d54cc91de4f33c696aa114d52059e245aa9614b86fdfd5fe1c5c1a1715dc1cfdb WHIRLPOOL 4bb0644b6d147b9bb69f94212b414b108f35f1c6d4b8d3dbd41319aca0ccd70ceb9e2ca947f180ab2d1f7ff1408065024199e89e4796bbef226960ee58901d56 |
3311 |
AUX gcc-4.7-rap.patch 1913 SHA256 75842d968d21d9916d41c4e75be12387d818221465fb2335546418c744b2eee1 SHA512 aee8bc93aebd9a217b53cd4c6d6fd79780eb77ef490164d35a056d08d0cc5b550ed7b6e298f963cbe61511caf2b03d47ff5df50a6de95b86c104dfac3ed0f273 WHIRLPOOL 7702b0cefb958f6fb7cef5bb0e1f056412d5f972e3a4653735f33b56245db7d984d7c21a5e47282d6283efadefb76bc850877d151d15bcd3f081aba1360a0d7d |
3312 |
-AUX gcc-4.7.3-no-sysroot-to-ld.patch 344 SHA256 9dac13ca1009c7d088f603d30e87e5c47156b553f7dc1fd175c3d1c0a76e26e4 SHA512 283a50e1e6bd4f28db4d5ece7440cb1e79c26b0b5e2d8cd9084f1082315820c8ddc6a7a22c57b2bdd02db3ed7928e1751f9b6cc354061d02f6511fb722b09569 WHIRLPOOL 86200482591e1b5a035e1f74dfd6f2f4976408bd002adfac9869264ca9341f621d329f79154c8d9b966773bc0dbf6d9fe16cc1f6d0a64eac9bf5c6734e4f81f3 |
3313 |
AUX gcc-4.9-extra-specs.patch 3894 SHA256 942654807a350bdfc1f587766238bea0caabe4d804e48a8705ea5faa56701641 SHA512 32a477d66b85793cdd6c51a1dee29393914b5ecd5db4022387457ff01e871a1efd1ad77be3b05275cdf96e0ae822a7d353ed40ad1476326c60e9bdd9054930cc WHIRLPOOL 47bf1ed50db265235f5f5cae5e45831c1059a2c26fa93d6ce86299c5986da2c38b10b2ca39e59ba8c796716f4e88eadf85f84c5b4a6b5acf25dc56e5a86c182a |
3314 |
AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb |
3315 |
AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4 |
3316 |
@@ -107,19 +107,14 @@ AUX stubs/gcc-3.4-htb-stub.patch 722 SHA256 0768dcafc35be6d35c9aa0106b0c8b87932e |
3317 |
AUX stubs/gcc-3.4-ssp-stub.patch 1068 SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982 SHA512 d797117e2663c5e0d3dfbc983e5f943a0724fbf7b28359451c12572d7af8cfe7667afe36aa6db1fd831da681be8492100231f0913bae662898d40a42adb8d56f WHIRLPOOL d96c065c8a85adca2915f965975a7a33221c0109354f22b1e3c4cbf00b264bb5b178888476ff56f022453749565e41b02ebe91f092762164dd5c225e208e7b8c |
3318 |
AUX stubs/gcc-4.0-htb-stub.patch 722 SHA256 e9b63d3644c0c10e871d5bd94ceae55bec0726b76e9a7c43c83daf6c840dfb5c SHA512 a7eaff57c2ec6a6947ef5d938320638dd9206c2e274431251c3be3928caeca941a679e74b6238880db589fe5b00cb6d1da644e6f06d02b331b5646cebaacd330 WHIRLPOOL 9b30fbd1dac7143491d79d3821370c11c4a79dab1f6294ab5a60578605e4d2e86d51730da6d48ee08df0618bb0deddf6d2da36b91a5b632cef14dbd2178c042c |
3319 |
AUX stubs/gcc-4.0-ssp-stub.patch 1068 SHA256 259b08fc6ba1a5fcc6848c1a0742e9b90dd43985c61fab4ea2e9e79ec795d982 SHA512 d797117e2663c5e0d3dfbc983e5f943a0724fbf7b28359451c12572d7af8cfe7667afe36aa6db1fd831da681be8492100231f0913bae662898d40a42adb8d56f WHIRLPOOL d96c065c8a85adca2915f965975a7a33221c0109354f22b1e3c4cbf00b264bb5b178888476ff56f022453749565e41b02ebe91f092762164dd5c225e208e7b8c |
3320 |
-DIST bounds-checking-gcc-3.3.6-1.00-r2.patch.bz2 829688 SHA256 eacdaecd9c07b6573a6522ac776d8daad7658c4214a7fb0ff950cd47ff811ae6 SHA512 d4533d02289dcd2ee11952f83dc687d82624d6e31ddb548e4f54cde4ef9cced5a1aac5b64086441f8930274e31f20d0ee82850fe1257f96c08b05d406d3b2e26 WHIRLPOOL c9d39cef9408472634a689a61e914ea01e6f67294162d16fcd5b451d1b33aed86f842adca8e4995c863ca1ed7a4e5fc0ce68d99a78f1e765cc3caad06ecbf6e9 |
3321 |
-DIST bounds-checking-gcc-3.4.4-1.00.1.patch.bz2 815566 SHA256 6568f904eb26ff4bc90e23792b3346aaf98c0ffe38a1abe853d823b3c2157e96 SHA512 da11cb354d5ec95c74081c2cbb29bcb49817a1f9d6875587b4a27f1c9fdea8f07eec8147b739bd18a4fa2365e5da50e4bca7d7531612fbf2514c50516d225ac2 WHIRLPOOL fedeb8ca85af5bcc924243cafde3a96f0ddf69df13a1e2c68a207c0dda3d598af59b49a92c35e104a16f70af86a0027a7630306d23aaf873f48149a64e86347f |
3322 |
DIST ecj-4.3.jar 1377431 SHA256 9de193ea393ed50d868b730bad6916f7a8ef4ba80216f8606d3e1a0dd886e74b SHA512 c4be72186d81747f1adce5a50de303c24bd6ed9f401bfa8871b1b864fe7591392218b1937b10d0e76014de8e0b6a1d5c4280475976218141cd1878c4a35217ff WHIRLPOOL 9137d6aa5b0e34a596e8d3de8843b5478cec8cdd4113303d554120ba8c6d467e802414f861ff0d7ef1d85dbcb09d4ccc10668385460d1a476345e2de86798bce |
3323 |
DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad |
3324 |
-DIST gcc-3.3.6-patches-1.8.tar.bz2 51585 SHA256 8510a62f0e8c5e16d9b3d667d94e8c45b877c103dacf57ca625c6c72b668ef4a SHA512 35f8c5b3654618606110dde9f99f846e56d7d0dc5dfbcaf3cbd061589e7571484692133e2298680b39d52d4f054fbf43b919bb9e1e6e3ea280b96f8270e5dc54 WHIRLPOOL e6a8b9528578ddccf01e32f9c4894397d126d4190e5757767083f1a3209c2047676a2b2858299b0b74e7104377b049b70ac1ed5ea6d5abd52e9fc14a23be460a |
3325 |
-DIST gcc-3.3.6-uclibc-patches-1.0.tar.bz2 28882 SHA256 c007f38cb0c57291adf0b367f31e14c84dd1d6f48a388896eb63b6cd4328e418 SHA512 d060c1552d4f21b8b1cd6a6e56b9af4f62f61ce8ef4362afb1982b2ad9defe6a9648705cf780103d4f2061737553b6737c276d79b803b6b75ae94035bc881f0e WHIRLPOOL 524204cc41097f13e0de2ad8e99ff80d449c490d602625d24ddda6b874cf63194d62c22f98469f5ee89c8283df82a25fbc989db32a52f31f2a31928b5a522f2f |
3326 |
-DIST gcc-3.3.6.tar.bz2 23972413 SHA256 1c1aa533c67e9da5e55ed4f5736258dc753466bd716bdae3fb88fb66e6ff1d7f SHA512 576b88e2fa675314a79a85f180684fe5af370c596476a0bf02e33e8ae0e2be838417ea80675ce4194a8213792cf7ada50cae5131149e4b890ab61e0b8d50d0ed WHIRLPOOL 27372f9d12cdedaad38e75c3efea3430d6873d92f85ec0024e2cc5ad986c710ed940edecc926a4c25ce14d14cddc1aec3eb35ac2c29e8c85309685d525a99cf1 |
3327 |
-DIST gcc-3.4.5-uclibc-patches-1.1.tar.bz2 70923 SHA256 5b92fac2afe835a127976fdb6602fb5628cf28e67dd19e8289768a3bb8631ec2 SHA512 c0534a374e2e0416d0792373f9d11526226f9ce1a98e771469efa68388b709c72672b8db8fe77901144a96a23e4fd9f9a99f1d278f1e8fffda8a6b01e3b770fa WHIRLPOOL 79a7bb14e220dad7ea818afae12839ff7cc624f128bbf7a29c8005478f6da9742ff08100088baeaf36c038f7ddadc4ec64e78d5283ed19efb4d3625916a3b00a |
3328 |
-DIST gcc-3.4.6-patches-1.7.tar.bz2 59052 SHA256 5e520ee48be297f5e5c4cadafcf883c61938680fa4115670d3b65f751d3f2241 SHA512 025120ab1235ade1c5ddd0df97b8f5872fd4d4adbd830569cf11d02df528701055a183389c5898b3b3a8415f4460deff0db7d2520436ea0b6069ff5eab13e358 WHIRLPOOL 85e5ae834f2ebceb61d4afd35433fe39287b178413a550775473778d830545945f01211d744e1c336ce61cecc2e5ab357b0c7a989f9480e1d52c422fece68c29 |
3329 |
-DIST gcc-3.4.6.tar.bz2 28193401 SHA256 7791a601878b765669022b8b3409fba33cc72f9e39340fec8af6d0e6f72dec39 SHA512 d235e1223d5faf8f37f2d73db35edeff44c88974b09dfcf325f4b181b16d7124710d93b1b65b60206ce3525f062236ea0f338b3a5341d7ecbe196d8e90c3ff18 WHIRLPOOL 19fc447592f1feee56da74ee6d9436e0813e5a29ced37f8bf91836bbf0b1b9023fe2f717f8c3cf6dc84f11d2029cd87b65e9176b19727996420b589716cdfa45 |
3330 |
DIST gcc-4.1.2-patches-1.4.tar.bz2 53188 SHA256 50959f19bf5a7d3c131c67b2df0437156039c6b799e49cfeb32de483727c1eb7 SHA512 3d22033b285fb63c7df58ffff4d8054f844a9142bf7e6dfa5d8453705b7a64c2da8c3169a1c3390dc92c072800e60c7d7e95e2d8bb6622e0773562fd5fb268a8 WHIRLPOOL 003246e7560ee87109aacebd1ef5ec1f7bcdd2f2dbc24a2fb9f9c7ca98e502ee8734e44c3bca5f337d3cad31dcefdc5473ff125cf603c596adc191ac6cda666c |
3331 |
DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 SHA256 c6ed88711a727ed11847c9b9f1cef7023037bc80c0840eda5fca6d60fa02e35a SHA512 57789f4236a3085136afa83be3cef677bd813afd258d67bfdbecd2058f497cd459366d5515044c0208ab753946dc951dac6a3889752ca6dae836d837c22ce33b WHIRLPOOL 6a0eee923be11ad415eed56f4acc11480747aff92d97baf083526866d3c7eb63ca1fe51375fa70b9223f863a25e4487ebe9ce9da2acf1bbf6b55c6ad2d1a7010 |
3332 |
DIST gcc-4.1.2.tar.bz2 39707720 SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc SHA512 b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc WHIRLPOOL 5822040f7e96919bb906ce55e0bd19c4c85b3a47ce73f0a4b6d0da62ce9d7651b6cbeb6199dafc38582b206a98126e3efec8d54cc58c7f303ca708c9261bec57 |
3333 |
+DIST gcc-4.2.4-patches-1.2.tar.bz2 24215 SHA256 0dad9f1345027b620f6345a125804de16c8693a859e0a4fefc2612823a9f65ae SHA512 0099f348972e128e8d7b5d694f0212fd9b5ce29e0845e96fd08c7854bcb40133ea5e3e90a762245fbb04ae9d19e41bf04078123c7b58fb0d09ade05f1e43cfa6 WHIRLPOOL cb6300a7f84e3bcc85ea677977852a5d13d41473a7aff82f9c6dcbc68331bb34ba456642f323d326c7e1b47083f0ba4ebd3f5a63edfb876fb8b03fc6b788f960 |
3334 |
+DIST gcc-4.2.4-uclibc-patches-1.0.tar.bz2 19167 SHA256 45fe49c144db3c23f928f0303a80071145361242566671afc96b6dfea5ece221 SHA512 5545cfe6bfa7ab9a69a474cc051cc8744380077dcc193afefeb455e959e408a5e4dfd1adde5357886c7f598835400273ef80ad5c14976c0552b44f5cd48704ed WHIRLPOOL baa4c6bc76deff38d3f85e7b91f53e6f3785e2d315cd835aa8d4a80b580f43c2fa21046df85f17d8c81f95a91c0fa782078963a2849ee1604f3202c9790b9d27 |
3335 |
+DIST gcc-4.2.4.tar.bz2 44025458 SHA256 afba845e2d38547a63bd3976e90245c81ea176786f9e6966339c6d3761f1133a SHA512 c6e3e4fce1d27d0c56ab24f4809367d9329b620b7c124e88de190f2ea2ae57b5e06d0bda85c5a74237a4f94ddba53dc91faea0611fff7b19ad720edc312cb0d9 WHIRLPOOL 242177c7adc1538dfbf0b5519132902479c9a8f21158ed04bcf29a3616bbf98d0cf4def13e602ad0226e745875c327d33e8f45eae1b1e6de6d61e2a0ca1b0b90 |
3336 |
DIST gcc-4.3.6-patches-1.1.tar.bz2 75898 SHA256 919b4e78057764fc37b670e731a7d34dde2b8ec646d096fe69a25aa9b8abe7c8 SHA512 fb586f95a01f921e3364d506a19600ee4431280ecd00ea4ffed40ed67503e904773107b7a1ddf3e572d06d9ef358b3567b41f7edb3ea49217aca103342110b8c WHIRLPOOL 1b0bf0410596b20ddc46b81738f94321164e175d4e8ddd0e14a2d8ebbdd2c4ccf450ce030fe79f1ff44da5c7f0b10924dbfc51535e938c1968234b6e57a28693 |
3337 |
DIST gcc-4.3.6-piepatches-v10.1.5.tar.bz2 6713 SHA256 3509c693a5f3c808d148ec0385150ea4e396c500d62dfa9cba77eec38ce26587 SHA512 d28dd42025761a3d26108ca972b80cc1f71d402bdda2f16caf8a15f0e0f7b34f13b18cdace89057bb0e6e73a5cef2181a885b1e20c361092f5f731ff7572d0f8 WHIRLPOOL 1805c02cfc0e987d37c3729614f538e2d7ec887dd0dffeedd876f4d7c18a56bf4ed83765f04f5284aefb7996fc9a709e8b30879ded82cba199eb2382e71a90c1 |
3338 |
DIST gcc-4.3.6-specs-0.9.4.tar.bz2 780 SHA256 c10e74f4fc189f43a455ac83b778287879e0e18533aed9e654fa71d5d57b8aa2 SHA512 3c77078e4e86640ca15f99ea658846829434adeb411f381b06a6a7cc8dc3226ec86b6f7d356f8f877bd8f6f72e466547c4109e8f772d84af3ce0f60805bb8a9d WHIRLPOOL da35f0e2c47def76056683184340c62307525ffb03522779d82e8cb560ffce654f26e07856a42611acf81f38db895b6883f246190b9c708851267cb204979fdf |
3339 |
@@ -155,9 +150,8 @@ DIST gcc-4.7.3-piepatches-v0.5.5.tar.bz2 15378 SHA256 b6f6b6709e7b13f6c05090f3bf |
3340 |
DIST gcc-4.7.3-uclibc-patches-1.0.tar.bz2 3013 SHA256 731c518f31db8debd08bea92db8e3bf1e9962552909407452dc2ac3c491cf11c SHA512 6119159300e76be87732f2a44b1a9388228235d7832370dbae531c2c96694ea42ed4c75acf7abca98ec0035fbc50a8bf84225574505358c2739e64b0f3fd6a95 WHIRLPOOL 4a874a5684937907720aa5a4a1dbc237aa7d985292befd1c591cf0789c71e0da22ced5b7f7e049731bc2d6496e959cbe3c9010047ceb1b05675e61865004c71a |
3341 |
DIST gcc-4.7.3.tar.bz2 82904224 SHA256 2f7c37eb4fc14422ff2358a9ef59c974a75ab41204ef0e49fc34ab1d8981a9c3 SHA512 5671a2dd3b6ac0d23f305cb11a796aebd823c1462b873136b412e660966143f4e07439bd8926c1443b78442beb6ae370ef91d819ec615920294875b722b7b0bd WHIRLPOOL cb3408e3e251833f38ae7cf2388a1ddce864614fe1c68de9729a1a9a1f8f028ab92c0f2b863e7fa3ac16dbf443306ac864e74c9cce90690230c081ee2ac309d3 |
3342 |
DIST gdc-0.24-src.tar.bz2 1012099 SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a SHA512 9aec7e4b102e602dfb61cd09ea4b4a96af637ceb3d726235261d09ebd35dbd416abcbfe0e46918e48474bd241fe9bb29abc145a65aa834669295aaee4fca0686 WHIRLPOOL 22322b0c3e2d67b3b37bd7fa92a29c593688f934d4ffd62b9cc87eb63a44a4f8bbc9d75cadf11209c73bdc9942c9b4430036629d0eefcd04de9055c502b85f12 |
3343 |
-EBUILD gcc-3.3.6-r1.ebuild 1551 SHA256 93d937ad10fa25af8fedbb9144562587fb8ab6f2f211b8938c821abf3add33cc SHA512 e9cad71be7db400663eff4b3a67350b48d190b9e760632c8fb0c1c8c563a872cc965ecb4f9ca0489968d8bc4d82418efbdaa03b2523258d0a1f38de0e4be4d17 WHIRLPOOL 74fafc5da47e7608d80c0b71bb4c81708c52bb41e80d295d48c2d04ce61d40a9f8b7b184a42a44981655f5964d75911926f92346e29966f2311fb5288857b356 |
3344 |
-EBUILD gcc-3.4.6-r2.ebuild 2844 SHA256 29b96db464bb8ab40bf481023ffbf7520233b7bc8b01663e44e11609026bbdae SHA512 28f02d342418e1500007978cfb9b7e3940f700603440a6e9333766495e84dd899a2c273095edc7036a5e0fe1cd57523895c3308a649a7ae53984b4f66f859c0f WHIRLPOOL 0e25ab38dc783edcd2bcfa69a236b0d7797be0fc2bbe1a6d172e217984beca256893defd0858137c321daf1fd8c8c2b1ee7ea2b6d63455b7730a30766c233599 |
3345 |
EBUILD gcc-4.1.2.ebuild 2376 SHA256 cf642ce130a342967c66d5132b1ff96bf03981d9bf2b904bf37efdd6cae03aa4 SHA512 dc546c49d2b0ccb069b1cf5f63060bacc0dc1fd60ec9afd5b93bad290f8751cae0fe80e001e2f081caf14cd6550ab17e51a183b6f080df81755ff848a9a670ee WHIRLPOOL 9d6ce3c964c662163e70dafef01b6281d19b9f636ad2a60a1acf44514077d02e81bb4896abff011caf446870a6f4501511b4963f43fd46ff492ca1157af60c29 |
3346 |
+EBUILD gcc-4.2.4-r1.ebuild 1089 SHA256 2e0e08c98ac9ded9710f714df626094b6f1820bfd7f51414a04e1ee3776d09b2 SHA512 975ee100ae6d978e3b9a368fcad93fd5d80a3ed734288e75c26872b6018bd93d9706ed96ed6c7d0ff9e18c44ddda71bfca80ae5b4555ee7a66dc536e9597b6f5 WHIRLPOOL ef4ef321bdd5b8cc795647560b08c5a7664cf95ef2f4c42d44aecef27486f308f250226dd7353e0bc9c6bb3615eb78c8f92e1ba52d9a214faf3c0081d165ef6d |
3347 |
EBUILD gcc-4.3.6-r1.ebuild 4768 SHA256 9f197aeaa19c7ea89bcc183f0108babfa1fb978b6f5052fac9a44d563d62f99a SHA512 8799eb13ee05edf40d3cbaffa9339538b0807392f8f7e4b9aed6df3bec0c68c0c88f11f2e54fa4bc7f62a6094c8de2dddc7959b59571f78de0f43ad064c749c2 WHIRLPOOL f45ae84433ac97cc40e6dfe191be1b09986d936e88718577a1b46fb76f27fb89881e323475bfd0bc1308b2b49475857cb2effd10b9fdae965f5b397294805fbf |
3348 |
EBUILD gcc-4.4.6-r1.ebuild 7872 SHA256 ca2bd3610bd15c2514ccf196f4660134f458cb8c7c2acfebbd11fb2259590dd2 SHA512 ba4be6611df9272e39ce5ae27821da0414e230dce89c2f7e2192f6259d04d2e4dad34c772802e88125abc95146836619c7f61125cc40f879dcb6942e5a161ba3 WHIRLPOOL 59395d90bbacb9e39a51571e4525b3f7b530e42a193ded89c48df460c17babcebb18203b42e98f522551e0208db625c64cf4ccbf7f95c2cc907341c25c8efb7c |
3349 |
EBUILD gcc-4.5.3-r2.ebuild 7043 SHA256 f184391b9ff408aa60268e0ba4bfa936abd55e0043dfdc97ed02bcb4533b212a SHA512 a1a4a0ec1fd1b08550177e8d08ea49179ebc79a41451de55ea3cd81573772df13834ed62ade572301fdffa0f986a929868b463bb7c371588728b8d568c966882 WHIRLPOOL 6a4ca79035453ad081dc9ab7aeee6fcf542907f0296dc2a15cf9fd04cf87b6d415cb011282f81915dcd833efb56ba66c05b9bd785db0cfbfd57a77b046bcb853 |
3350 |
|
3351 |
diff --git a/sys-devel/gcc/files/gcc-4.2-rap.patch b/sys-devel/gcc/files/gcc-4.2-rap.patch |
3352 |
new file mode 100644 |
3353 |
index 0000000..e907d9b |
3354 |
--- /dev/null |
3355 |
+++ b/sys-devel/gcc/files/gcc-4.2-rap.patch |
3356 |
@@ -0,0 +1,28 @@ |
3357 |
+Index: gcc-4.2.4/gcc/config/i386/linux64.h |
3358 |
+=================================================================== |
3359 |
+--- gcc-4.2.4.orig/gcc/config/i386/linux64.h |
3360 |
++++ gcc-4.2.4/gcc/config/i386/linux64.h |
3361 |
+@@ -48,8 +48,8 @@ along with GCC; see the file COPYING3. |
3362 |
+ When the -shared link option is used a final link is not being |
3363 |
+ done. */ |
3364 |
+ |
3365 |
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" |
3366 |
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" |
3367 |
++#define GLIBC_DYNAMIC_LINKER32 "@GENTOO_PORTAGE_EPREFIX@/lib/ld-linux.so.2" |
3368 |
++#define GLIBC_DYNAMIC_LINKER64 "@GENTOO_PORTAGE_EPREFIX@/lib64/ld-linux-x86-64.so.2" |
3369 |
+ |
3370 |
+ #undef LINK_SPEC |
3371 |
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ |
3372 |
+Index: gcc-4.2.4/gcc/config/i386/linux.h |
3373 |
+=================================================================== |
3374 |
+--- gcc-4.2.4.orig/gcc/config/i386/linux.h |
3375 |
++++ gcc-4.2.4/gcc/config/i386/linux.h |
3376 |
+@@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. |
3377 |
+ |
3378 |
+ /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */ |
3379 |
+ #define LINK_EMULATION "elf_i386" |
3380 |
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" |
3381 |
++#define GLIBC_DYNAMIC_LINKER "@GENTOO_PORTAGE_EPREFIX@/lib/ld-linux.so.2" |
3382 |
+ |
3383 |
+ #undef SUBTARGET_EXTRA_SPECS |
3384 |
+ #define SUBTARGET_EXTRA_SPECS \ |
3385 |
|
3386 |
diff --git a/sys-devel/gcc/files/gcc-4.7.3-no-sysroot-to-ld.patch b/sys-devel/gcc/files/gcc-4.7.3-no-sysroot-to-ld.patch |
3387 |
deleted file mode 100644 |
3388 |
index 78209c7..0000000 |
3389 |
--- a/sys-devel/gcc/files/gcc-4.7.3-no-sysroot-to-ld.patch |
3390 |
+++ /dev/null |
3391 |
@@ -1,13 +0,0 @@ |
3392 |
-Index: gcc-4.7.3/gcc/gcc.c |
3393 |
-=================================================================== |
3394 |
---- gcc-4.7.3.orig/gcc/gcc.c |
3395 |
-+++ gcc-4.7.3/gcc/gcc.c |
3396 |
-@@ -696,7 +696,7 @@ proper position among the other output f |
3397 |
- #endif |
3398 |
- |
3399 |
- #ifndef SYSROOT_SPEC |
3400 |
--# define SYSROOT_SPEC "--sysroot=%R" |
3401 |
-+# define SYSROOT_SPEC "" |
3402 |
- #endif |
3403 |
- |
3404 |
- #ifndef SYSROOT_SUFFIX_SPEC |
3405 |
|
3406 |
diff --git a/sys-devel/gcc/gcc-3.3.6-r1.ebuild b/sys-devel/gcc/gcc-3.3.6-r1.ebuild |
3407 |
deleted file mode 100644 |
3408 |
index 85d1eca..0000000 |
3409 |
--- a/sys-devel/gcc/gcc-3.3.6-r1.ebuild |
3410 |
+++ /dev/null |
3411 |
@@ -1,41 +0,0 @@ |
3412 |
-# Copyright 1999-2012 Gentoo Foundation |
3413 |
-# Distributed under the terms of the GNU General Public License v2 |
3414 |
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.3.6-r1.ebuild,v 1.24 2012/07/23 16:00:30 vapier Exp $ |
3415 |
- |
3416 |
-PATCH_VER="1.8" |
3417 |
-UCLIBC_VER="1.0" |
3418 |
-HTB_VER="1.00-r2" |
3419 |
- |
3420 |
-inherit toolchain eutils |
3421 |
- |
3422 |
-DESCRIPTION="The GNU Compiler Collection" |
3423 |
- |
3424 |
-# ia64 - broken static handling; USE=static emerge busybox |
3425 |
-KEYWORDS="~amd64-linux ~x86-linux" |
3426 |
- |
3427 |
-# NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper |
3428 |
-# .eh_frame ld optimisation and symbol visibility support, but it hasnt been |
3429 |
-# well tested in gentoo on any arch other than amd64!! |
3430 |
-RDEPEND=">=sys-devel/binutils-2.14.90.0.6-r1" |
3431 |
-DEPEND="${RDEPEND} |
3432 |
- amd64? ( >=sys-devel/binutils-2.15.90.0.1.1-r1 )" |
3433 |
- |
3434 |
-src_unpack() { |
3435 |
- toolchain_src_unpack |
3436 |
- |
3437 |
- if [[ -n ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] ; then |
3438 |
- mv "${S}"/gcc-3.3.2/libstdc++-v3/config/os/uclibc "${S}"/libstdc++-v3/config/os/ || die |
3439 |
- mv "${S}"/gcc-3.3.2/libstdc++-v3/config/locale/uclibc "${S}"/libstdc++-v3/config/locale/ || die |
3440 |
- fi |
3441 |
- |
3442 |
- # misc patches that havent made it into a patch tarball yet |
3443 |
- [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch |
3444 |
- |
3445 |
- # Anything useful and objc will require libffi. Seriously. Lets just force |
3446 |
- # libffi to install with USE="objc", even though it normally only installs |
3447 |
- # if you attempt to build gcj. |
3448 |
- if ! use build && use objc && ! use gcj ; then |
3449 |
- epatch "${FILESDIR}"/3.3.4/libffi-without-libgcj.patch |
3450 |
- #epatch "${FILESDIR}"/3.4.3/libffi-nogcj-lib-path-fix.patch |
3451 |
- fi |
3452 |
-} |
3453 |
|
3454 |
diff --git a/sys-devel/gcc/gcc-3.4.6-r2.ebuild b/sys-devel/gcc/gcc-3.4.6-r2.ebuild |
3455 |
deleted file mode 100644 |
3456 |
index fb431b8..0000000 |
3457 |
--- a/sys-devel/gcc/gcc-3.4.6-r2.ebuild |
3458 |
+++ /dev/null |
3459 |
@@ -1,90 +0,0 @@ |
3460 |
-# Copyright 1999-2013 Gentoo Foundation |
3461 |
-# Distributed under the terms of the GNU General Public License v2 |
3462 |
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.4.6-r2.ebuild,v 1.33 2013/01/08 15:27:34 vapier Exp $ |
3463 |
- |
3464 |
-PATCH_VER="1.7" |
3465 |
-UCLIBC_VER="1.1" |
3466 |
-UCLIBC_GCC_VER="3.4.5" |
3467 |
-HTB_VER="1.00.1" |
3468 |
-HTB_GCC_VER="3.4.4" |
3469 |
-D_VER="0.24" |
3470 |
- |
3471 |
-inherit toolchain eutils prefix |
3472 |
- |
3473 |
-DESCRIPTION="The GNU Compiler Collection" |
3474 |
- |
3475 |
-KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux" |
3476 |
-IUSE="ip28 ip32r10k n32 n64" |
3477 |
- |
3478 |
-# we need a proper glibc version for the Scrt1.o provided to the pie-ssp specs |
3479 |
-# NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper |
3480 |
-# .eh_frame ld optimisation and symbol visibility support, but it hasnt been |
3481 |
-# well tested in gentoo on any arch other than amd64!! |
3482 |
-RDEPEND="" |
3483 |
-DEPEND="${RDEPEND} |
3484 |
- || ( ppc-aix? ( sys-devel/native-cctools ) |
3485 |
- >=sys-devel/binutils-2.14.90.0.8-r1 |
3486 |
- ) |
3487 |
- amd64? ( >=sys-devel/binutils-2.15.90.0.1.1-r1 )" |
3488 |
- |
3489 |
-src_unpack() { |
3490 |
- toolchain_src_unpack |
3491 |
- |
3492 |
- # misc patches that havent made it into a patch tarball yet |
3493 |
- [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch |
3494 |
- |
3495 |
- # Anything useful and objc will require libffi. Seriously. Lets just force |
3496 |
- # libffi to install with USE="objc", even though it normally only installs |
3497 |
- # if you attempt to build gcj. |
3498 |
- if ! use build && use objc && ! use gcj ; then |
3499 |
- epatch "${FILESDIR}"/3.4.3/libffi-without-libgcj.patch |
3500 |
- #epatch ${FILESDIR}/3.4.3/libffi-nogcj-lib-path-fix.patch |
3501 |
- fi |
3502 |
- |
3503 |
- # Fix cross-compiling |
3504 |
- epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-cross-compile.patch |
3505 |
- |
3506 |
- # http://gcc.gnu.org/PR20366 |
3507 |
- epatch "${FILESDIR}"/${P}-aix-largefiles.patch |
3508 |
- |
3509 |
- # Always behave as if -pthread were passed on AIX (#266548) |
3510 |
- epatch "${FILESDIR}"/3.4.4/aix-force-pthread.patch |
3511 |
- |
3512 |
- # Always behave as if -Wl,-brtl were passed on AIX (#213277) |
3513 |
- epatch "${FILESDIR}"/3.4.4/aix-runtimelinking.patch |
3514 |
- |
3515 |
- # AIX 5.3 TL08 binder dumps core for unknown reason (#265540), |
3516 |
- # adding -bexpfull seems to help. |
3517 |
- if [[ ${CTARGET} == *-aix5.3* ]]; then |
3518 |
- epatch "${FILESDIR}"/3.4.4/aix5300-08_ldcore.patch |
3519 |
- fi |
3520 |
- |
3521 |
- # replace nasty multilib dirs like ../lib64 that occur on --disable-multilib |
3522 |
- if use prefix; then |
3523 |
- epatch "${FILESDIR}"/3.4.4/prefix-search-dirs.patch |
3524 |
- eprefixify "${S}"/gcc/gcc.c |
3525 |
- fi |
3526 |
- |
3527 |
- [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-softfloat.patch |
3528 |
- |
3529 |
- # Arch stuff |
3530 |
- case $(tc-arch) in |
3531 |
- amd64) |
3532 |
- if is_multilib ; then |
3533 |
- sed -i -e '/GLIBCXX_IS_NATIVE=/s:false:true:' libstdc++-v3/configure || die |
3534 |
- fi |
3535 |
- ;; |
3536 |
- esac |
3537 |
-} |
3538 |
- |
3539 |
-src_compile() { |
3540 |
- toolchain_src_compile |
3541 |
- |
3542 |
- if [[ ${CTARGET} == *-aix* ]]; then |
3543 |
- # Default to -mminimal-toc on AIX, gdb does not like bigtoc (#266483). |
3544 |
- einfo "adding -mminimal-toc to specs for AIX" |
3545 |
- sed -i -e '/^\*cc1_options:$/{n; s,^,-mminimal-toc ,}' \ |
3546 |
- "${WORKDIR}"/build/gcc/specs || die "cannot add -mminimal-toc to aix specs" |
3547 |
- eend |
3548 |
- fi |
3549 |
-} |
3550 |
|
3551 |
diff --git a/sys-devel/gcc/gcc-4.2.4-r1.ebuild b/sys-devel/gcc/gcc-4.2.4-r1.ebuild |
3552 |
new file mode 100644 |
3553 |
index 0000000..f2406e7 |
3554 |
--- /dev/null |
3555 |
+++ b/sys-devel/gcc/gcc-4.2.4-r1.ebuild |
3556 |
@@ -0,0 +1,38 @@ |
3557 |
+# Copyright 1999-2013 Gentoo Foundation |
3558 |
+# Distributed under the terms of the GNU General Public License v2 |
3559 |
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.2.4-r1.ebuild,v 1.14 2013/04/12 06:47:58 ulm Exp $ |
3560 |
+ |
3561 |
+PATCH_VER="1.2" |
3562 |
+UCLIBC_VER="1.0" |
3563 |
+ |
3564 |
+inherit toolchain |
3565 |
+ |
3566 |
+DESCRIPTION="The GNU Compiler Collection" |
3567 |
+ |
3568 |
+LICENSE="GPL-3+ LGPL-2.1+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+" |
3569 |
+KEYWORDS="~alpha ~amd64 ~arm hppa ~ia64 ~m68k ~ppc ~ppc64 ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" |
3570 |
+ |
3571 |
+RDEPEND="" |
3572 |
+DEPEND="${RDEPEND} |
3573 |
+ ppc? ( >=${CATEGORY}/binutils-2.17 ) |
3574 |
+ ppc64? ( >=${CATEGORY}/binutils-2.17 ) |
3575 |
+ >=${CATEGORY}/binutils-2.15.94" |
3576 |
+ |
3577 |
+src_unpack() { |
3578 |
+ toolchain_src_unpack |
3579 |
+ |
3580 |
+ use vanilla && return 0 |
3581 |
+ |
3582 |
+ epatch "${FILESDIR}"/${PN}-4.2-rap.patch |
3583 |
+ local dlf |
3584 |
+ case $(tc-arch) in |
3585 |
+ amd64) dlf=i386/linux64.h ;; |
3586 |
+ arm) dlf=arm/linux-eabi.h ;; |
3587 |
+ x86) dlf=i386/linux.h ;; |
3588 |
+ esac |
3589 |
+ eprefixify gcc/config/${dlf} |
3590 |
+ |
3591 |
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch |
3592 |
+ |
3593 |
+ [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/4.0.2/gcc-4.0.2-softfloat.patch |
3594 |
+} |