public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] GCC3.1 bootstrap fails
@ 2002-06-02 14:27 Prashanth Aditya Susarla
  2002-06-02 15:21 ` Spider
  0 siblings, 1 reply; 2+ messages in thread
From: Prashanth Aditya Susarla @ 2002-06-02 14:27 UTC (permalink / raw
  To: gentoo-dev

Hello,
	I tried to bootstrap with the default-1.0-gcc3 profile at the
outset. The exact details are as follows:-
1.) I used the gentoo-1.1a-ix86.iso image to create my bootable CD
2.) Instead of using the stage-1 tbz2 file on this CD, I separately
downloaded the stage-1 build image from the 1.2 release and used that
instead
3.) As soon as I did the emerge rsync, I switched profiles and edited
make.conf. The optimization flags which I used are very simple - 
-march=i686 -O3 -fomit-frame-pointer
I also edited the packages file to unmask versions of binutils >= 2.12
4.) Executing bootstrap.sh compiled baselayout, gettext, binutils,
gcc-3.1-r5 and glibc-2.2.5-r3 without any hitches.
5.) As soon as glibc was merged and the bootstrap was going to remerge
everything again, gzip failed with a broken pipe and most binaries started
segfaulting (notably emerge and even ls!).

>From the discussions I see on gentoo-dev, I gather that it might be
possible to get a gcc-3.1 system up and running by either
1.) ebuilding gcc before anything else
2.) going easy on the optimizations
3.) switching profiles after the first bootstrap and re-bootstrapping

I also remember seeing something about the stage-1 image *requiring*
libstdc++-v2 and basically the gcc 2.x provided runtime which makes sense
because they have been compiled with gcc 2.x perhaps. But are they
statically linked binaries or is it necessary to provide a gcc 2.x runtime
during bootstrap?
Secondly, am I doing something wrong in using the 1.2 build image?
Thirdly, has anyone seen this kind of error before (atleast I don't see it
from what I gathered from the archives) and what insights could I have
into this?

Regards,
Prashanth Aditya Susarla

PS:- I'll try to reproduce the exact errors if I can but the basic problem
is that most binaries segfault soon after glibc is built.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] GCC3.1 bootstrap fails
  2002-06-02 14:27 [gentoo-dev] GCC3.1 bootstrap fails Prashanth Aditya Susarla
@ 2002-06-02 15:21 ` Spider
  0 siblings, 0 replies; 2+ messages in thread
From: Spider @ 2002-06-02 15:21 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3831 bytes --]

begin  quote
On Sun, 2 Jun 2002 19:57:49 +0530 (IST)
Prashanth Aditya Susarla <aditya@iitk.ac.in> wrote:

> Hello,
> 	I tried to bootstrap with the default-1.0-gcc3 profile at the
> outset. The exact details are as follows:-
> 1.) I used the gentoo-1.1a-ix86.iso image to create my bootable CD
> 2.) Instead of using the stage-1 tbz2 file on this CD, I separately
> downloaded the stage-1 build image from the 1.2 release and used that
> instead
> 3.) As soon as I did the emerge rsync, I switched profiles and edited
> make.conf. The optimization flags which I used are very simple - 
> -march=i686 -O3 -fomit-frame-pointer
This is too heavy.
if for bootstrap use :
-march=i686 -O2 -pipe

do -not- use  -fomit-frame-pointer during bootstrap! (can anyone who
actually got this to -work- using omit-frame-pointer speak up??) 

This causes breakage in glibc.

> I also edited the packages file to unmask versions of binutils >= 2.12
> 4.) Executing bootstrap.sh compiled baselayout, gettext, binutils,
> gcc-3.1-r5 and glibc-2.2.5-r3 without any hitches.
> 5.) As soon as glibc was merged and the bootstrap was going to remerge
> everything again, gzip failed with a broken pipe and most binaries
> started segfaulting (notably emerge and even ls!).

this is due to a broken glibc (omit frame pointer and -O3. I think glibc
strips out -O3 but  not the -f flags. )


> From the discussions I see on gentoo-dev, I gather that it might be
> possible to get a gcc-3.1 system up and running by either
> 1.) ebuilding gcc before anything else
Not recommended as it will build a lot of bad stuff.

> 2.) going easy on the optimizations
thats the good one. you used quite heavy optimiztions. 

> 3.) switching profiles after the first bootstrap and re-bootstrapping
unnecessary really.


> Secondly, am I doing something wrong in using the 1.2 build image?
Nope, works for me (tm)


> Thirdly, has anyone seen this kind of error before (atleast I don't
> see it from what I gathered from the archives) and what insights could
> I have into this?
Yes, several times when I did optimization testing.
Solution: Scrap the optimizations and it works :)

> PS:- I'll try to reproduce the exact errors if I can but the basic
> problem is that most binaries segfault soon after glibc is built.
Try again with -O2 -pipe  and you will get a working system :)



My personal "recipie" to get gcc 3.1 bootstrap working:
install a 1.2 tarball on a fresh fs.
change profile. and unmask gcc 3.1 if necessary. 
make.conf flags to -O2 -pipe
bootstrap. 
with flags still set as generic and with only -O2 optimizations: 
   emerge --buildpkg gcc binutils glibc gettext
  (This takes time, but gives you backup when things break. if you test
  optimizations things break. honest.)
store away my "Safe" binary packages of gcc glibc et.all.

flags changed to -O3 -march=athlon-tbird -pipe   and modified my USE
flags to fit me

   unmask binutils
   emerge binutils 
   emerge glibc
 this gives a glibc for athlon and with combreloc. 

test that things work.... (ls, gzip blah blah. if it breaks, boot from 
cd and unpack the "safe" binaries) a good trial is 
  emerge gettext

time to get a platform-specific compiler : 

  emerge gcc

now, you should have a working system for all issues... 
remember, theese are the sk. foolproof way of doing things, use sane
default optimizations and its just to unmask bintutils and gcc and
bootstrap.  but users dont do that. :p   (users aren't sane ;)

now, with all flags tuned, if you feel insane enough, remove frame
pointer and invalidate all your chances of support, then do : 

emerge system
/(watch it break down and cry in xfree because you overoptimized)


//Spider


--
begin  .signature
This is a .signature virus! Please copy me into your .signature!
See Microsoft KB Article Q265230 for more information.
end

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-02 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-02 14:27 [gentoo-dev] GCC3.1 bootstrap fails Prashanth Aditya Susarla
2002-06-02 15:21 ` Spider

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox