Gentoo Archives: gentoo-dev

From: Spider <spider@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] GCC3.1 bootstrap fails
Date: Sun, 02 Jun 2002 10:21:29
Message-Id: 20020602172101.1a0eec79.spider@gentoo.org
In Reply to: [gentoo-dev] GCC3.1 bootstrap fails by Prashanth Aditya Susarla
1 begin quote
2 On Sun, 2 Jun 2002 19:57:49 +0530 (IST)
3 Prashanth Aditya Susarla <aditya@×××××××.in> wrote:
4
5 > Hello,
6 > I tried to bootstrap with the default-1.0-gcc3 profile at the
7 > outset. The exact details are as follows:-
8 > 1.) I used the gentoo-1.1a-ix86.iso image to create my bootable CD
9 > 2.) Instead of using the stage-1 tbz2 file on this CD, I separately
10 > downloaded the stage-1 build image from the 1.2 release and used that
11 > instead
12 > 3.) As soon as I did the emerge rsync, I switched profiles and edited
13 > make.conf. The optimization flags which I used are very simple -
14 > -march=i686 -O3 -fomit-frame-pointer
15 This is too heavy.
16 if for bootstrap use :
17 -march=i686 -O2 -pipe
18
19 do -not- use -fomit-frame-pointer during bootstrap! (can anyone who
20 actually got this to -work- using omit-frame-pointer speak up??)
21
22 This causes breakage in glibc.
23
24 > I also edited the packages file to unmask versions of binutils >= 2.12
25 > 4.) Executing bootstrap.sh compiled baselayout, gettext, binutils,
26 > gcc-3.1-r5 and glibc-2.2.5-r3 without any hitches.
27 > 5.) As soon as glibc was merged and the bootstrap was going to remerge
28 > everything again, gzip failed with a broken pipe and most binaries
29 > started segfaulting (notably emerge and even ls!).
30
31 this is due to a broken glibc (omit frame pointer and -O3. I think glibc
32 strips out -O3 but not the -f flags. )
33
34
35 > From the discussions I see on gentoo-dev, I gather that it might be
36 > possible to get a gcc-3.1 system up and running by either
37 > 1.) ebuilding gcc before anything else
38 Not recommended as it will build a lot of bad stuff.
39
40 > 2.) going easy on the optimizations
41 thats the good one. you used quite heavy optimiztions.
42
43 > 3.) switching profiles after the first bootstrap and re-bootstrapping
44 unnecessary really.
45
46
47 > Secondly, am I doing something wrong in using the 1.2 build image?
48 Nope, works for me (tm)
49
50
51 > Thirdly, has anyone seen this kind of error before (atleast I don't
52 > see it from what I gathered from the archives) and what insights could
53 > I have into this?
54 Yes, several times when I did optimization testing.
55 Solution: Scrap the optimizations and it works :)
56
57 > PS:- I'll try to reproduce the exact errors if I can but the basic
58 > problem is that most binaries segfault soon after glibc is built.
59 Try again with -O2 -pipe and you will get a working system :)
60
61
62
63 My personal "recipie" to get gcc 3.1 bootstrap working:
64 install a 1.2 tarball on a fresh fs.
65 change profile. and unmask gcc 3.1 if necessary.
66 make.conf flags to -O2 -pipe
67 bootstrap.
68 with flags still set as generic and with only -O2 optimizations:
69 emerge --buildpkg gcc binutils glibc gettext
70 (This takes time, but gives you backup when things break. if you test
71 optimizations things break. honest.)
72 store away my "Safe" binary packages of gcc glibc et.all.
73
74 flags changed to -O3 -march=athlon-tbird -pipe and modified my USE
75 flags to fit me
76
77 unmask binutils
78 emerge binutils
79 emerge glibc
80 this gives a glibc for athlon and with combreloc.
81
82 test that things work.... (ls, gzip blah blah. if it breaks, boot from
83 cd and unpack the "safe" binaries) a good trial is
84 emerge gettext
85
86 time to get a platform-specific compiler :
87
88 emerge gcc
89
90 now, you should have a working system for all issues...
91 remember, theese are the sk. foolproof way of doing things, use sane
92 default optimizations and its just to unmask bintutils and gcc and
93 bootstrap. but users dont do that. :p (users aren't sane ;)
94
95 now, with all flags tuned, if you feel insane enough, remove frame
96 pointer and invalidate all your chances of support, then do :
97
98 emerge system
99 /(watch it break down and cry in xfree because you overoptimized)
100
101
102 //Spider
103
104
105 --
106 begin .signature
107 This is a .signature virus! Please copy me into your .signature!
108 See Microsoft KB Article Q265230 for more information.
109 end