1 |
zorry 13/08/31 11:45:41 |
2 |
|
3 |
Added: gcc-spec-env-r1.patch |
4 |
Log: |
5 |
Bump piepatch and new gcc-spec-env for gcc 4.8.1 |
6 |
|
7 |
(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key FD79807F) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-devel/gcc/files/gcc-spec-env-r1.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/gcc/files/gcc-spec-env-r1.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/gcc/files/gcc-spec-env-r1.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: gcc-spec-env-r1.patch |
16 |
=================================================================== |
17 |
2013-08-22 Magnus Granberg <zorry@g.o> |
18 |
|
19 |
* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var |
20 |
and move the process of the user specifed specs. |
21 |
|
22 |
This allows us to easily control pie/ssp defaults with gcc-config profiles. |
23 |
Original patch by Rob Holland |
24 |
Extended to support multiple entries separated by ':' by Kevin F. Quinn |
25 |
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill |
26 |
Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg |
27 |
|
28 |
--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100 |
29 |
+++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200 |
30 |
@@ -6427,6 +6428,48 @@ main (int argc, char **argv) |
31 |
do_option_spec (option_default_specs[i].name, |
32 |
option_default_specs[i].spec); |
33 |
|
34 |
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) |
35 |
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating |
36 |
+ * each spec listed, the string is overwritten at token boundaries |
37 |
+ * (':') with '\0', an effect of strtok_r(). |
38 |
+ */ |
39 |
+ specs_file = getenv ("GCC_SPECS"); |
40 |
+ if (specs_file && (strlen(specs_file) > 0)) |
41 |
+ { |
42 |
+ char *spec, *saveptr; |
43 |
+ for (spec=strtok_r(specs_file,":",&saveptr); |
44 |
+ spec!=NULL; |
45 |
+ spec=strtok_r(NULL,":",&saveptr)) |
46 |
+ { |
47 |
+ struct user_specs *user = (struct user_specs *) |
48 |
+ xmalloc (sizeof (struct user_specs)); |
49 |
+ user->next = (struct user_specs *) 0; |
50 |
+ user->filename = spec; |
51 |
+ if (user_specs_tail) |
52 |
+ user_specs_tail->next = user; |
53 |
+ else |
54 |
+ user_specs_head = user; |
55 |
+ user_specs_tail = user; |
56 |
+ } |
57 |
+ } |
58 |
+#endif |
59 |
+ /* Process any user specified specs in the order given on the command |
60 |
+ * line. */ |
61 |
+ for (uptr = user_specs_head; uptr; uptr = uptr->next) |
62 |
+ { |
63 |
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename, |
64 |
+ R_OK, true); |
65 |
+ read_specs (filename ? filename : uptr->filename, false, true); |
66 |
+ } |
67 |
+ /* Process any user self specs. */ |
68 |
+ { |
69 |
+ struct spec_list *sl; |
70 |
+ for (sl = specs; sl; sl = sl->next) |
71 |
+ if (sl->name_len == sizeof "self_spec" - 1 |
72 |
+ && !strcmp (sl->name, "self_spec")) |
73 |
+ do_self_spec (*sl->ptr_spec); |
74 |
+ } |
75 |
+ |
76 |
/* Process DRIVER_SELF_SPECS, adding any new options to the end |
77 |
of the command line. */ |
78 |
|
79 |
@@ -6535,24 +6578,6 @@ main (int argc, char **argv) |
80 |
PREFIX_PRIORITY_LAST, 0, 1); |
81 |
} |
82 |
|
83 |
- /* Process any user specified specs in the order given on the command |
84 |
- line. */ |
85 |
- for (uptr = user_specs_head; uptr; uptr = uptr->next) |
86 |
- { |
87 |
- char *filename = find_a_file (&startfile_prefixes, uptr->filename, |
88 |
- R_OK, true); |
89 |
- read_specs (filename ? filename : uptr->filename, false, true); |
90 |
- } |
91 |
- |
92 |
- /* Process any user self specs. */ |
93 |
- { |
94 |
- struct spec_list *sl; |
95 |
- for (sl = specs; sl; sl = sl->next) |
96 |
- if (sl->name_len == sizeof "self_spec" - 1 |
97 |
- && !strcmp (sl->name, "self_spec")) |
98 |
- do_self_spec (*sl->ptr_spec); |
99 |
- } |
100 |
- |
101 |
if (compare_debug) |
102 |
{ |
103 |
enum save_temps save; |