Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/riscv:master commit in: sys-devel/gcc/files/, sys-devel/gcc/, sys-devel/gcc/files/awk/
Date: Sun, 28 Apr 2019 10:00:22
Message-Id: 1556445550.f8242e6e0e9cdc3d92df08fcdc168021c11203ff.dilfridge@gentoo
1 commit: f8242e6e0e9cdc3d92df08fcdc168021c11203ff
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 28 09:59:10 2019 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 28 09:59:10 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/riscv.git/commit/?id=f8242e6e
7
8 sys-devel/gcc: Copy unmodified gcc-8.3.0-r1 from main tree
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/gcc/Manifest | 2 +
14 sys-devel/gcc/files/awk/fixlafiles.awk | 313 +++++++++++++++++++++
15 sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la | 334 +++++++++++++++++++++++
16 sys-devel/gcc/files/c89 | 20 ++
17 sys-devel/gcc/files/c99 | 21 ++
18 sys-devel/gcc/files/fix_libtool_files.sh | 66 +++++
19 sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch | 66 +++++
20 sys-devel/gcc/files/gcc-configure-LANG.patch | 64 +++++
21 sys-devel/gcc/files/gcc-configure-texinfo.patch | 16 ++
22 sys-devel/gcc/files/gcc-spec-env-r1.patch | 87 ++++++
23 sys-devel/gcc/files/gcc-spec-env.patch | 42 +++
24 sys-devel/gcc/gcc-8.3.0-r1.ebuild | 19 ++
25 sys-devel/gcc/metadata.xml | 33 +++
26 13 files changed, 1083 insertions(+)
27
28 diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
29 new file mode 100644
30 index 0000000..179a22a
31 --- /dev/null
32 +++ b/sys-devel/gcc/Manifest
33 @@ -0,0 +1,2 @@
34 +DIST gcc-8.3.0-patches-1.1.tar.bz2 14430 BLAKE2B c702fbdb18c3c952cdb9adead3a193c948d78a4cb4b041beaa51a06b907fd357bb10a2f8d47d55978ebb08590fd7c9a6ec3df8e7a007173e20a55d251d947c72 SHA512 9e2284f597bab6f78ca24ead358b1f50495aefc9e0a416ace24c94723db7b2fb82d48426876138d00c82bcaf9c2f8b4674885988448dcf16dee1b764face9af4
35 +DIST gcc-8.3.0.tar.xz 63694700 BLAKE2B 71df2ff5bd6874d57519c2e9af6b22152c8c4d7fab906a5f427b41bc4e8e742127592a8684120d9d3c9ce6241439531850be08ec0a4f29dbfdee95435655fdca SHA512 1811337ae3add9680cec64968a2509d085b6dc5b6783fc1e8c295e3e47416196fd1a3ad8dfe7e10be2276b4f62c357659ce2902f239f60a8648548231b4b5802
36
37 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk
38 new file mode 100644
39 index 0000000..ee71d15
40 --- /dev/null
41 +++ b/sys-devel/gcc/files/awk/fixlafiles.awk
42 @@ -0,0 +1,313 @@
43 +# Copyright 1999-2019 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +#
47 +# Helper functions
48 +#
49 +function printn(string) {
50 + printf("%s", string)
51 +}
52 +function einfo(string) {
53 + printf(" \033[32;01m*\033[0m %s\n", string)
54 +}
55 +function einfon(string) {
56 + printf(" \033[32;01m*\033[0m %s", string)
57 +}
58 +function ewarn(string) {
59 + printf(" \033[33;01m*\033[0m %s\n", string)
60 +}
61 +function ewarnn(string) {
62 + printf(" \033[33;01m*\033[0m %s", string)
63 +}
64 +function eerror(string) {
65 + printf(" \033[31;01m*\033[0m %s\n", string)
66 +}
67 +
68 +#
69 +# assert(condition, errmsg)
70 +# assert that a condition is true. Otherwise exit.
71 +#
72 +function assert(condition, string) {
73 + if (! condition) {
74 + printf("%s:%d: assertion failed: %s\n",
75 + FILENAME, FNR, string) > "/dev/stderr"
76 + _assert_exit = 1
77 + exit 1
78 + }
79 +}
80 +
81 +#
82 +# system(command, return)
83 +# wrapper that normalizes return codes ...
84 +#
85 +function dosystem(command, ret) {
86 + ret = 0
87 + ret = system(command)
88 + if (ret == 0)
89 + return 1
90 + else
91 + return 0
92 +}
93 +
94 +BEGIN {
95 + #
96 + # Get our variables from environment
97 + #
98 + OLDVER = ENVIRON["OLDVER"]
99 + OLDCHOST = ENVIRON["OLDCHOST"]
100 +
101 + if (OLDVER == "") {
102 + eerror("Could not get OLDVER!");
103 + exit 1
104 + }
105 +
106 + # Setup some sane defaults
107 + LIBCOUNT = 2
108 + HAVE_GCC34 = 0
109 + DIRLIST[1] = "/lib"
110 + DIRLIST[2] = "/usr/lib"
111 +
112 + #
113 + # Walk /etc/ld.so.conf to discover all our library paths
114 + #
115 + pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
116 + while(((pipe) | getline ldsoconf_data) > 0) {
117 + if (ldsoconf_data !~ /^[[:space:]]*#/) {
118 + if (ldsoconf_data == "") continue
119 +
120 + # Remove any trailing comments
121 + sub(/#.*$/, "", ldsoconf_data)
122 + # Remove any trailing spaces
123 + sub(/[[:space:]]+$/, "", ldsoconf_data)
124 +
125 + # If there's more than one path per line, split
126 + # it up as if they were sep lines
127 + split(ldsoconf_data, nodes, /[:,[:space:]]/)
128 +
129 + # Now add the rest from ld.so.conf
130 + for (x in nodes) {
131 + # wtf does this line do ?
132 + sub(/=.*/, "", nodes[x])
133 + # Prune trailing /
134 + sub(/\/$/, "", nodes[x])
135 +
136 + if (nodes[x] == "") continue
137 +
138 + #
139 + # Drop the directory if its a child directory of
140 + # one that was already added ...
141 + # For example, if we have:
142 + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
143 + # We really just want to save /usr/lib /usr/libexec
144 + #
145 + CHILD = 0
146 + for (y in DIRLIST) {
147 + if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
148 + CHILD = 1
149 + break
150 + }
151 + }
152 + if (CHILD) continue
153 +
154 + DIRLIST[++LIBCOUNT] = nodes[x]
155 + }
156 + }
157 + }
158 + close(pipe)
159 +
160 + #
161 + # Get line from gcc's output containing CHOST
162 + #
163 + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
164 + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
165 + close(pipe)
166 +
167 + # If we fail to get the CHOST, see if we can get the CHOST
168 + # portage thinks we are using ...
169 + pipe = "/usr/bin/portageq envvar 'CHOST'"
170 + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
171 + } else {
172 + # Check pre gcc-3.4.x versions
173 + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
174 +
175 + if (CHOST == TMP_CHOST || CHOST == "") {
176 + # Check gcc-3.4.x or later
177 + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
178 +
179 + if (CHOST == TMP_CHOST || CHOST == "")
180 + CHOST = ""
181 + else
182 + HAVE_GCC34 = 1
183 + }
184 + }
185 + close(pipe)
186 +
187 + if (CHOST == "") {
188 + eerror("Could not get gcc's CHOST!")
189 + exit 1
190 + }
191 +
192 + if (OLDCHOST != "")
193 + if (OLDCHOST == CHOST)
194 + OLDCHOST = ""
195 +
196 + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
197 + GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
198 +
199 + if (HAVE_GCC34)
200 + GCCLIBPREFIX = GCCLIBPREFIX_NEW
201 + else
202 + GCCLIBPREFIX = GCCLIBPREFIX_OLD
203 +
204 + GCCLIB = GCCLIBPREFIX CHOST
205 +
206 + if (OLDCHOST != "") {
207 + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
208 + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
209 + }
210 +
211 + # Get current gcc's version
212 + pipe = "gcc -dumpversion"
213 + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
214 + close(pipe)
215 +
216 + if (NEWVER == "") {
217 + eerror("Could not get gcc's version!")
218 + exit 1
219 + }
220 +
221 + # Nothing to do ?
222 + if ((OLDVER == NEWVER) && (OLDCHOST == ""))
223 + exit 0
224 +
225 + #
226 + # Ok, now let's scan for the .la files and actually fix them up
227 + #
228 + for (x = 1; x <= LIBCOUNT; x++) {
229 + # Do nothing if the target dir is gcc's internal library path
230 + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
231 + DIRLIST[x] ~ GCCLIBPREFIX_NEW)
232 + continue
233 +
234 + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
235 +
236 + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
237 + while (((pipe) | getline la_files) > 0) {
238 +
239 + # Do nothing if the .la file is located in gcc's internal lib path
240 + if (la_files ~ GCCLIBPREFIX_OLD ||
241 + la_files ~ GCCLIBPREFIX_NEW)
242 + continue
243 +
244 + CHANGED = 0
245 + CHOST_CHANGED = 0
246 +
247 + # See if we need to fix the .la file
248 + while ((getline la_data < (la_files)) > 0) {
249 + if (OLDCHOST != "") {
250 + if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
251 + GCCLIB, la_data) > 0) ||
252 + (gsub(OLDGCCLIB2 "[/[:space:]]+",
253 + GCCLIB, la_data) > 0)) {
254 + CHANGED = 1
255 + CHOST_CHANGED = 1
256 + }
257 + }
258 + if (OLDVER != NEWVER) {
259 + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
260 + GCCLIB "/" NEWVER, la_data) > 0) ||
261 + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
262 + GCCLIB "/" NEWVER, la_data) > 0))
263 + CHANGED = 1
264 + }
265 + }
266 + close(la_files)
267 +
268 + # Do the actual changes in a second loop, as we can then
269 + # verify that CHOST_CHANGED among things is correct ...
270 + if (CHANGED) {
271 + ewarnn(" FIXING: " la_files " ...")
272 +
273 + if (CHANGED)
274 + printn("[")
275 +
276 + # Clear the temp file (removing rather than '>foo' is better
277 + # out of a security point of view?)
278 + dosystem("rm -f " la_files ".new")
279 +
280 + while ((getline la_data < (la_files)) > 0) {
281 + if (OLDCHOST != "") {
282 + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
283 + GCCLIB "\\1", "g", la_data)
284 + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
285 + GCCLIB "\\1", "g", tmpstr)
286 +
287 + if (la_data != tmpstr) {
288 + printn("c")
289 + la_data = tmpstr
290 + }
291 +
292 + if (CHOST_CHANGED > 0) {
293 + # We try to be careful about CHOST changes outside
294 + # the gcc library path (meaning we cannot match it
295 + # via /GCCLIBPREFIX CHOST/) ...
296 +
297 + # Catch:
298 + #
299 + # dependency_libs=' -L/usr/CHOST/{bin,lib}'
300 + #
301 + gsub("-L/usr/" OLDCHOST "/",
302 + "-L/usr/" CHOST "/", la_data)
303 + # Catch:
304 + #
305 + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
306 + #
307 + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
308 + "\\1/" CHOST "/", "g", la_data)
309 + }
310 + }
311 +
312 + if (OLDVER != NEWVER) {
313 + # Catch:
314 + #
315 + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
316 + #
317 + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
318 + GCCLIB "/" NEWVER "\\1", "g", la_data)
319 + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
320 + GCCLIB "/" NEWVER "\\1", "g", tmpstr)
321 +
322 + if (la_data != tmpstr) {
323 + # Catch:
324 + #
325 + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
326 + #
327 + # in cases where we have gcc34
328 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
329 + GCCLIBPREFIX "\\1", "g", tmpstr)
330 + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
331 + GCCLIBPREFIX "\\1", "g", tmpstr)
332 + printn("v")
333 + la_data = tmpstr
334 + }
335 + }
336 +
337 + print la_data >> (la_files ".new")
338 + }
339 +
340 + if (CHANGED)
341 + print "]"
342 +
343 + close(la_files)
344 + close(la_files ".new")
345 +
346 + assert(dosystem("mv -f " la_files ".new " la_files),
347 + "dosystem(\"mv -f " la_files ".new " la_files "\")")
348 + }
349 + }
350 +
351 + close(pipe)
352 + }
353 +}
354 +
355 +# vim:ts=4
356
357 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
358 new file mode 100644
359 index 0000000..4265a54
360 --- /dev/null
361 +++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
362 @@ -0,0 +1,334 @@
363 +# Copyright 1999-2019 Gentoo Authors
364 +# Distributed under the terms of the GNU General Public License v2
365 +
366 +#
367 +# Helper functions
368 +#
369 +function printn(string) {
370 + printf("%s", string)
371 +}
372 +function einfo(string) {
373 + printf(" \033[32;01m*\033[0m %s\n", string)
374 +}
375 +function einfon(string) {
376 + printf(" \033[32;01m*\033[0m %s", string)
377 +}
378 +function ewarn(string) {
379 + printf(" \033[33;01m*\033[0m %s\n", string)
380 +}
381 +function ewarnn(string) {
382 + printf(" \033[33;01m*\033[0m %s", string)
383 +}
384 +function eerror(string) {
385 + printf(" \033[31;01m*\033[0m %s\n", string)
386 +}
387 +
388 +#
389 +# assert(condition, errmsg)
390 +# assert that a condition is true. Otherwise exit.
391 +#
392 +function assert(condition, string) {
393 + if (! condition) {
394 + printf("%s:%d: assertion failed: %s\n",
395 + FILENAME, FNR, string) > "/dev/stderr"
396 + _assert_exit = 1
397 + exit 1
398 + }
399 +}
400 +
401 +#
402 +# system(command, return)
403 +# wrapper that normalizes return codes ...
404 +#
405 +function dosystem(command, ret) {
406 + ret = 0
407 + ret = system(command)
408 + if (ret == 0)
409 + return 1
410 + else
411 + return 0
412 +}
413 +
414 +#
415 +# parse_ld_conf(config_file)
416 +#
417 +function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
418 + pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
419 + while(((pipe) | getline ldsoconf_data) > 0) {
420 + if (ldsoconf_data ~ /^[[:space:]]*#/)
421 + continue
422 + if (ldsoconf_data == "")
423 + continue
424 +
425 + # Handle the "include" keyword
426 + if (ldsoconf_data ~ /^include /) {
427 + sub(/^include /, "", ldsoconf_data)
428 + parse_ld_conf(ldsoconf_data)
429 + continue
430 + }
431 +
432 + # Remove any trailing comments
433 + sub(/#.*$/, "", ldsoconf_data)
434 + # Remove any trailing spaces
435 + sub(/[[:space:]]+$/, "", ldsoconf_data)
436 + # Eat duplicate slashes
437 + sub(/\/\//, "/", ldsoconf_data)
438 + # Prune trailing /
439 + sub(/\/$/, "", ldsoconf_data)
440 +
441 + #
442 + # Drop the directory if its a child directory of
443 + # one that was already added ...
444 + # For example, if we have:
445 + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
446 + # We really just want to save /usr/lib /usr/libexec
447 + #
448 + CHILD = 0
449 + for (y in DIRLIST) {
450 + if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
451 + CHILD = 1
452 + break
453 + }
454 + }
455 + if (CHILD) continue
456 +
457 + DIRLIST[++LIBCOUNT] = ldsoconf_data
458 + }
459 + close(pipe)
460 +}
461 +
462 +BEGIN {
463 + #
464 + # Get our variables from environment
465 + #
466 + OLDVER = ENVIRON["OLDVER"]
467 + OLDCHOST = ENVIRON["OLDCHOST"]
468 +
469 + if (OLDVER == "") {
470 + eerror("Could not get OLDVER!");
471 + exit 1
472 + }
473 +
474 + # Setup some sane defaults
475 + LIBCOUNT = 2
476 + HAVE_GCC34 = 0
477 + DIRLIST[1] = "/lib"
478 + DIRLIST[2] = "/usr/lib"
479 +
480 + #
481 + # Walk /etc/ld.so.conf to discover all our library paths
482 + #
483 + parse_ld_conf("/etc/ld.so.conf")
484 +
485 + #
486 + # Get line from gcc's output containing CHOST
487 + #
488 + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
489 + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
490 + close(pipe)
491 +
492 + # If we fail to get the CHOST, see if we can get the CHOST
493 + # portage thinks we are using ...
494 + pipe = "/usr/bin/portageq envvar 'CHOST'"
495 + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
496 + } else {
497 + # Check pre gcc-3.4.x versions
498 + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
499 +
500 + if (CHOST == TMP_CHOST || CHOST == "") {
501 + # Check gcc-3.4.x or later
502 + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
503 +
504 + if (CHOST == TMP_CHOST || CHOST == "")
505 + CHOST = ""
506 + else
507 + HAVE_GCC34 = 1
508 + }
509 + }
510 + close(pipe)
511 +
512 + if (CHOST == "") {
513 + eerror("Could not get gcc's CHOST!")
514 + exit 1
515 + }
516 +
517 + if (OLDCHOST != "")
518 + if (OLDCHOST == CHOST)
519 + OLDCHOST = ""
520 +
521 + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
522 + GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
523 +
524 + if (HAVE_GCC34)
525 + GCCLIBPREFIX = GCCLIBPREFIX_NEW
526 + else
527 + GCCLIBPREFIX = GCCLIBPREFIX_OLD
528 +
529 + GCCLIB = GCCLIBPREFIX CHOST
530 +
531 + if (OLDCHOST != "") {
532 + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
533 + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
534 + }
535 +
536 + # Get current gcc's version
537 + pipe = "gcc -dumpversion"
538 + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
539 + close(pipe)
540 +
541 + if (NEWVER == "") {
542 + eerror("Could not get gcc's version!")
543 + exit 1
544 + }
545 +
546 + # Nothing to do ?
547 + # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
548 + # replace libstdc++.la ....
549 + if ((OLDVER == "") && (OLDCHOST == ""))
550 + exit 0
551 +
552 + #
553 + # Ok, now let's scan for the .la files and actually fix them up
554 + #
555 + for (x = 1; x <= LIBCOUNT; x++) {
556 + # Do nothing if the target dir is gcc's internal library path
557 + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
558 + DIRLIST[x] ~ GCCLIBPREFIX_NEW)
559 + continue
560 +
561 + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
562 +
563 + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
564 + while (((pipe) | getline la_files) > 0) {
565 +
566 + # Do nothing if the .la file is located in gcc's internal lib path
567 + if (la_files ~ GCCLIBPREFIX_OLD ||
568 + la_files ~ GCCLIBPREFIX_NEW)
569 + continue
570 +
571 + CHANGED = 0
572 + CHOST_CHANGED = 0
573 +
574 + # See if we need to fix the .la file
575 + while ((getline la_data < (la_files)) > 0) {
576 + if (OLDCHOST != "") {
577 + if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
578 + GCCLIB, la_data) > 0) ||
579 + (gsub(OLDGCCLIB2 "[/[:space:]]+",
580 + GCCLIB, la_data) > 0)) {
581 + CHANGED = 1
582 + CHOST_CHANGED = 1
583 + }
584 + }
585 + if (OLDVER != NEWVER) {
586 + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
587 + GCCLIB "/" NEWVER, la_data) > 0) ||
588 + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
589 + GCCLIB "/" NEWVER, la_data) > 0))
590 + CHANGED = 1
591 + }
592 + # We now check if we have libstdc++.la, as we remove the
593 + # libtool linker scripts for gcc ...
594 + # We do this last, as we only match the new paths
595 + if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
596 + "-lstdc++", la_data) > 0)
597 + CHANGED = 1
598 + }
599 + close(la_files)
600 +
601 + # Do the actual changes in a second loop, as we can then
602 + # verify that CHOST_CHANGED among things is correct ...
603 + if (CHANGED) {
604 + ewarnn(" FIXING: " la_files " ...[")
605 +
606 + # Clear the temp file (removing rather than '>foo' is better
607 + # out of a security point of view?)
608 + dosystem("rm -f " la_files ".new")
609 +
610 + while ((getline la_data < (la_files)) > 0) {
611 + if (OLDCHOST != "") {
612 + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
613 + GCCLIB "\\1", "g", la_data)
614 + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
615 + GCCLIB "\\1", "g", tmpstr)
616 +
617 + if (la_data != tmpstr) {
618 + printn("c")
619 + la_data = tmpstr
620 + }
621 +
622 + if (CHOST_CHANGED > 0) {
623 + # We try to be careful about CHOST changes outside
624 + # the gcc library path (meaning we cannot match it
625 + # via /GCCLIBPREFIX CHOST/) ...
626 +
627 + # Catch:
628 + #
629 + # dependency_libs=' -L/usr/CHOST/{bin,lib}'
630 + #
631 + gsub("-L/usr/" OLDCHOST "/",
632 + "-L/usr/" CHOST "/", la_data)
633 + # Catch:
634 + #
635 + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
636 + #
637 + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
638 + "\\1/" CHOST "/", "g", la_data)
639 + }
640 + }
641 +
642 + if (OLDVER != NEWVER) {
643 + # Catch:
644 + #
645 + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
646 + #
647 + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
648 + GCCLIB "/" NEWVER "\\1", "g", la_data)
649 + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
650 + GCCLIB "/" NEWVER "\\1", "g", tmpstr)
651 +
652 + if (la_data != tmpstr) {
653 + # Catch:
654 + #
655 + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
656 + #
657 + # in cases where we have gcc34
658 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
659 + GCCLIBPREFIX "\\1", "g", tmpstr)
660 + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
661 + GCCLIBPREFIX "\\1", "g", tmpstr)
662 + printn("v")
663 + la_data = tmpstr
664 + }
665 + }
666 +
667 + # We now check if we have libstdc++.la, as we remove the
668 + # libtool linker scripts for gcc and any referencese in any
669 + # libtool linker scripts.
670 + # We do this last, as we only match the new paths
671 + tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
672 + "-lstdc++", "g", la_data);
673 + if (la_data != tmpstr) {
674 + printn("l")
675 + la_data = tmpstr
676 + }
677 +
678 + print la_data >> (la_files ".new")
679 + }
680 +
681 + if (CHANGED)
682 + print "]"
683 +
684 + close(la_files)
685 + close(la_files ".new")
686 +
687 + assert(dosystem("mv -f " la_files ".new " la_files),
688 + "dosystem(\"mv -f " la_files ".new " la_files "\")")
689 + }
690 + }
691 +
692 + close(pipe)
693 + }
694 +}
695 +
696 +# vim:ts=4
697
698 diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89
699 new file mode 100644
700 index 0000000..cee0325
701 --- /dev/null
702 +++ b/sys-devel/gcc/files/c89
703 @@ -0,0 +1,20 @@
704 +#! /bin/sh
705 +
706 +# Call the appropriate C compiler with options to accept ANSI/ISO C
707 +# The following options are the same (as of gcc-2.95):
708 +# -ansi
709 +# -std=c89
710 +# -std=iso9899:1990
711 +
712 +for i; do
713 + case "$i" in
714 + -ansi|-std=c89|-std=iso9899:1990)
715 + ;;
716 + -std=*)
717 + echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i"
718 + exit 1
719 + ;;
720 + esac
721 +done
722 +
723 +exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@"
724
725 diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99
726 new file mode 100644
727 index 0000000..c954209
728 --- /dev/null
729 +++ b/sys-devel/gcc/files/c99
730 @@ -0,0 +1,21 @@
731 +#! /bin/sh
732 +
733 +# Call the appropriate C compiler with options to accept ANSI/ISO C
734 +# The following options are the same (as of gcc-3.3):
735 +# -std=c99
736 +# -std=c9x
737 +# -std=iso9899:1999
738 +# -std=iso9899:199x
739 +
740 +for i; do
741 + case "$i" in
742 + -std=c9[9x]|-std=iso9899:199[9x])
743 + ;;
744 + -ansi|-std=*)
745 + echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i"
746 + exit 1
747 + ;;
748 + esac
749 +done
750 +
751 +exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"}
752
753 diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh
754 new file mode 100644
755 index 0000000..c6c84e9
756 --- /dev/null
757 +++ b/sys-devel/gcc/files/fix_libtool_files.sh
758 @@ -0,0 +1,66 @@
759 +#!/bin/sh
760 +# Copyright 1999-2019 Gentoo Authors
761 +# Distributed under the terms of the GNU General Public License v2
762 +
763 +usage() {
764 +cat << "USAGE_END"
765 +Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
766 +
767 + Where <old-gcc-version> is the version number of the
768 + previous gcc version. For example, if you updated to
769 + gcc-3.2.1, and you had gcc-3.2 installed, run:
770 +
771 + # fix_libtool_files.sh 3.2
772 +
773 + If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu
774 + but you now have CHOST as i686-pc-linux-gnu, run:
775 +
776 + # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
777 +
778 + Note that if only the CHOST and not the version changed, you can run
779 + it with the current version and the '--oldarch <old-CHOST>' arguments,
780 + and it will do the expected:
781 +
782 + # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
783 +
784 +USAGE_END
785 + exit 1
786 +}
787 +
788 +case $2 in
789 +--oldarch) [ $# -ne 3 ] && usage ;;
790 +*) [ $# -ne 1 ] && usage ;;
791 +esac
792 +
793 +ARGV1=$1
794 +ARGV2=$2
795 +ARGV3=$3
796 +
797 +. /etc/profile || exit 1
798 +
799 +if [ ${EUID:-0} -ne 0 -a "${EPREFIX}" = '' ] ; then
800 + echo "${0##*/}: Must be root."
801 + exit 1
802 +fi
803 +
804 +# make sure the files come out sane
805 +umask 0022
806 +
807 +OLDCHOST=
808 +[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
809 +
810 +AWKDIR="/usr/share/gcc-data"
811 +
812 +if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then
813 + echo "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
814 + exit 1
815 +fi
816 +
817 +OLDVER=${ARGV1}
818 +
819 +export OLDVER OLDCHOST
820 +
821 +echo "Scanning libtool files for hardcoded gcc library paths..."
822 +exec gawk -f "${AWKDIR}/fixlafiles.awk"
823 +
824 +# vim:ts=4
825
826 diff --git a/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch b/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch
827 new file mode 100644
828 index 0000000..aed1ad0
829 --- /dev/null
830 +++ b/sys-devel/gcc/files/gcc-4.9.4-bootstrap.patch
831 @@ -0,0 +1,66 @@
832 +From 41a4aa66eac45c8862a79351647ec06dd03bd1f5 Mon Sep 17 00:00:00 2001
833 +From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
834 +Date: Sat, 13 Dec 2014 11:24:37 +0000
835 +Subject: [PATCH] PR bootstrap/64023 * Makefile.tpl
836 + (EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS to POSTSTAGE1_LDFLAGS and
837 + STAGE1_LIBS to POSTSTAGE1_LIBS. Add -B to libstdc++-v3/src/.libs and
838 + libstdc++-v3/libsupc++/.libs to CXX. * Makefile.in: Regenerated.
839 +
840 +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218705 138bc75d-0d04-0410-961f-82ee72b054a4
841 +---
842 + ChangeLog | 9 +++++++++
843 + Makefile.in | 6 +++++-
844 + Makefile.tpl | 6 +++++-
845 + 3 files changed, 19 insertions(+), 2 deletions(-)
846 +
847 +diff --git a/Makefile.in b/Makefile.in
848 +index ba5ae4c2ecb..8ffc313f157 100644
849 +--- a/Makefile.in
850 ++++ b/Makefile.in
851 +@@ -835,7 +835,9 @@ EXTRA_TARGET_FLAGS = \
852 + 'AS=$(COMPILER_AS_FOR_TARGET)' \
853 + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
854 + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
855 +- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
856 ++ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
857 ++ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
858 ++ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
859 + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
860 + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
861 + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
862 +@@ -853,6 +855,8 @@ EXTRA_TARGET_FLAGS = \
863 + 'WINDRES=$$(WINDRES_FOR_TARGET)' \
864 + 'WINDMC=$$(WINDMC_FOR_TARGET)' \
865 + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
866 ++ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
867 ++ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
868 + "TFLAGS=$$TFLAGS"
869 +
870 + TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
871 +diff --git a/Makefile.tpl b/Makefile.tpl
872 +index dcbc6b1b143..bb8227eaafa 100644
873 +--- a/Makefile.tpl
874 ++++ b/Makefile.tpl
875 +@@ -641,7 +641,9 @@ EXTRA_TARGET_FLAGS = \
876 + 'AS=$(COMPILER_AS_FOR_TARGET)' \
877 + 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
878 + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
879 +- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
880 ++ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
881 ++ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
882 ++ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
883 + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
884 + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
885 + 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
886 +@@ -659,6 +661,8 @@ EXTRA_TARGET_FLAGS = \
887 + 'WINDRES=$$(WINDRES_FOR_TARGET)' \
888 + 'WINDMC=$$(WINDMC_FOR_TARGET)' \
889 + 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
890 ++ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
891 ++ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
892 + "TFLAGS=$$TFLAGS"
893 +
894 + TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
895 +--
896 +2.15.0
897 +
898
899 diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
900 new file mode 100644
901 index 0000000..d1b1b03
902 --- /dev/null
903 +++ b/sys-devel/gcc/files/gcc-configure-LANG.patch
904 @@ -0,0 +1,64 @@
905 +The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
906 +option parsing, it may break.
907 +
908 +http://bugs.gentoo.org/103483
909 +
910 +--- configure
911 ++++ configure
912 +@@ -54,6 +54,19 @@
913 + infodir='${prefix}/info'
914 + mandir='${prefix}/man'
915 +
916 ++# NLS nuisances.
917 ++for as_var in \
918 ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
919 ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
920 ++ LC_TELEPHONE LC_TIME
921 ++do
922 ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
923 ++ eval $as_var=C; export $as_var
924 ++ else
925 ++ unset $as_var
926 ++ fi
927 ++done
928 ++
929 + # Initialize some other variables.
930 + subdirs=
931 + MFLAGS= MAKEFLAGS=
932 +@@ -452,16 +463,6 @@
933 + esac
934 + done
935 +
936 +-# NLS nuisances.
937 +-# Only set these to C if already set. These must not be set unconditionally
938 +-# because not all systems understand e.g. LANG=C (notably SCO).
939 +-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
940 +-# Non-C LC_CTYPE values break the ctype check.
941 +-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
942 +-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
943 +-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
944 +-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
945 +-
946 + # confdefs.h avoids OS command line length limits that DEFS can exceed.
947 + rm -rf conftest* confdefs.h
948 + # AIX cpp loses on an empty file, so make sure it contains at least a newline.
949 +@@ -1850,6 +1850,19 @@
950 + # Compiler output produced by configure, useful for debugging
951 + # configure, is in ./config.log if it exists.
952 +
953 ++# NLS nuisances.
954 ++for as_var in \
955 ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
956 ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
957 ++ LC_TELEPHONE LC_TIME
958 ++do
959 ++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
960 ++ eval \$as_var=C; export \$as_var
961 ++ else
962 ++ unset \$as_var
963 ++ fi
964 ++done
965 ++
966 + ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
967 + for ac_option
968 + do
969
970 diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
971 new file mode 100644
972 index 0000000..ddc098d
973 --- /dev/null
974 +++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
975 @@ -0,0 +1,16 @@
976 +Chances are quite good that the installed makeinfo is sufficient.
977 +So ignore false positives where the makeinfo installed is so new
978 +that it violates the cheesy version grep.
979 +
980 +http://bugs.gentoo.org/198182
981 +
982 +--- configure
983 ++++ configure
984 +@@ -3573,6 +3573,6 @@
985 + :
986 + else
987 +- MAKEINFO="$MISSING makeinfo"
988 ++ :
989 + fi
990 + ;;
991 +
992
993 diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
994 new file mode 100644
995 index 0000000..a589268
996 --- /dev/null
997 +++ b/sys-devel/gcc/files/gcc-spec-env-r1.patch
998 @@ -0,0 +1,87 @@
999 +2013-08-22 Magnus Granberg <zorry@g.o>
1000 +
1001 + * gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
1002 + and move the process of the user specifed specs.
1003 +
1004 + This allows us to easily control pie/ssp defaults with gcc-config profiles.
1005 + Original patch by Rob Holland
1006 + Extended to support multiple entries separated by ':' by Kevin F. Quinn
1007 + Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
1008 + Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
1009 +
1010 +--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
1011 ++++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
1012 +@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
1013 + do_option_spec (option_default_specs[i].name,
1014 + option_default_specs[i].spec);
1015 +
1016 ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
1017 ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
1018 ++ * each spec listed, the string is overwritten at token boundaries
1019 ++ * (':') with '\0', an effect of strtok_r().
1020 ++ */
1021 ++ specs_file = getenv ("GCC_SPECS");
1022 ++ if (specs_file && (strlen(specs_file) > 0))
1023 ++ {
1024 ++ char *spec, *saveptr;
1025 ++ for (spec=strtok_r(specs_file,":",&saveptr);
1026 ++ spec!=NULL;
1027 ++ spec=strtok_r(NULL,":",&saveptr))
1028 ++ {
1029 ++ struct user_specs *user = (struct user_specs *)
1030 ++ xmalloc (sizeof (struct user_specs));
1031 ++ user->next = (struct user_specs *) 0;
1032 ++ user->filename = spec;
1033 ++ if (user_specs_tail)
1034 ++ user_specs_tail->next = user;
1035 ++ else
1036 ++ user_specs_head = user;
1037 ++ user_specs_tail = user;
1038 ++ }
1039 ++ }
1040 ++#endif
1041 ++ /* Process any user specified specs in the order given on the command
1042 ++ * line. */
1043 ++ for (uptr = user_specs_head; uptr; uptr = uptr->next)
1044 ++ {
1045 ++ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1046 ++ R_OK, true);
1047 ++ read_specs (filename ? filename : uptr->filename, false, true);
1048 ++ }
1049 ++ /* Process any user self specs. */
1050 ++ {
1051 ++ struct spec_list *sl;
1052 ++ for (sl = specs; sl; sl = sl->next)
1053 ++ if (sl->name_len == sizeof "self_spec" - 1
1054 ++ && !strcmp (sl->name, "self_spec"))
1055 ++ do_self_spec (*sl->ptr_spec);
1056 ++ }
1057 ++
1058 + /* Process DRIVER_SELF_SPECS, adding any new options to the end
1059 + of the command line. */
1060 +
1061 +@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
1062 + PREFIX_PRIORITY_LAST, 0, 1);
1063 + }
1064 +
1065 +- /* Process any user specified specs in the order given on the command
1066 +- line. */
1067 +- for (uptr = user_specs_head; uptr; uptr = uptr->next)
1068 +- {
1069 +- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1070 +- R_OK, true);
1071 +- read_specs (filename ? filename : uptr->filename, false, true);
1072 +- }
1073 +-
1074 +- /* Process any user self specs. */
1075 +- {
1076 +- struct spec_list *sl;
1077 +- for (sl = specs; sl; sl = sl->next)
1078 +- if (sl->name_len == sizeof "self_spec" - 1
1079 +- && !strcmp (sl->name, "self_spec"))
1080 +- do_self_spec (*sl->ptr_spec);
1081 +- }
1082 +-
1083 + if (compare_debug)
1084 + {
1085 + enum save_temps save;
1086
1087 diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
1088 new file mode 100644
1089 index 0000000..57e7567
1090 --- /dev/null
1091 +++ b/sys-devel/gcc/files/gcc-spec-env.patch
1092 @@ -0,0 +1,42 @@
1093 + Add support for external spec file via the GCC_SPECS env var. This
1094 + allows us to easily control pie/ssp defaults with gcc-config profiles.
1095 +
1096 + Original patch by Rob Holland
1097 + Extended to support multiple entries separated by ':' by Kevin F. Quinn
1098 + Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
1099 +
1100 +--- gcc-4/gcc/gcc.c
1101 ++++ gcc-4/gcc/gcc.c
1102 +@@ -6482,6 +6482,32 @@
1103 +
1104 + /* Process any user specified specs in the order given on the command
1105 + line. */
1106 ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
1107 ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
1108 ++ * each spec listed, the string is overwritten at token boundaries
1109 ++ * (':') with '\0', an effect of strtok_r().
1110 ++ */
1111 ++ specs_file = getenv ("GCC_SPECS");
1112 ++ if (specs_file && (strlen(specs_file) > 0))
1113 ++ {
1114 ++ char *spec, *saveptr;
1115 ++ for (spec=strtok_r(specs_file,":",&saveptr);
1116 ++ spec!=NULL;
1117 ++ spec=strtok_r(NULL,":",&saveptr))
1118 ++ {
1119 ++ struct user_specs *user = (struct user_specs *)
1120 ++ xmalloc (sizeof (struct user_specs));
1121 ++
1122 ++ user->next = (struct user_specs *) 0;
1123 ++ user->filename = spec;
1124 ++ if (user_specs_tail)
1125 ++ user_specs_tail->next = user;
1126 ++ else
1127 ++ user_specs_head = user;
1128 ++ user_specs_tail = user;
1129 ++ }
1130 ++ }
1131 ++#endif
1132 + for (uptr = user_specs_head; uptr; uptr = uptr->next)
1133 + {
1134 + char *filename = find_a_file (&startfile_prefixes, uptr->filename,
1135
1136 diff --git a/sys-devel/gcc/gcc-8.3.0-r1.ebuild b/sys-devel/gcc/gcc-8.3.0-r1.ebuild
1137 new file mode 100644
1138 index 0000000..aa06c78
1139 --- /dev/null
1140 +++ b/sys-devel/gcc/gcc-8.3.0-r1.ebuild
1141 @@ -0,0 +1,19 @@
1142 +# Copyright 1999-2019 Gentoo Authors
1143 +# Distributed under the terms of the GNU General Public License v2
1144 +
1145 +EAPI="6"
1146 +
1147 +PATCH_VER="1.1"
1148 +
1149 +inherit toolchain
1150 +
1151 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
1152 +
1153 +RDEPEND=""
1154 +DEPEND="${RDEPEND}
1155 + elibc_glibc? ( >=sys-libs/glibc-2.13 )
1156 + >=${CATEGORY}/binutils-2.20"
1157 +
1158 +if [[ ${CATEGORY} != cross-* ]] ; then
1159 + PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
1160 +fi
1161
1162 diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
1163 new file mode 100644
1164 index 0000000..8e530f9
1165 --- /dev/null
1166 +++ b/sys-devel/gcc/metadata.xml
1167 @@ -0,0 +1,33 @@
1168 +<?xml version="1.0" encoding="UTF-8"?>
1169 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1170 +<pkgmetadata>
1171 + <maintainer type="project">
1172 + <email>toolchain@g.o</email>
1173 + <name>Gentoo Toolchain Project</name>
1174 + </maintainer>
1175 + <use>
1176 + <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
1177 + in gcc (Warning: significantly increases compile time!)</flag>
1178 + <flag name="go">Build the GCC Go language frontend.</flag>
1179 + <flag name="graphite">Add support for the framework for loop
1180 + optimizations based on a polyhedral intermediate representation</flag>
1181 + <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.
1182 + This will slow down the compiler a bit as it forces all of the toolchain to be shared libs.</flag>
1183 + <flag name="libssp">Build SSP support into a dedicated library rather than use the
1184 + code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
1185 + <flag name="mpx">Enable support for Intel Memory Protection Extensions (MPX)</flag>
1186 + <flag name="objc">Build support for the Objective C code language</flag>
1187 + <flag name="objc++">Build support for the Objective C++ language</flag>
1188 + <flag name="objc-gc">Build support for the Objective C code language Garbage
1189 + Collector</flag>
1190 + <flag name="pgo">Build GCC using Profile Guided Optimization (PGO)</flag>
1191 + <flag name="sanitize">Build support for various sanitizer functions (ASAN/TSAN/etc...)</flag>
1192 + <flag name="ssp">Build packages with stack smashing protector on by default</flag>
1193 + <flag name="systemtap">enable systemtap static probe points</flag>
1194 + <flag name="vtv">Build support for virtual table verification (a C++ hardening feature)</flag>
1195 + </use>
1196 + <upstream>
1197 + <remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
1198 + <remote-id type="sourceforge">dgcc</remote-id>
1199 + </upstream>
1200 +</pkgmetadata>