1 |
Bob Slawson <bslawson@×××××××××××.net> posted |
2 |
44F7199F.6030604@×××××××××××.net, excerpted below, on Thu, 31 Aug 2006 |
3 |
13:17:19 -0400: |
4 |
|
5 |
> Dieter Ries wrote: |
6 |
>> OK so there it is, gcc 4.1.1 is stable. |
7 |
>> |
8 |
>> i just emerged it and switched gcc-config to 4.1.1. |
9 |
>> does it make sense to recompile gcc 4.1.1 with gcc 4.1.1? |
10 |
>> (do you know what i mean? |
11 |
>> |
12 |
> No. As part of the gcc build process, the new gcc is used to compile |
13 |
> itself. 'Stage 1' |
14 |
> uses an existing compiler to compile the new source to 'xgcc'. Then in |
15 |
> 'stage 2', |
16 |
> 'xgcc' compiles the new source to 'gcc', the compiler is compiling itself. |
17 |
|
18 |
Actually, while you are correct about the gcc build process, the Gentoo |
19 |
Linux gcc upgrade guide [1] DOES recommend rebuilding it, but as part of a |
20 |
larger full system rebuild. |
21 |
|
22 |
Quoting the gist of the general instructions: |
23 |
|
24 |
Code Listing 2.1: Upgrading GCC |
25 |
# emerge -uav gcc |
26 |
|
27 |
(Please substitute "i686-pc-linux-gnu-4.1.1" with the GCC |
28 |
version and CHOST settings you've upgraded to:) |
29 |
# gcc-config i686-pc-linux-gnu-4.1.1 |
30 |
# source /etc/profile |
31 |
|
32 |
If you upgraded from gcc 3 to 4 (e.g. from 3.4.6 to 4.1.1 in this |
33 |
example) you will have to run fix_libtool_files.sh manually |
34 |
# fix_libtool_files.sh 3.4.6 |
35 |
|
36 |
(Rebuilding libtool) |
37 |
# emerge --oneshot -av libtool |
38 |
|
39 |
To be completely safe that your system is in a sane state, you must |
40 |
rebuild the toolchain and then world to make use of the new compiler. |
41 |
|
42 |
Code Listing 2.2: Rebuilding system |
43 |
# emerge -eav system |
44 |
# emerge -eav world |
45 |
|
46 |
It is safe to remove the older GCC version at this time. If you feel the |
47 |
need, please issue the following command (as usual, substitute |
48 |
=sys-devel/gcc-3.4* with the version you want to uninstall): |
49 |
|
50 |
Code Listing 2.3: Removing older GCC version |
51 |
# emerge -aC =sys-devel/gcc-3.4* |
52 |
|
53 |
End quote. |
54 |
|
55 |
Thus, the new gcc will actually be compiled three times, first in the |
56 |
initial upgrade, second as part of emerge --emptytree system (which builds |
57 |
the rest of the toolchain using the new gcc and builds the new gcc using |
58 |
itself), third as part of emerge --emptytree world, which rebuilds the |
59 |
entire system (including gcc) using the now fully upgraded toolchain. |
60 |
|
61 |
IOW, first time rebuilds gcc using the old version, second time rebuilds |
62 |
it and the toolchain using new gcc but partly old toolchain, third time |
63 |
rebuilds it (and everything else) with an entirely fresh toolchain. |
64 |
|
65 |
Of course, that's going to take some major time... probably 2-3 days of |
66 |
constant compiling. (I figure a day with my dual Opteron, with the |
67 |
portage work dir in a tmpfs based ramdisk in main memory... since I have 8 |
68 |
gigs of ram I might as well use it.) |
69 |
|
70 |
OTOH, gcc 4.1.1 is a HUGE boost in performance for amd64, much more so |
71 |
than for x86, as amd64 is still new enough for this to be the first version |
72 |
to really have support for it fully integrated and optimized. (gcc 3.x had |
73 |
support, but it was bolted on, and optimizations weren't as good as they |
74 |
could have been as a result. gcc 4.0 had it integrated but as the first |
75 |
release of the rewrite, was mainly focused on not making things worse. gcc |
76 |
4.1 finally has integrated amd64 support AND is better than 3.x in |
77 |
general. gcc 4.1.1 fixed a few minor remaining bugs from 4.1.0.) |
78 |
|
79 |
[1] http://www.gentoo.org/doc/en/gcc-upgrading.xml |
80 |
|
81 |
-- |
82 |
Duncan - List replies preferred. No HTML msgs. |
83 |
"Every nonfree program has a lord, a master -- |
84 |
and if you use the program, he is your master." Richard Stallman |
85 |
|
86 |
-- |
87 |
gentoo-amd64@g.o mailing list |