1 |
I've been pretty busy this summer and haven't had much time to devote to |
2 |
the gcc-config changes we discussed here a couple months back until |
3 |
yesterday. I created a cvs repository for the development in |
4 |
gentoo/src/toolchain/gcc-config. Right now, it's barely more than |
5 |
framework for the code and a README detailing some aspects of the |
6 |
program (specifically changes from the current 1.3.X line). I'm not |
7 |
worrying about a migration path right now, but it shouldn't be too |
8 |
difficult. The only major headache I can think of is someone |
9 |
downgrading. |
10 |
|
11 |
The configuration files are in XML. I'm a little apprehensive about |
12 |
having such a core package depend on an outside library like this, but I |
13 |
think having the xml configuration files allows a much more robust |
14 |
configuration. Plus, we can use USE=static. I don't have much |
15 |
experience dealing with creating dtds or the libxml2 API, so if someone |
16 |
else would like to help out with implementing that part of the code, I |
17 |
would appreciate the help... but I'm not expecting that to hold me up |
18 |
too much if nobody volunteers. |
19 |
|
20 |
Along with moving to this new gcc-config, we should address the "gcc |
21 |
upgrade la hell" problem. az and I talked about this a few times, and |
22 |
we came to the conclusion that deleting the .la files installed by gcc |
23 |
would be the best option. See bug #75420 comment #34 and |
24 |
http://ramblings.hudscabin.com/blogs/index.php/2005/05/02/multilib_and_toolchain_thoughts for a little more... |
25 |
|
26 |
Here's the current README. I welcome comments, criticisms, concerns, |
27 |
and assistance as I start implementing this. |
28 |
|
29 |
--Jeremy |
30 |
|
31 |
gcc-config 2.0 |
32 |
|
33 |
gcc-config 2.0 is incompatible with previous versions of gcc-config. A |
34 |
migration path has not been implemented yet. |
35 |
|
36 |
With gcc-config 2.0, the configuration options have expanded. The |
37 |
wrapper now |
38 |
uses the configuration find the execuatble to fork off rather than |
39 |
searching through |
40 |
the $PATH. Each CHOST has a profile associated with it. The CHOST used |
41 |
by the wrapper |
42 |
is determined by the first matching criteria: |
43 |
|
44 |
1) If the ABI environment variable is set, and CHOST_${ABI} is also set, |
45 |
it will be |
46 |
used. This is a deprecated feature and is really only here for |
47 |
backwards |
48 |
compatibility. It will be removed once all ebuilds and profiles |
49 |
relying on this |
50 |
feature have been removed from portage. |
51 |
2) If the executable is called with a CHOST prefix, it is used. |
52 |
3) If the CHOST environment variable is set, it is used. |
53 |
4) The default CHOST is used. |
54 |
|
55 |
configuration directory: /etc/gcc-config |
56 |
All configuration information is stored in this directory. The current |
57 |
config |
58 |
format is as follows, but it is subject to change before release. |
59 |
|
60 |
The selection file (/etc/gcc-config/selection.conf) lists the currently |
61 |
selected |
62 |
profiles for each CHOST handled by gcc-config. It is formatted as |
63 |
follows: |
64 |
<selections> |
65 |
<default_chost>##DEFAULT CHOST##</default_chost> |
66 |
<selection> |
67 |
<chost>##CHOST##</chost> |
68 |
<version>##gcc version being used##</version> |
69 |
<profile>##profile name##</profile> |
70 |
</selection> |
71 |
<selection> |
72 |
... |
73 |
</selection> |
74 |
... |
75 |
</selections> |
76 |
|
77 |
Configuration file (for each installed gcc package) is |
78 |
named /etc/gcc-config/<version>.conf formatted as follows: |
79 |
<gcc_profiles> |
80 |
<version>##version##</version> |
81 |
<binpath>##Path containing binaries to execute when using this |
82 |
profile##</binpath> |
83 |
<infopath>##Where the info pages are##</infopath> |
84 |
<manpath>##Where the man pages are##</manpath> |
85 |
<profile> |
86 |
<name>##Profile Name##</name> |
87 |
<chost>##Default CHOST for this profile##</name> |
88 |
<spec>##GCC specs file to use##</spec> |
89 |
<ldpath>##Path to add to ld.so.conf##</ldpath> |
90 |
<cflags>##additional CFLAGS to prepend to the command line##</cflags> |
91 |
</profile> |
92 |
<profile> |
93 |
... |
94 |
</profile> |
95 |
... |
96 |
</gcc_profiles> |
97 |
|
98 |
Note that the <chost> in <profile> is only used as a way to tell the |
99 |
user what this profile is used for. |
100 |
The <chost> set in the <selection> tag determines how the binaries act. |
101 |
The <default_chost> in the <selections> |
102 |
tag determines how the binaries 'gcc', 'g++', etc (that is the ones |
103 |
without a prefix) behave. |
104 |
|
105 |
Example /etc/gcc-config/master.conf: |
106 |
<selections> |
107 |
<default_chost>x86_64-pc-linux-gnu</default_chost> |
108 |
<selection> |
109 |
<chost>x86_64-pc-linux-gnu</chost> |
110 |
<version>x86_64-pc-linux-gnu-3.4.4</version> |
111 |
<profile>amd64-vanilla</profile> |
112 |
</selection> |
113 |
<selection> |
114 |
<chost>i686-pc-linux-gnu</chost> |
115 |
<version>x86_64-pc-linux-gnu-3.4.4</version> |
116 |
<profile>x86-vanilla</profile> |
117 |
</selection> |
118 |
<selection> |
119 |
<chost>pentium4-pc-linux-gnu</chost> |
120 |
<version>x86_64-pc-linux-gnu-3.4.4</version> |
121 |
<profile>p4-vanilla</profile> |
122 |
</selection> |
123 |
</selections> |
124 |
|
125 |
Example /etc/gcc-config/x86_64-pc-linux-gnu-3.4.4.conf: |
126 |
<gcc_profiles> |
127 |
<version>x86_64-pc-linux-gnu-3.4.4</version> |
128 |
<binpath>/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.4</binpath> |
129 |
<infopath>/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.4/info</infopath> |
130 |
<manpath>/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.4/man</manpath> |
131 |
<profile> |
132 |
<name>amd64-vanilla</name> |
133 |
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec> |
134 |
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4</ldpath> |
135 |
<cflags>-m64</cflags> |
136 |
</profile> |
137 |
<profile> |
138 |
<name>amd64-hardened</name> |
139 |
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/hardened.specs</spec> |
140 |
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4</ldpath> |
141 |
<cflags>-m64</cflags> |
142 |
</profile> |
143 |
<profile> |
144 |
<name>x86-vanilla</name> |
145 |
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec> |
146 |
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/32</ldpath> |
147 |
<cflags>-m32</cflags> |
148 |
</profile> |
149 |
<profile> |
150 |
<name>p4-vanilla</name> |
151 |
<spec>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/vanilla.specs</spec> |
152 |
<ldpath>/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/32</ldpath> |
153 |
<cflags>-march=pentium4 -m32</cflags> |
154 |
</profile> |
155 |
</gcc_profiles> |