This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Successful egcs-1.0.2 compile!


        I thought I would try compiling and installing egcs because a friend of
mine said it works better with glibc and it might fix this little problem:

Mysteria:~/Projects/class_check$ gcc lud2.c -o lud2   
/tmp/cca056251.o: In function `main':
/tmp/cca056251.o(.text+0x75): undefined reference to `stat'
/tmp/cca056251.o(.text+0x1bb): undefined reference to `stat'

It's installed, but I guess I need to recompile glibc with egcs so that it will
fix that problem.  BTW, I first ran into this problem with gcc 2.8.1 and glibc
2.0.6.  I found an interesting workaround, which is more of a kludge.  If you
do this:

Mysteria:~/Projects/class_check$ gcc lud2.c -o lud2 -O

It compiles fine, as shown.  I found a newsgroup posting that said this is
because of some strange relationships between xstat and stat (and variants
thereof; take a look at sys/stat.h).  Adding the -O option makes it so that it
inlines some functions, including stat (I guess).  Needless to say, I was happy
to get anything to compile, so I decided to recompile a few other things (make,
fileutil, etc).  When the -O option didn't work with them, I got nervous.  I
tried lots of different things: -share (compiles; segfaults on exec), -static
(compiles, works flawlessy, but x2 size), passing -shared, -call_shared, -dy,
- -Bsymbolic to ld, etc.  I finally just gave up and tried egcs.  All these
problems are probably just in my setup; I've hacked a lot of things to get them
to "compile" ;)
        Anyways, I had to use the -O option when compiling egcs, and I had to
make a little hack to _G_config.h (in libraries/libio) because of a problem
with a typedef somewhere around line 45; I'm pretty sure it was 'typedef
__sigset_t _G_sigset_t;'.  It was complaining that the data type was undefined.
I remember having to fix a problem like this for something else once before
(maybe previous gcc?), so I check _G_config.h.  No includes, except for one at
the end, and it wasn't sigset.h (where the definition for __sigset_t is).  So I
add it to line one of _G_sigset_t, start another make bootstrap, and it compiles
        Now I guess I will go and try to recompile glibc with egcs and see what
happens.  Here are the details for my machine:

kernel:  Linux 2.1.90
libc:    glibc 2.0.6 (aka libc 6)
cc:      gcc 2.8.1 (before) egcs 1.0.2 (after)
arch:    i686 (Intel Pentium Pro 180 MHz)
dist:    Slakware 3.2 (1.5 years ago; now it's unrecognizable :)
host: (check web address below, if it's up)

- ------------------------------------------------------------------
Nathan Paul Simons                |   Life on the cutting edge                  |         Linux 2.1.90      |         glibc 2.0.6  |         egcs 1.0.2
- ------------------------------------------------------------------
Version: 2.6.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]