Subject: Re: g++ still broken in 1.3.1?
To: Chris Jones <cjones@honors.montana.edu>
From: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
List: port-pmax
Date: 06/12/1998 21:53:24
On Apr 27,  4:47pm, Chris Jones wrote:
> On Tue, 28 Apr 1998, Arne Henrik Juul wrote:
> 
> > > mathfs:/usr/user1/cjones> cat foo.cc
> > > main(){return(0);}
> > > mathfs:/usr/user1/cjones> g++ foo.cc -o foo
> > > /usr/lib/libcurses.so.2: undefined reference to `tgetnum'
> > 
> > Try with -ltermcap and/or with -static.
> 
> Yeah, both those work.  When compiled with -static, the executable doesn't
> even dump core.  With -ltermcap, it does.
> 
> So, does anybody know why this is so?  I'm using the 1.3.1 ld.so, after
> all...

  I think I've figured out why this is so.

  First, g++ includes -lg++, which uses libcurses.so.  Until recently,
libcurses.so uses some termcap routines from libterm, but libcurses.so
doesn't include libterm.so and so 'tgetnum' isn't defined.  I think
libcurses.so now includes the termcap routines it needs, so this should
be fixed in -current.

  Secondly, libg++.so.*.* has some constructors/destructors generated,
and the startup code tries to call the constructor routines.  It would
appear that the 2.8.1 and 2.9.1 versions of 'ld' do not generate any
relocation information for the addresses of the constructor/destructor
routines.  Because those addresses are in the g++ library, they have to
be relocated before being used, which isn't happening.  This results in
the segment violation.  [This problem is also causing mozilla to fail to
run as well.]

Michael

-- 
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA