This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC >= 3 problems


"H . J . Lu" <hjl@lucon.org> writes:

|> On Wed, Jan 23, 2002 at 06:43:45PM +0100, Maciej W. Rozycki wrote:
|> > On Wed, 23 Jan 2002, H . J . Lu wrote:
|> > 
|> > > > I'm also running into another problem when it comes to compiling C code 
|> > > > using the Mesa 3D libraries.  Here is the error I receive:
|> > > > 
|> > > > /usr/lib/libglut.so: undefined reference to `atexit'
|> > > > collect2: ld returned 1 exit status
|> > > > make: *** [maze] Error 1
|> > > 
|> > > If you use Linux and glibc 2.2, it can be caused by a linker bug. Which
|> > > binutils are you using? My Linux binutils has a fix for that.
|> > 
|> >  It may not necessarily be a linker bug.  It's a result of crtendS.o
|> > referencing atexit() in older versions of gcc.  But there is no atexit() 
|> > in libc.so -- it's only defined in libc_nonshared.a (thus it may be pulled
|> > in and provided by executables).  A recompilation of libglut.so with the
|> > new gcc should fix the problem. 
|> 
|> That is why I call it a linker bug. Why do you have to recompile a
|> library?  Everything should work fine without recompiling.

You are mixing run time compatibility with compile time compatibility.
While glibc is trying hard to maintain run time compatibility, compile
time compatilibity is not garanteed, and generally you need to have
everything compiled against the same libraries/headers using the same
compiler to get correct results.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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