1 |
dirtyepic 13/12/27 22:10:29 |
2 |
|
3 |
Modified: ChangeLog toolchain.eclass |
4 |
Log: |
5 |
Initial EAPI support (bug #474358). |
6 |
|
7 |
Revision Changes Path |
8 |
1.1092 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1092&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1092&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1091&r2=1.1092 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.1091 |
18 |
retrieving revision 1.1092 |
19 |
diff -u -r1.1091 -r1.1092 |
20 |
--- ChangeLog 27 Dec 2013 21:39:36 -0000 1.1091 |
21 |
+++ ChangeLog 27 Dec 2013 22:10:29 -0000 1.1092 |
22 |
@@ -1,6 +1,9 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1091 2013/12/27 21:39:36 robbat2 Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1092 2013/12/27 22:10:29 dirtyepic Exp $ |
27 |
+ |
28 |
+ 27 Dec 2013; Ryan Hill <dirtyepic@g.o> toolchain.eclass: |
29 |
+ Initial EAPI support (bug #474358). |
30 |
|
31 |
27 Dec 2013; Robin H. Johnson <robbat2@g.o> flag-o-matic.eclass: |
32 |
Per discussion with Flameeyes, make -l and -L always valid, and only warn |
33 |
|
34 |
|
35 |
|
36 |
1.610 eclass/toolchain.eclass |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.610&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?rev=1.610&content-type=text/plain |
40 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.609&r2=1.610 |
41 |
|
42 |
Index: toolchain.eclass |
43 |
=================================================================== |
44 |
RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v |
45 |
retrieving revision 1.609 |
46 |
retrieving revision 1.610 |
47 |
diff -u -r1.609 -r1.610 |
48 |
--- toolchain.eclass 23 Dec 2013 21:41:19 -0000 1.609 |
49 |
+++ toolchain.eclass 27 Dec 2013 22:10:29 -0000 1.610 |
50 |
@@ -1,6 +1,6 @@ |
51 |
# Copyright 1999-2013 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.609 2013/12/23 21:41:19 dirtyepic Exp $ |
54 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.610 2013/12/27 22:10:29 dirtyepic Exp $ |
55 |
|
56 |
# Maintainer: Toolchain Ninjas <toolchain@g.o> |
57 |
|
58 |
@@ -25,7 +25,14 @@ |
59 |
|
60 |
FEATURES=${FEATURES/multilib-strict/} |
61 |
|
62 |
-EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
63 |
+EXPORTED_FUNCTIONS="pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm" |
64 |
+case ${EAPI:-0} in |
65 |
+ 0|1) ;; |
66 |
+ 2|3) EXPORTED_FUNCTIONS+=" src_prepare src_configure" ;; |
67 |
+ 4*|5*) EXPORTED_FUNCTIONS+=" pkg_pretend src_prepare src_configure" ;; |
68 |
+ *) die "I don't speak EAPI ${EAPI}." |
69 |
+esac |
70 |
+EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
71 |
|
72 |
#---->> globals <<---- |
73 |
|
74 |
@@ -331,11 +338,11 @@ |
75 |
|
76 |
SRC_URI=$(get_gcc_src_uri) |
77 |
|
78 |
-#---->> pkg_setup <<---- |
79 |
+#---->> pkg_pretend <<---- |
80 |
|
81 |
-toolchain_pkg_setup() { |
82 |
+toolchain_pkg_pretend() { |
83 |
if [[ -n ${PRERELEASE}${SNAPSHOT} || ${PV} == *9999* ]] && |
84 |
- [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then |
85 |
+ [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then |
86 |
die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` or define it" \ |
87 |
"in your make.conf if you want to use this version." |
88 |
fi |
89 |
@@ -343,10 +350,6 @@ |
90 |
[[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && \ |
91 |
die "Sorry, this version does not support uClibc" |
92 |
|
93 |
- # we dont want to use the installed compiler's specs to build gcc! |
94 |
- unset GCC_SPECS |
95 |
- unset LANGUAGES #265283 |
96 |
- |
97 |
if ! use_if_iuse cxx ; then |
98 |
use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"' |
99 |
use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"' |
100 |
@@ -356,7 +359,19 @@ |
101 |
want_minispecs |
102 |
} |
103 |
|
104 |
-#----> src_unpack <---- |
105 |
+#---->> pkg_setup <<---- |
106 |
+ |
107 |
+toolchain_pkg_setup() { |
108 |
+ case "${EAPI:-0}" in |
109 |
+ 0|1|2|3) toolchain_pkg_pretend ;; |
110 |
+ esac |
111 |
+ |
112 |
+ # we dont want to use the installed compiler's specs to build gcc |
113 |
+ unset GCC_SPECS |
114 |
+ unset LANGUAGES #265283 |
115 |
+} |
116 |
+ |
117 |
+#---->> src_unpack <<---- |
118 |
|
119 |
toolchain_src_unpack() { |
120 |
if [[ ${PV} == *9999* ]]; then |
121 |
@@ -365,6 +380,74 @@ |
122 |
gcc_quick_unpack |
123 |
fi |
124 |
|
125 |
+ case ${EAPI:-0} in |
126 |
+ 0|1) toolchain_src_prepare ;; |
127 |
+ esac |
128 |
+} |
129 |
+ |
130 |
+gcc_quick_unpack() { |
131 |
+ pushd "${WORKDIR}" > /dev/null |
132 |
+ export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} |
133 |
+ export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} |
134 |
+ export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} |
135 |
+ export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} |
136 |
+ export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} |
137 |
+ |
138 |
+ if [[ -n ${GCC_A_FAKEIT} ]] ; then |
139 |
+ unpack ${GCC_A_FAKEIT} |
140 |
+ elif [[ -n ${PRERELEASE} ]] ; then |
141 |
+ unpack gcc-${PRERELEASE}.tar.bz2 |
142 |
+ elif [[ -n ${SNAPSHOT} ]] ; then |
143 |
+ unpack gcc-${SNAPSHOT}.tar.bz2 |
144 |
+ elif [[ ${PV} != *9999* ]] ; then |
145 |
+ unpack gcc-${GCC_RELEASE_VER}.tar.bz2 |
146 |
+ # We want branch updates to be against a release tarball |
147 |
+ if [[ -n ${BRANCH_UPDATE} ]] ; then |
148 |
+ pushd "${S}" > /dev/null |
149 |
+ epatch "${DISTDIR}"/gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 |
150 |
+ popd > /dev/null |
151 |
+ fi |
152 |
+ fi |
153 |
+ |
154 |
+ if [[ -n ${D_VER} ]] && use d ; then |
155 |
+ pushd "${S}"/gcc > /dev/null |
156 |
+ unpack gdc-${D_VER}-src.tar.bz2 |
157 |
+ cd .. |
158 |
+ ebegin "Adding support for the D language" |
159 |
+ ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log |
160 |
+ if ! eend $? ; then |
161 |
+ eerror "The D GCC package failed to apply" |
162 |
+ eerror "Please include this log file when posting a bug report:" |
163 |
+ eerror " ${T}/dgcc.log" |
164 |
+ die "failed to include the D language" |
165 |
+ fi |
166 |
+ popd > /dev/null |
167 |
+ fi |
168 |
+ |
169 |
+ [[ -n ${PATCH_VER} ]] && \ |
170 |
+ unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2 |
171 |
+ |
172 |
+ [[ -n ${UCLIBC_VER} ]] && \ |
173 |
+ unpack gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2 |
174 |
+ |
175 |
+ if want_pie ; then |
176 |
+ if [[ -n ${PIE_CORE} ]] ; then |
177 |
+ unpack ${PIE_CORE} |
178 |
+ else |
179 |
+ unpack gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2 |
180 |
+ fi |
181 |
+ [[ -n ${SPECS_VER} ]] && \ |
182 |
+ unpack gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2 |
183 |
+ fi |
184 |
+ |
185 |
+ use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" |
186 |
+ |
187 |
+ popd > /dev/null |
188 |
+} |
189 |
+ |
190 |
+#---->> src_prepare <<---- |
191 |
+ |
192 |
+toolchain_src_prepare() { |
193 |
export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}" |
194 |
cd "${S}" |
195 |
|
196 |
@@ -479,66 +562,6 @@ |
197 |
fi |
198 |
} |
199 |
|
200 |
-gcc_quick_unpack() { |
201 |
- pushd "${WORKDIR}" > /dev/null |
202 |
- export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} |
203 |
- export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} |
204 |
- export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} |
205 |
- export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} |
206 |
- export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} |
207 |
- |
208 |
- if [[ -n ${GCC_A_FAKEIT} ]] ; then |
209 |
- unpack ${GCC_A_FAKEIT} |
210 |
- elif [[ -n ${PRERELEASE} ]] ; then |
211 |
- unpack gcc-${PRERELEASE}.tar.bz2 |
212 |
- elif [[ -n ${SNAPSHOT} ]] ; then |
213 |
- unpack gcc-${SNAPSHOT}.tar.bz2 |
214 |
- elif [[ ${PV} != *9999* ]] ; then |
215 |
- unpack gcc-${GCC_RELEASE_VER}.tar.bz2 |
216 |
- # We want branch updates to be against a release tarball |
217 |
- if [[ -n ${BRANCH_UPDATE} ]] ; then |
218 |
- pushd "${S}" > /dev/null |
219 |
- epatch "${DISTDIR}"/gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 |
220 |
- popd > /dev/null |
221 |
- fi |
222 |
- fi |
223 |
- |
224 |
- if [[ -n ${D_VER} ]] && use d ; then |
225 |
- pushd "${S}"/gcc > /dev/null |
226 |
- unpack gdc-${D_VER}-src.tar.bz2 |
227 |
- cd .. |
228 |
- ebegin "Adding support for the D language" |
229 |
- ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log |
230 |
- if ! eend $? ; then |
231 |
- eerror "The D GCC package failed to apply" |
232 |
- eerror "Please include this log file when posting a bug report:" |
233 |
- eerror " ${T}/dgcc.log" |
234 |
- die "failed to include the D language" |
235 |
- fi |
236 |
- popd > /dev/null |
237 |
- fi |
238 |
- |
239 |
- [[ -n ${PATCH_VER} ]] && \ |
240 |
- unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2 |
241 |
- |
242 |
- [[ -n ${UCLIBC_VER} ]] && \ |
243 |
- unpack gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2 |
244 |
- |
245 |
- if want_pie ; then |
246 |
- if [[ -n ${PIE_CORE} ]] ; then |
247 |
- unpack ${PIE_CORE} |
248 |
- else |
249 |
- unpack gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2 |
250 |
- fi |
251 |
- [[ -n ${SPECS_VER} ]] && \ |
252 |
- unpack gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2 |
253 |
- fi |
254 |
- |
255 |
- use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" |
256 |
- |
257 |
- popd > /dev/null |
258 |
-} |
259 |
- |
260 |
guess_patch_type_in_dir() { |
261 |
[[ -n $(ls "$1"/*.bz2 2>/dev/null) ]] \ |
262 |
&& EPATCH_SUFFIX="patch.bz2" \ |
263 |
@@ -723,95 +746,25 @@ |
264 |
done |
265 |
} |
266 |
|
267 |
-gcc_do_filter_flags() { |
268 |
- strip-flags |
269 |
- |
270 |
- replace-flags -O? -O2 |
271 |
- |
272 |
- # dont want to funk ourselves |
273 |
- filter-flags '-mabi*' -m31 -m32 -m64 |
274 |
- |
275 |
- filter-flags '-frecord-gcc-switches' # 490738 |
276 |
- |
277 |
- case ${GCC_BRANCH_VER} in |
278 |
- 3.2|3.3) |
279 |
- replace-cpu-flags k8 athlon64 opteron x86-64 |
280 |
- replace-cpu-flags pentium-m pentium3m pentium3 |
281 |
- replace-cpu-flags G3 750 |
282 |
- replace-cpu-flags G4 7400 |
283 |
- replace-cpu-flags G5 7400 |
284 |
- |
285 |
- case $(tc-arch) in |
286 |
- amd64) |
287 |
- replace-cpu-flags core2 nocona |
288 |
- filter-flags '-mtune=*' |
289 |
- ;; |
290 |
- x86) |
291 |
- replace-cpu-flags core2 prescott |
292 |
- filter-flags '-mtune=*' |
293 |
- ;; |
294 |
- esac |
295 |
+#---->> src_configure <<---- |
296 |
|
297 |
- # XXX: should add a sed or something to query all supported flags |
298 |
- # from the gcc source and trim everything else ... |
299 |
- filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs |
300 |
- filter-flags -f{no-,}stack-protector{,-all} |
301 |
- filter-flags -fvisibility-inlines-hidden -fvisibility=hidden |
302 |
- ;; |
303 |
- 3.4|4.*) |
304 |
- case $(tc-arch) in |
305 |
- amd64|x86) |
306 |
- filter-flags '-mcpu=*' |
307 |
- ;; |
308 |
- alpha) |
309 |
- # https://bugs.gentoo.org/454426 |
310 |
- append-ldflags -Wl,--no-relax |
311 |
- ;; |
312 |
- sparc) |
313 |
- # temporary workaround for random ICEs reproduced by multiple users |
314 |
- # https://bugs.gentoo.org/457062 |
315 |
- [[ ${GCC_BRANCH_VER} == 4.6 || ${GCC_BRANCH_VER} == 4.7 ]] && \ |
316 |
- MAKEOPTS+=" -j1" |
317 |
- ;; |
318 |
- *-macos) |
319 |
- # http://gcc.gnu.org/PR25127 |
320 |
- [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \ |
321 |
- filter-flags '-mcpu=*' '-march=*' '-mtune=*' |
322 |
- ;; |
323 |
- esac |
324 |
- ;; |
325 |
- esac |
326 |
+toolchain_src_configure() { |
327 |
+ gcc_do_filter_flags |
328 |
|
329 |
- case ${GCC_BRANCH_VER} in |
330 |
- 4.6) |
331 |
- case $(tc-arch) in |
332 |
- amd64|x86) |
333 |
- # https://bugs.gentoo.org/411333 |
334 |
- # https://bugs.gentoo.org/466454 |
335 |
- replace-cpu-flags c3-2 pentium2 pentium3 pentium3m pentium-m i686 |
336 |
- ;; |
337 |
- esac |
338 |
- ;; |
339 |
- esac |
340 |
+ einfo "CFLAGS=\"${CFLAGS}\"" |
341 |
+ einfo "CXXFLAGS=\"${CXXFLAGS}\"" |
342 |
+ einfo "LDFLAGS=\"${LDFLAGS}\"" |
343 |
|
344 |
- strip-unsupported-flags |
345 |
- |
346 |
- if is_crosscompile ; then |
347 |
- # Set this to something sane for both native and target |
348 |
- CFLAGS="-O2 -pipe" |
349 |
- FFLAGS=${CFLAGS} |
350 |
- FCFLAGS=${CFLAGS} |
351 |
+ # Force internal zip based jar script to avoid random |
352 |
+ # issues with 3rd party jar implementations. #384291 |
353 |
+ export JAR=no |
354 |
|
355 |
- local VAR="CFLAGS_"${CTARGET//-/_} |
356 |
- CXXFLAGS=${!VAR} |
357 |
+ # For hardened gcc 4.3 piepatchset to build the hardened specs |
358 |
+ # file (build.specs) to use when building gcc. |
359 |
+ if ! tc_version_is_at_least 4.4 && want_minispecs ; then |
360 |
+ setup_minispecs_gcc_build_specs |
361 |
fi |
362 |
|
363 |
- export GCJFLAGS=${GCJFLAGS:-${CFLAGS}} |
364 |
-} |
365 |
- |
366 |
-#---->> src_configure <<---- |
367 |
- |
368 |
-gcc_do_configure() { |
369 |
local confgcc=( --host=${CHOST} ) |
370 |
|
371 |
if is_crosscompile || tc-is-cross-compiler ; then |
372 |
@@ -1232,6 +1185,109 @@ |
373 |
popd > /dev/null |
374 |
} |
375 |
|
376 |
+gcc_do_filter_flags() { |
377 |
+ strip-flags |
378 |
+ |
379 |
+ replace-flags -O? -O2 |
380 |
+ |
381 |
+ # dont want to funk ourselves |
382 |
+ filter-flags '-mabi*' -m31 -m32 -m64 |
383 |
+ |
384 |
+ filter-flags '-frecord-gcc-switches' # 490738 |
385 |
+ |
386 |
+ case ${GCC_BRANCH_VER} in |
387 |
+ 3.2|3.3) |
388 |
+ replace-cpu-flags k8 athlon64 opteron x86-64 |
389 |
+ replace-cpu-flags pentium-m pentium3m pentium3 |
390 |
+ replace-cpu-flags G3 750 |
391 |
+ replace-cpu-flags G4 7400 |
392 |
+ replace-cpu-flags G5 7400 |
393 |
+ |
394 |
+ case $(tc-arch) in |
395 |
+ amd64) |
396 |
+ replace-cpu-flags core2 nocona |
397 |
+ filter-flags '-mtune=*' |
398 |
+ ;; |
399 |
+ x86) |
400 |
+ replace-cpu-flags core2 prescott |
401 |
+ filter-flags '-mtune=*' |
402 |
+ ;; |
403 |
+ esac |
404 |
+ |
405 |
+ # XXX: should add a sed or something to query all supported flags |
406 |
+ # from the gcc source and trim everything else ... |
407 |
+ filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs |
408 |
+ filter-flags -f{no-,}stack-protector{,-all} |
409 |
+ filter-flags -fvisibility-inlines-hidden -fvisibility=hidden |
410 |
+ ;; |
411 |
+ 3.4|4.*) |
412 |
+ case $(tc-arch) in |
413 |
+ amd64|x86) |
414 |
+ filter-flags '-mcpu=*' |
415 |
+ ;; |
416 |
+ alpha) |
417 |
+ # https://bugs.gentoo.org/454426 |
418 |
+ append-ldflags -Wl,--no-relax |
419 |
+ ;; |
420 |
+ sparc) |
421 |
+ # temporary workaround for random ICEs reproduced by multiple users |
422 |
+ # https://bugs.gentoo.org/457062 |
423 |
+ [[ ${GCC_BRANCH_VER} == 4.6 || ${GCC_BRANCH_VER} == 4.7 ]] && \ |
424 |
+ MAKEOPTS+=" -j1" |
425 |
+ ;; |
426 |
+ *-macos) |
427 |
+ # http://gcc.gnu.org/PR25127 |
428 |
+ [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \ |
429 |
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' |
430 |
+ ;; |
431 |
+ esac |
432 |
+ ;; |
433 |
+ esac |
434 |
+ |
435 |
+ case ${GCC_BRANCH_VER} in |
436 |
+ 4.6) |
437 |
+ case $(tc-arch) in |
438 |
+ amd64|x86) |
439 |
+ # https://bugs.gentoo.org/411333 |
440 |
+ # https://bugs.gentoo.org/466454 |
441 |
+ replace-cpu-flags c3-2 pentium2 pentium3 pentium3m pentium-m i686 |
442 |
+ ;; |
443 |
+ esac |
444 |
+ ;; |
445 |
+ esac |
446 |
+ |
447 |
+ strip-unsupported-flags |
448 |
+ |
449 |
+ # these are set here so we have something sane at configure time |
450 |
+ if is_crosscompile ; then |
451 |
+ # Set this to something sane for both native and target |
452 |
+ CFLAGS="-O2 -pipe" |
453 |
+ FFLAGS=${CFLAGS} |
454 |
+ FCFLAGS=${CFLAGS} |
455 |
+ |
456 |
+ local VAR="CFLAGS_"${CTARGET//-/_} |
457 |
+ CXXFLAGS=${!VAR} |
458 |
+ fi |
459 |
+ |
460 |
+ export GCJFLAGS=${GCJFLAGS:-${CFLAGS}} |
461 |
+} |
462 |
+ |
463 |
+setup_minispecs_gcc_build_specs() { |
464 |
+ # Setup the "build.specs" file for gcc 4.3 to use when building. |
465 |
+ if hardened_gcc_works pie ; then |
466 |
+ cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs |
467 |
+ fi |
468 |
+ if hardened_gcc_works ssp ; then |
469 |
+ for s in ssp sspall ; do |
470 |
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
471 |
+ done |
472 |
+ fi |
473 |
+ for s in nostrict znow ; do |
474 |
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
475 |
+ done |
476 |
+ export GCC_SPECS="${WORKDIR}"/build.specs |
477 |
+} |
478 |
+ |
479 |
gcc-multilib-configure() { |
480 |
if ! is_multilib ; then |
481 |
confgcc+=( --disable-multilib ) |
482 |
@@ -1276,26 +1332,9 @@ |
483 |
#----> src_compile <---- |
484 |
|
485 |
toolchain_src_compile() { |
486 |
- gcc_do_filter_flags |
487 |
- einfo "CFLAGS=\"${CFLAGS}\"" |
488 |
- einfo "CXXFLAGS=\"${CXXFLAGS}\"" |
489 |
- einfo "LDFLAGS=\"${LDFLAGS}\"" |
490 |
- |
491 |
- # Force internal zip based jar script to avoid random |
492 |
- # issues with 3rd party jar implementations. #384291 |
493 |
- export JAR=no |
494 |
- |
495 |
- # For hardened gcc 4.3 piepatchset to build the hardened specs |
496 |
- # file (build.specs) to use when building gcc. |
497 |
- if ! tc_version_is_at_least 4.4 && want_minispecs ; then |
498 |
- setup_minispecs_gcc_build_specs |
499 |
- fi |
500 |
- # Build in a separate build tree |
501 |
- mkdir -p "${WORKDIR}"/build |
502 |
- pushd "${WORKDIR}"/build > /dev/null |
503 |
- |
504 |
- einfo "Configuring ${PN} ..." |
505 |
- gcc_do_configure |
506 |
+ case ${EAPI:-0} in |
507 |
+ 0|1) toolchain_src_configure ;; |
508 |
+ esac |
509 |
|
510 |
touch "${S}"/gcc/c-gperf.h |
511 |
|
512 |
@@ -1305,50 +1344,18 @@ |
513 |
|
514 |
einfo "Compiling ${PN} ..." |
515 |
gcc_do_make ${GCC_MAKE_TARGET} |
516 |
- |
517 |
- popd > /dev/null |
518 |
} |
519 |
|
520 |
-setup_minispecs_gcc_build_specs() { |
521 |
- # Setup the "build.specs" file for gcc 4.3 to use when building. |
522 |
- if hardened_gcc_works pie ; then |
523 |
- cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs |
524 |
- fi |
525 |
- if hardened_gcc_works ssp ; then |
526 |
- for s in ssp sspall ; do |
527 |
- cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
528 |
- done |
529 |
- fi |
530 |
- for s in nostrict znow ; do |
531 |
- cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs |
532 |
- done |
533 |
- export GCC_SPECS="${WORKDIR}"/build.specs |
534 |
-} |
535 |
- |
536 |
-# This function accepts one optional argument, the make target to be used. |
537 |
-# If ommitted, gcc_do_make will try to guess whether it should use all, |
538 |
-# profiledbootstrap, or bootstrap-lean depending on CTARGET and arch. An |
539 |
-# example of how to use this function: |
540 |
-# |
541 |
-# gcc_do_make all-target-libstdc++-v3 |
542 |
-# |
543 |
-# In addition to the target to be used, the following variables alter the |
544 |
-# behavior of this function: |
545 |
-# |
546 |
-# LDFLAGS |
547 |
-# Flags to pass to ld |
548 |
-# |
549 |
-# STAGE1_CFLAGS |
550 |
-# CFLAGS to use during stage1 of a gcc bootstrap |
551 |
-# |
552 |
-# BOOT_CFLAGS |
553 |
-# CFLAGS to use during stages 2+3 of a gcc bootstrap. |
554 |
-# |
555 |
-# Travis Tilley <lv@g.o> (04 Sep 2004) |
556 |
-# |
557 |
gcc_do_make() { |
558 |
+ # This function accepts one optional argument, the make target to be used. |
559 |
+ # If omitted, gcc_do_make will try to guess whether it should use all, |
560 |
+ # profiledbootstrap, or bootstrap-lean depending on CTARGET and arch. An |
561 |
+ # example of how to use this function: |
562 |
+ # |
563 |
+ # gcc_do_make all-target-libstdc++-v3 |
564 |
+ # |
565 |
# Set make target to $1 if passed |
566 |
- [[ -n $1 ]] && GCC_MAKE_TARGET=$1 |
567 |
+ [[ -n ${1} ]] && GCC_MAKE_TARGET=${1} |
568 |
# default target |
569 |
if is_crosscompile || tc-is-cross-compiler ; then |
570 |
# 3 stage bootstrapping doesnt quite work when you cant run the |