Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:uclibc commit in: sys-devel/gcc/, sys-devel/gcc/files/awk/, sys-devel/gcc/files/
Date: Tue, 05 Jun 2012 16:54:01
Message-Id: 1338915214.730f5104a4a4cda32c86777f4546d19dab3778cc.blueness@gentoo
1 commit: 730f5104a4a4cda32c86777f4546d19dab3778cc
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 5 16:53:34 2012 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 5 16:53:34 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=730f5104
7
8 sys-devel/gcc: tree supports full hardening for uclibc
9
10 ---
11 sys-devel/gcc/files/awk/fixlafiles.awk | 314 --------------------
12 sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la | 335 ----------------------
13 sys-devel/gcc/files/c89 | 20 --
14 sys-devel/gcc/files/c99 | 21 --
15 sys-devel/gcc/files/fix_libtool_files.sh | 72 -----
16 sys-devel/gcc/files/gcc-configure-texinfo.patch | 16 -
17 sys-devel/gcc/files/gcc-spec-env.patch | 42 ---
18 sys-devel/gcc/gcc-4.5.3-r99.ebuild | 56 ----
19 sys-devel/gcc/gcc-4.6.2-r99.ebuild | 63 ----
20 sys-devel/gcc/metadata.xml | 35 ---
21 10 files changed, 0 insertions(+), 974 deletions(-)
22
23 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk
24 deleted file mode 100644
25 index ffade96..0000000
26 --- a/sys-devel/gcc/files/awk/fixlafiles.awk
27 +++ /dev/null
28 @@ -1,314 +0,0 @@
29 -# Copyright 1999-2005 Gentoo Foundation
30 -# Distributed under the terms of the GNU General Public License v2
31 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.15 2008/02/19 05:47:29 vapier Exp $
32 -
33 -#
34 -# Helper functions
35 -#
36 -function printn(string) {
37 - printf("%s", string)
38 -}
39 -function einfo(string) {
40 - printf(" \033[32;01m*\033[0m %s\n", string)
41 -}
42 -function einfon(string) {
43 - printf(" \033[32;01m*\033[0m %s", string)
44 -}
45 -function ewarn(string) {
46 - printf(" \033[33;01m*\033[0m %s\n", string)
47 -}
48 -function ewarnn(string) {
49 - printf(" \033[33;01m*\033[0m %s", string)
50 -}
51 -function eerror(string) {
52 - printf(" \033[31;01m*\033[0m %s\n", string)
53 -}
54 -
55 -#
56 -# assert(condition, errmsg)
57 -# assert that a condition is true. Otherwise exit.
58 -#
59 -function assert(condition, string) {
60 - if (! condition) {
61 - printf("%s:%d: assertion failed: %s\n",
62 - FILENAME, FNR, string) > "/dev/stderr"
63 - _assert_exit = 1
64 - exit 1
65 - }
66 -}
67 -
68 -#
69 -# system(command, return)
70 -# wrapper that normalizes return codes ...
71 -#
72 -function dosystem(command, ret) {
73 - ret = 0
74 - ret = system(command)
75 - if (ret == 0)
76 - return 1
77 - else
78 - return 0
79 -}
80 -
81 -BEGIN {
82 - #
83 - # Get our variables from environment
84 - #
85 - OLDVER = ENVIRON["OLDVER"]
86 - OLDCHOST = ENVIRON["OLDCHOST"]
87 -
88 - if (OLDVER == "") {
89 - eerror("Could not get OLDVER!");
90 - exit 1
91 - }
92 -
93 - # Setup some sane defaults
94 - LIBCOUNT = 2
95 - HAVE_GCC34 = 0
96 - DIRLIST[1] = "/lib"
97 - DIRLIST[2] = "/usr/lib"
98 -
99 - #
100 - # Walk /etc/ld.so.conf to discover all our library paths
101 - #
102 - pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
103 - while(((pipe) | getline ldsoconf_data) > 0) {
104 - if (ldsoconf_data !~ /^[[:space:]]*#/) {
105 - if (ldsoconf_data == "") continue
106 -
107 - # Remove any trailing comments
108 - sub(/#.*$/, "", ldsoconf_data)
109 - # Remove any trailing spaces
110 - sub(/[[:space:]]+$/, "", ldsoconf_data)
111 -
112 - # If there's more than one path per line, split
113 - # it up as if they were sep lines
114 - split(ldsoconf_data, nodes, /[:,[:space:]]/)
115 -
116 - # Now add the rest from ld.so.conf
117 - for (x in nodes) {
118 - # wtf does this line do ?
119 - sub(/=.*/, "", nodes[x])
120 - # Prune trailing /
121 - sub(/\/$/, "", nodes[x])
122 -
123 - if (nodes[x] == "") continue
124 -
125 - #
126 - # Drop the directory if its a child directory of
127 - # one that was already added ...
128 - # For example, if we have:
129 - # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
130 - # We really just want to save /usr/lib /usr/libexec
131 - #
132 - CHILD = 0
133 - for (y in DIRLIST) {
134 - if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
135 - CHILD = 1
136 - break
137 - }
138 - }
139 - if (CHILD) continue
140 -
141 - DIRLIST[++LIBCOUNT] = nodes[x]
142 - }
143 - }
144 - }
145 - close(pipe)
146 -
147 - #
148 - # Get line from gcc's output containing CHOST
149 - #
150 - pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
151 - if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
152 - close(pipe)
153 -
154 - # If we fail to get the CHOST, see if we can get the CHOST
155 - # portage thinks we are using ...
156 - pipe = "/usr/bin/portageq envvar 'CHOST'"
157 - assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
158 - } else {
159 - # Check pre gcc-3.4.x versions
160 - CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
161 -
162 - if (CHOST == TMP_CHOST || CHOST == "") {
163 - # Check gcc-3.4.x or later
164 - CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
165 -
166 - if (CHOST == TMP_CHOST || CHOST == "")
167 - CHOST = ""
168 - else
169 - HAVE_GCC34 = 1
170 - }
171 - }
172 - close(pipe)
173 -
174 - if (CHOST == "") {
175 - eerror("Could not get gcc's CHOST!")
176 - exit 1
177 - }
178 -
179 - if (OLDCHOST != "")
180 - if (OLDCHOST == CHOST)
181 - OLDCHOST = ""
182 -
183 - GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
184 - GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
185 -
186 - if (HAVE_GCC34)
187 - GCCLIBPREFIX = GCCLIBPREFIX_NEW
188 - else
189 - GCCLIBPREFIX = GCCLIBPREFIX_OLD
190 -
191 - GCCLIB = GCCLIBPREFIX CHOST
192 -
193 - if (OLDCHOST != "") {
194 - OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
195 - OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
196 - }
197 -
198 - # Get current gcc's version
199 - pipe = "gcc -dumpversion"
200 - assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
201 - close(pipe)
202 -
203 - if (NEWVER == "") {
204 - eerror("Could not get gcc's version!")
205 - exit 1
206 - }
207 -
208 - # Nothing to do ?
209 - if ((OLDVER == NEWVER) && (OLDCHOST == ""))
210 - exit 0
211 -
212 - #
213 - # Ok, now let's scan for the .la files and actually fix them up
214 - #
215 - for (x = 1; x <= LIBCOUNT; x++) {
216 - # Do nothing if the target dir is gcc's internal library path
217 - if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
218 - DIRLIST[x] ~ GCCLIBPREFIX_NEW)
219 - continue
220 -
221 - einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
222 -
223 - pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
224 - while (((pipe) | getline la_files) > 0) {
225 -
226 - # Do nothing if the .la file is located in gcc's internal lib path
227 - if (la_files ~ GCCLIBPREFIX_OLD ||
228 - la_files ~ GCCLIBPREFIX_NEW)
229 - continue
230 -
231 - CHANGED = 0
232 - CHOST_CHANGED = 0
233 -
234 - # See if we need to fix the .la file
235 - while ((getline la_data < (la_files)) > 0) {
236 - if (OLDCHOST != "") {
237 - if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
238 - GCCLIB, la_data) > 0) ||
239 - (gsub(OLDGCCLIB2 "[/[:space:]]+",
240 - GCCLIB, la_data) > 0)) {
241 - CHANGED = 1
242 - CHOST_CHANGED = 1
243 - }
244 - }
245 - if (OLDVER != NEWVER) {
246 - if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
247 - GCCLIB "/" NEWVER, la_data) > 0) ||
248 - (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
249 - GCCLIB "/" NEWVER, la_data) > 0))
250 - CHANGED = 1
251 - }
252 - }
253 - close(la_files)
254 -
255 - # Do the actual changes in a second loop, as we can then
256 - # verify that CHOST_CHANGED among things is correct ...
257 - if (CHANGED) {
258 - ewarnn(" FIXING: " la_files " ...")
259 -
260 - if (CHANGED)
261 - printn("[")
262 -
263 - # Clear the temp file (removing rather than '>foo' is better
264 - # out of a security point of view?)
265 - dosystem("rm -f " la_files ".new")
266 -
267 - while ((getline la_data < (la_files)) > 0) {
268 - if (OLDCHOST != "") {
269 - tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
270 - GCCLIB "\\1", "g", la_data)
271 - tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
272 - GCCLIB "\\1", "g", tmpstr)
273 -
274 - if (la_data != tmpstr) {
275 - printn("c")
276 - la_data = tmpstr
277 - }
278 -
279 - if (CHOST_CHANGED > 0) {
280 - # We try to be careful about CHOST changes outside
281 - # the gcc library path (meaning we cannot match it
282 - # via /GCCLIBPREFIX CHOST/) ...
283 -
284 - # Catch:
285 - #
286 - # dependency_libs=' -L/usr/CHOST/{bin,lib}'
287 - #
288 - gsub("-L/usr/" OLDCHOST "/",
289 - "-L/usr/" CHOST "/", la_data)
290 - # Catch:
291 - #
292 - # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
293 - #
294 - la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
295 - "\\1/" CHOST "/", "g", la_data)
296 - }
297 - }
298 -
299 - if (OLDVER != NEWVER) {
300 - # Catch:
301 - #
302 - # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
303 - #
304 - tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
305 - GCCLIB "/" NEWVER "\\1", "g", la_data)
306 - tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
307 - GCCLIB "/" NEWVER "\\1", "g", tmpstr)
308 -
309 - if (la_data != tmpstr) {
310 - # Catch:
311 - #
312 - # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
313 - #
314 - # in cases where we have gcc34
315 - tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
316 - GCCLIBPREFIX "\\1", "g", tmpstr)
317 - tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
318 - GCCLIBPREFIX "\\1", "g", tmpstr)
319 - printn("v")
320 - la_data = tmpstr
321 - }
322 - }
323 -
324 - print la_data >> (la_files ".new")
325 - }
326 -
327 - if (CHANGED)
328 - print "]"
329 -
330 - close(la_files)
331 - close(la_files ".new")
332 -
333 - assert(dosystem("mv -f " la_files ".new " la_files),
334 - "dosystem(\"mv -f " la_files ".new " la_files "\")")
335 - }
336 - }
337 -
338 - close(pipe)
339 - }
340 -}
341 -
342 -# vim:ts=4
343
344 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
345 deleted file mode 100644
346 index 346bd16..0000000
347 --- a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
348 +++ /dev/null
349 @@ -1,335 +0,0 @@
350 -# Copyright 1999-2005 Gentoo Foundation
351 -# Distributed under the terms of the GNU General Public License v2
352 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.4 2010/03/19 23:53:07 vapier Exp $
353 -
354 -#
355 -# Helper functions
356 -#
357 -function printn(string) {
358 - printf("%s", string)
359 -}
360 -function einfo(string) {
361 - printf(" \033[32;01m*\033[0m %s\n", string)
362 -}
363 -function einfon(string) {
364 - printf(" \033[32;01m*\033[0m %s", string)
365 -}
366 -function ewarn(string) {
367 - printf(" \033[33;01m*\033[0m %s\n", string)
368 -}
369 -function ewarnn(string) {
370 - printf(" \033[33;01m*\033[0m %s", string)
371 -}
372 -function eerror(string) {
373 - printf(" \033[31;01m*\033[0m %s\n", string)
374 -}
375 -
376 -#
377 -# assert(condition, errmsg)
378 -# assert that a condition is true. Otherwise exit.
379 -#
380 -function assert(condition, string) {
381 - if (! condition) {
382 - printf("%s:%d: assertion failed: %s\n",
383 - FILENAME, FNR, string) > "/dev/stderr"
384 - _assert_exit = 1
385 - exit 1
386 - }
387 -}
388 -
389 -#
390 -# system(command, return)
391 -# wrapper that normalizes return codes ...
392 -#
393 -function dosystem(command, ret) {
394 - ret = 0
395 - ret = system(command)
396 - if (ret == 0)
397 - return 1
398 - else
399 - return 0
400 -}
401 -
402 -#
403 -# parse_ld_conf(config_file)
404 -#
405 -function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
406 - pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
407 - while(((pipe) | getline ldsoconf_data) > 0) {
408 - if (ldsoconf_data ~ /^[[:space:]]*#/)
409 - continue
410 - if (ldsoconf_data == "")
411 - continue
412 -
413 - # Handle the "include" keyword
414 - if (ldsoconf_data ~ /^include /) {
415 - sub(/^include /, "", ldsoconf_data)
416 - parse_ld_conf(ldsoconf_data)
417 - continue
418 - }
419 -
420 - # Remove any trailing comments
421 - sub(/#.*$/, "", ldsoconf_data)
422 - # Remove any trailing spaces
423 - sub(/[[:space:]]+$/, "", ldsoconf_data)
424 - # Eat duplicate slashes
425 - sub(/\/\//, "/", ldsoconf_data)
426 - # Prune trailing /
427 - sub(/\/$/, "", ldsoconf_data)
428 -
429 - #
430 - # Drop the directory if its a child directory of
431 - # one that was already added ...
432 - # For example, if we have:
433 - # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
434 - # We really just want to save /usr/lib /usr/libexec
435 - #
436 - CHILD = 0
437 - for (y in DIRLIST) {
438 - if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
439 - CHILD = 1
440 - break
441 - }
442 - }
443 - if (CHILD) continue
444 -
445 - DIRLIST[++LIBCOUNT] = ldsoconf_data
446 - }
447 - close(pipe)
448 -}
449 -
450 -BEGIN {
451 - #
452 - # Get our variables from environment
453 - #
454 - OLDVER = ENVIRON["OLDVER"]
455 - OLDCHOST = ENVIRON["OLDCHOST"]
456 -
457 - if (OLDVER == "") {
458 - eerror("Could not get OLDVER!");
459 - exit 1
460 - }
461 -
462 - # Setup some sane defaults
463 - LIBCOUNT = 2
464 - HAVE_GCC34 = 0
465 - DIRLIST[1] = "/lib"
466 - DIRLIST[2] = "/usr/lib"
467 -
468 - #
469 - # Walk /etc/ld.so.conf to discover all our library paths
470 - #
471 - parse_ld_conf("/etc/ld.so.conf")
472 -
473 - #
474 - # Get line from gcc's output containing CHOST
475 - #
476 - pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
477 - if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
478 - close(pipe)
479 -
480 - # If we fail to get the CHOST, see if we can get the CHOST
481 - # portage thinks we are using ...
482 - pipe = "/usr/bin/portageq envvar 'CHOST'"
483 - assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
484 - } else {
485 - # Check pre gcc-3.4.x versions
486 - CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
487 -
488 - if (CHOST == TMP_CHOST || CHOST == "") {
489 - # Check gcc-3.4.x or later
490 - CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
491 -
492 - if (CHOST == TMP_CHOST || CHOST == "")
493 - CHOST = ""
494 - else
495 - HAVE_GCC34 = 1
496 - }
497 - }
498 - close(pipe)
499 -
500 - if (CHOST == "") {
501 - eerror("Could not get gcc's CHOST!")
502 - exit 1
503 - }
504 -
505 - if (OLDCHOST != "")
506 - if (OLDCHOST == CHOST)
507 - OLDCHOST = ""
508 -
509 - GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
510 - GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
511 -
512 - if (HAVE_GCC34)
513 - GCCLIBPREFIX = GCCLIBPREFIX_NEW
514 - else
515 - GCCLIBPREFIX = GCCLIBPREFIX_OLD
516 -
517 - GCCLIB = GCCLIBPREFIX CHOST
518 -
519 - if (OLDCHOST != "") {
520 - OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
521 - OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
522 - }
523 -
524 - # Get current gcc's version
525 - pipe = "gcc -dumpversion"
526 - assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
527 - close(pipe)
528 -
529 - if (NEWVER == "") {
530 - eerror("Could not get gcc's version!")
531 - exit 1
532 - }
533 -
534 - # Nothing to do ?
535 - # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
536 - # replace libstdc++.la ....
537 - if ((OLDVER == "") && (OLDCHOST == ""))
538 - exit 0
539 -
540 - #
541 - # Ok, now let's scan for the .la files and actually fix them up
542 - #
543 - for (x = 1; x <= LIBCOUNT; x++) {
544 - # Do nothing if the target dir is gcc's internal library path
545 - if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
546 - DIRLIST[x] ~ GCCLIBPREFIX_NEW)
547 - continue
548 -
549 - einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
550 -
551 - pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
552 - while (((pipe) | getline la_files) > 0) {
553 -
554 - # Do nothing if the .la file is located in gcc's internal lib path
555 - if (la_files ~ GCCLIBPREFIX_OLD ||
556 - la_files ~ GCCLIBPREFIX_NEW)
557 - continue
558 -
559 - CHANGED = 0
560 - CHOST_CHANGED = 0
561 -
562 - # See if we need to fix the .la file
563 - while ((getline la_data < (la_files)) > 0) {
564 - if (OLDCHOST != "") {
565 - if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
566 - GCCLIB, la_data) > 0) ||
567 - (gsub(OLDGCCLIB2 "[/[:space:]]+",
568 - GCCLIB, la_data) > 0)) {
569 - CHANGED = 1
570 - CHOST_CHANGED = 1
571 - }
572 - }
573 - if (OLDVER != NEWVER) {
574 - if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
575 - GCCLIB "/" NEWVER, la_data) > 0) ||
576 - (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
577 - GCCLIB "/" NEWVER, la_data) > 0))
578 - CHANGED = 1
579 - }
580 - # We now check if we have libstdc++.la, as we remove the
581 - # libtool linker scripts for gcc ...
582 - # We do this last, as we only match the new paths
583 - if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
584 - "-lstdc++", la_data) > 0)
585 - CHANGED = 1
586 - }
587 - close(la_files)
588 -
589 - # Do the actual changes in a second loop, as we can then
590 - # verify that CHOST_CHANGED among things is correct ...
591 - if (CHANGED) {
592 - ewarnn(" FIXING: " la_files " ...[")
593 -
594 - # Clear the temp file (removing rather than '>foo' is better
595 - # out of a security point of view?)
596 - dosystem("rm -f " la_files ".new")
597 -
598 - while ((getline la_data < (la_files)) > 0) {
599 - if (OLDCHOST != "") {
600 - tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
601 - GCCLIB "\\1", "g", la_data)
602 - tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
603 - GCCLIB "\\1", "g", tmpstr)
604 -
605 - if (la_data != tmpstr) {
606 - printn("c")
607 - la_data = tmpstr
608 - }
609 -
610 - if (CHOST_CHANGED > 0) {
611 - # We try to be careful about CHOST changes outside
612 - # the gcc library path (meaning we cannot match it
613 - # via /GCCLIBPREFIX CHOST/) ...
614 -
615 - # Catch:
616 - #
617 - # dependency_libs=' -L/usr/CHOST/{bin,lib}'
618 - #
619 - gsub("-L/usr/" OLDCHOST "/",
620 - "-L/usr/" CHOST "/", la_data)
621 - # Catch:
622 - #
623 - # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
624 - #
625 - la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
626 - "\\1/" CHOST "/", "g", la_data)
627 - }
628 - }
629 -
630 - if (OLDVER != NEWVER) {
631 - # Catch:
632 - #
633 - # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
634 - #
635 - tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
636 - GCCLIB "/" NEWVER "\\1", "g", la_data)
637 - tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
638 - GCCLIB "/" NEWVER "\\1", "g", tmpstr)
639 -
640 - if (la_data != tmpstr) {
641 - # Catch:
642 - #
643 - # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
644 - #
645 - # in cases where we have gcc34
646 - tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
647 - GCCLIBPREFIX "\\1", "g", tmpstr)
648 - tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
649 - GCCLIBPREFIX "\\1", "g", tmpstr)
650 - printn("v")
651 - la_data = tmpstr
652 - }
653 - }
654 -
655 - # We now check if we have libstdc++.la, as we remove the
656 - # libtool linker scripts for gcc and any referencese in any
657 - # libtool linker scripts.
658 - # We do this last, as we only match the new paths
659 - tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
660 - "-lstdc++", "g", la_data);
661 - if (la_data != tmpstr) {
662 - printn("l")
663 - la_data = tmpstr
664 - }
665 -
666 - print la_data >> (la_files ".new")
667 - }
668 -
669 - if (CHANGED)
670 - print "]"
671 -
672 - close(la_files)
673 - close(la_files ".new")
674 -
675 - assert(dosystem("mv -f " la_files ".new " la_files),
676 - "dosystem(\"mv -f " la_files ".new " la_files "\")")
677 - }
678 - }
679 -
680 - close(pipe)
681 - }
682 -}
683 -
684 -# vim:ts=4
685
686 diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89
687 deleted file mode 100755
688 index cee0325..0000000
689 --- a/sys-devel/gcc/files/c89
690 +++ /dev/null
691 @@ -1,20 +0,0 @@
692 -#! /bin/sh
693 -
694 -# Call the appropriate C compiler with options to accept ANSI/ISO C
695 -# The following options are the same (as of gcc-2.95):
696 -# -ansi
697 -# -std=c89
698 -# -std=iso9899:1990
699 -
700 -for i; do
701 - case "$i" in
702 - -ansi|-std=c89|-std=iso9899:1990)
703 - ;;
704 - -std=*)
705 - echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i"
706 - exit 1
707 - ;;
708 - esac
709 -done
710 -
711 -exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@"
712
713 diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99
714 deleted file mode 100755
715 index c954209..0000000
716 --- a/sys-devel/gcc/files/c99
717 +++ /dev/null
718 @@ -1,21 +0,0 @@
719 -#! /bin/sh
720 -
721 -# Call the appropriate C compiler with options to accept ANSI/ISO C
722 -# The following options are the same (as of gcc-3.3):
723 -# -std=c99
724 -# -std=c9x
725 -# -std=iso9899:1999
726 -# -std=iso9899:199x
727 -
728 -for i; do
729 - case "$i" in
730 - -std=c9[9x]|-std=iso9899:199[9x])
731 - ;;
732 - -ansi|-std=*)
733 - echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i"
734 - exit 1
735 - ;;
736 - esac
737 -done
738 -
739 -exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"}
740
741 diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh
742 deleted file mode 100644
743 index c3a3c61..0000000
744 --- a/sys-devel/gcc/files/fix_libtool_files.sh
745 +++ /dev/null
746 @@ -1,72 +0,0 @@
747 -#!/bin/bash
748 -# Copyright 1999-2007 Gentoo Foundation
749 -# Distributed under the terms of the GNU General Public License v2
750 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.14 2007/09/06 11:00:44 uberlord Exp $
751 -
752 -usage() {
753 -cat << "USAGE_END"
754 -Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
755 -
756 - Where <old-gcc-version> is the version number of the
757 - previous gcc version. For example, if you updated to
758 - gcc-3.2.1, and you had gcc-3.2 installed, run:
759 -
760 - # fix_libtool_files.sh 3.2
761 -
762 - If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu
763 - but you now have CHOST as i686-pc-linux-gnu, run:
764 -
765 - # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
766 -
767 - Note that if only the CHOST and not the version changed, you can run
768 - it with the current version and the '--oldarch <old-CHOST>' arguments,
769 - and it will do the expected:
770 -
771 - # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
772 -
773 -USAGE_END
774 - exit 1
775 -}
776 -
777 -if [[ $2 != "--oldarch" && $# -ne 1 ]] || \
778 - [[ $2 == "--oldarch" && $# -ne 3 ]]
779 -then
780 - usage
781 -fi
782 -
783 -ARGV1=$1
784 -ARGV2=$2
785 -ARGV3=$3
786 -
787 -source /etc/profile || exit 1
788 -source /etc/init.d/functions.sh || exit 1
789 -
790 -if [[ ${EUID} -ne 0 ]] ; then
791 - eerror "${0##*/}: Must be root."
792 - exit 1
793 -fi
794 -
795 -# make sure the files come out sane
796 -umask 0022
797 -
798 -if [[ ${ARGV2} == "--oldarch" ]] && [[ -n ${ARGV3} ]] ; then
799 - OLDCHOST=${ARGV3}
800 -else
801 - OLDCHOST=
802 -fi
803 -
804 -AWKDIR="/lib/rcscripts/awk"
805 -
806 -if [[ ! -r ${AWKDIR}/fixlafiles.awk ]] ; then
807 - eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
808 - exit 1
809 -fi
810 -
811 -OLDVER=${ARGV1}
812 -
813 -export OLDVER OLDCHOST
814 -
815 -einfo "Scanning libtool files for hardcoded gcc library paths..."
816 -gawk -f "${AWKDIR}/fixlafiles.awk"
817 -
818 -# vim:ts=4
819
820 diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
821 deleted file mode 100644
822 index ddc098d..0000000
823 --- a/sys-devel/gcc/files/gcc-configure-texinfo.patch
824 +++ /dev/null
825 @@ -1,16 +0,0 @@
826 -Chances are quite good that the installed makeinfo is sufficient.
827 -So ignore false positives where the makeinfo installed is so new
828 -that it violates the cheesy version grep.
829 -
830 -http://bugs.gentoo.org/198182
831 -
832 ---- configure
833 -+++ configure
834 -@@ -3573,6 +3573,6 @@
835 - :
836 - else
837 -- MAKEINFO="$MISSING makeinfo"
838 -+ :
839 - fi
840 - ;;
841 -
842
843 diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
844 deleted file mode 100644
845 index 57e7567..0000000
846 --- a/sys-devel/gcc/files/gcc-spec-env.patch
847 +++ /dev/null
848 @@ -1,42 +0,0 @@
849 - Add support for external spec file via the GCC_SPECS env var. This
850 - allows us to easily control pie/ssp defaults with gcc-config profiles.
851 -
852 - Original patch by Rob Holland
853 - Extended to support multiple entries separated by ':' by Kevin F. Quinn
854 - Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
855 -
856 ---- gcc-4/gcc/gcc.c
857 -+++ gcc-4/gcc/gcc.c
858 -@@ -6482,6 +6482,32 @@
859 -
860 - /* Process any user specified specs in the order given on the command
861 - line. */
862 -+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
863 -+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
864 -+ * each spec listed, the string is overwritten at token boundaries
865 -+ * (':') with '\0', an effect of strtok_r().
866 -+ */
867 -+ specs_file = getenv ("GCC_SPECS");
868 -+ if (specs_file && (strlen(specs_file) > 0))
869 -+ {
870 -+ char *spec, *saveptr;
871 -+ for (spec=strtok_r(specs_file,":",&saveptr);
872 -+ spec!=NULL;
873 -+ spec=strtok_r(NULL,":",&saveptr))
874 -+ {
875 -+ struct user_specs *user = (struct user_specs *)
876 -+ xmalloc (sizeof (struct user_specs));
877 -+
878 -+ user->next = (struct user_specs *) 0;
879 -+ user->filename = spec;
880 -+ if (user_specs_tail)
881 -+ user_specs_tail->next = user;
882 -+ else
883 -+ user_specs_head = user;
884 -+ user_specs_tail = user;
885 -+ }
886 -+ }
887 -+#endif
888 - for (uptr = user_specs_head; uptr; uptr = uptr->next)
889 - {
890 - char *filename = find_a_file (&startfile_prefixes, uptr->filename,
891
892 diff --git a/sys-devel/gcc/gcc-4.5.3-r99.ebuild b/sys-devel/gcc/gcc-4.5.3-r99.ebuild
893 deleted file mode 100644
894 index f5e5688..0000000
895 --- a/sys-devel/gcc/gcc-4.5.3-r99.ebuild
896 +++ /dev/null
897 @@ -1,56 +0,0 @@
898 -# Copyright 1999-2011 Gentoo Foundation
899 -# Distributed under the terms of the GNU General Public License v2
900 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.5.3-r1.ebuild,v 1.9 2011/11/09 19:22:57 vapier Exp $
901 -
902 -PATCH_VER="1.0"
903 -UCLIBC_VER="1.0"
904 -
905 -# Hardened gcc 4 stuff
906 -PIE_VER="0.4.7"
907 -SPECS_VER="0.2.0"
908 -SPECS_GCC_VER="4.4.3"
909 -# arch/libc configurations known to be stable with {PIE,SSP}-by-default
910 -PIE_GLIBC_STABLE="x86 amd64 mips"
911 -PIE_UCLIBC_STABLE="x86 amd64 mips"
912 -SSP_STABLE="amd64 x86 mips"
913 -SSP_UCLIBC_STABLE="amd64 x86 mips"
914 -#end Hardened stuff
915 -
916 -inherit toolchain
917 -
918 -DESCRIPTION="The GNU Compiler Collection"
919 -
920 -LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2"
921 -KEYWORDS="amd64 mips x86"
922 -
923 -RDEPEND=""
924 -DEPEND="${RDEPEND}
925 - elibc_glibc? ( >=sys-libs/glibc-2.8 )
926 - amd64? ( multilib? ( gcj? ( app-emulation/emul-linux-x86-xlibs ) ) )
927 - ppc? ( >=${CATEGORY}/binutils-2.17 )
928 - ppc64? ( >=${CATEGORY}/binutils-2.17 )
929 - >=${CATEGORY}/binutils-2.15.94"
930 -if [[ ${CATEGORY} != cross-* ]] ; then
931 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
932 -fi
933 -
934 -src_unpack() {
935 - toolchain_src_unpack
936 -
937 - use vanilla && return 0
938 -
939 - sed -i 's/use_fixproto=yes/:/' gcc/config.gcc #PR33200
940 -
941 - [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
942 -}
943 -
944 -pkg_setup() {
945 - toolchain_pkg_setup
946 -
947 - if use lto ; then
948 - ewarn
949 - ewarn "LTO support is still experimental and unstable."
950 - ewarn "Any bugs resulting from the use of LTO will not be fixed."
951 - ewarn
952 - fi
953 -}
954
955 diff --git a/sys-devel/gcc/gcc-4.6.2-r99.ebuild b/sys-devel/gcc/gcc-4.6.2-r99.ebuild
956 deleted file mode 100644
957 index bd92aab..0000000
958 --- a/sys-devel/gcc/gcc-4.6.2-r99.ebuild
959 +++ /dev/null
960 @@ -1,63 +0,0 @@
961 -# Copyright 1999-2011 Gentoo Foundation
962 -# Distributed under the terms of the GNU General Public License v2
963 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.6.2.ebuild,v 1.7 2011/12/08 18:14:25 vapier Exp $
964 -
965 -PATCH_VER="1.3"
966 -UCLIBC_VER="1.0"
967 -
968 -# Hardened gcc 4 stuff
969 -PIE_VER="0.5.1"
970 -SPECS_VER="0.2.0"
971 -SPECS_GCC_VER="4.4.3"
972 -# arch/libc configurations known to be stable with {PIE,SSP}-by-default
973 -PIE_GLIBC_STABLE="amd64 mips ppc x86"
974 -PIE_UCLIBC_STABLE="amd64 mips ppc x86"
975 -SSP_STABLE="amd64 mips ppc x86"
976 -SSP_UCLIBC_STABLE="amd64 mips ppc x86"
977 -#end Hardened stuff
978 -
979 -inherit toolchain
980 -
981 -DESCRIPTION="The GNU Compiler Collection"
982 -
983 -LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2"
984 -KEYWORDS="amd64 mips ppc ~x86"
985 -
986 -RDEPEND=""
987 -DEPEND="${RDEPEND}
988 - elibc_glibc? ( >=sys-libs/glibc-2.8 )
989 - amd64? ( multilib? ( gcj? ( app-emulation/emul-linux-x86-xlibs ) ) )
990 - >=${CATEGORY}/binutils-2.18"
991 -PDEPEND="go? ( >=sys-devel/gcc-config-1.5 )"
992 -
993 -if [[ ${CATEGORY} != cross-* ]] ; then
994 - PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
995 -fi
996 -
997 -src_unpack() {
998 - if has_version '<sys-libs/glibc-2.12' ; then
999 - ewarn "Your host glibc is too old; disabling automatic fortify."
1000 - ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
1001 - EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
1002 - fi
1003 -
1004 - # drop the x32 stuff once 4.7 goes stable
1005 - case ${CHOST} in
1006 - x86_64*) has x32 $(get_all_abis) || EPATCH_EXCLUDE+=" 80_all_gcc-4.6-x32.patch" ;;
1007 - esac
1008 -
1009 - toolchain_src_unpack
1010 -
1011 - use vanilla && return 0
1012 -
1013 - [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
1014 -}
1015 -
1016 -pkg_setup() {
1017 - toolchain_pkg_setup
1018 -
1019 - ewarn
1020 - ewarn "LTO support is still experimental and unstable."
1021 - ewarn "Any bugs resulting from the use of LTO will not be fixed."
1022 - ewarn
1023 -}
1024
1025 diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
1026 deleted file mode 100644
1027 index 4980ae5..0000000
1028 --- a/sys-devel/gcc/metadata.xml
1029 +++ /dev/null
1030 @@ -1,35 +0,0 @@
1031 -<?xml version="1.0" encoding="UTF-8"?>
1032 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1033 -<pkgmetadata>
1034 - <herd>toolchain</herd>
1035 - <use>
1036 - <flag name="d">Enable support for the D programming language</flag>
1037 - <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
1038 - in gcc (Warning: significantly increases compile time!)</flag>
1039 - <flag name="go">Build the GCC Go language frontend.</flag>
1040 - <flag name="graphite">Add support for the framework for loop
1041 - optimizations based on a polyhedral intermediate representation</flag>
1042 - <flag name="gtk">Useful only when building GCJ, this enables Abstract Window Toolkit
1043 - (AWT) peer support on top of GTK+</flag>
1044 - <flag name="ip28">Enable building a compiler capable of building a kernel
1045 - for SGI Indigo2 Impact R10000 (IP28)</flag>
1046 - <flag name="ip32r10k">Enable building a compiler capable of building an
1047 - experimental kernel for SGI O2 w/ R1x000 CPUs (IP32)</flag>
1048 - <flag name="libffi">Build the portable foreign function interface library</flag>
1049 - <flag name="libssp">Build SSP support into a dedicated library rather than use the
1050 - code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
1051 - <flag name="lto">Add support for link-time optimizations (unsupported, use
1052 - at your own risk).</flag>
1053 - <flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>
1054 - <flag name="multislot">Allow for SLOTs to include minor version (3.3.4
1055 - instead of just 3.3)</flag>
1056 - <flag name="n32">Enable n32 ABI support on mips</flag>
1057 - <flag name="n64">Enable n64 ABI support on mips</flag>
1058 - <flag name="nopie">Disable PIE support (NOT FOR GENERAL USE)</flag>
1059 - <flag name="nossp">Disable SSP support (NOT FOR GENERAL USE)</flag>
1060 - <flag name="objc">Build support for the Objective C code language</flag>
1061 - <flag name="objc++">Build support for the Objective C++ language</flag>
1062 - <flag name="objc-gc">Build support for the Objective C code language Garbage
1063 - Collector</flag>
1064 - </use>
1065 -</pkgmetadata>