Subject: Re: Using a different compiler
To: None <netbsd-users@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-users
Date: 05/26/2006 14:36:38
In article <047901c67f3a$a29ac300$cc22a8c0@stu95>,
	"Stuart Brooks" <stuartb@cat.co.za> writes:
>> >>> I would like to be able to use a different compiler to build and run
>> >>> some of my own applications on Netbsd 1.6.1. The native compiler is gcc
>> >>> 2.95.3 and I would like to use gcc 3.3.x (because of exception handling
>> >>> problems in 2.95). What concerns me is shared library compatibility -
>> >>> especially X, QT, GL etc - since I know that the C++ ABI differs
>> >>> between those 2 gcc releases.
>> >>
>> >> You'll probably need to recompile/re-install all the c++ shared
>> >> libraries.
>> >
>> > Thanks for the reply. Does that mean that any "straight" C libraries
>> > should be fine? At the time of writing I had rebuilt QT, and things
>> > worked nominally although I have core dumps when I hit GL/GLU code
>> > (presumably these are C++ libraries). I would expect the X libraries
>> > to be C? but is there any trick to knowing which are C and which are
>> > C++?

The "trick" is "ldd".  If a program ends up pulling in two versions
of "libstdc++", it's doomed.  Running "ldd" over the libraries in
"/usr/X11R6/lib", it looks like only "libGL" has that dependency.
ABI issues going from gcc-2.95 to gcc-3 that don't involve the C++
standard library are rare, and any non-dead projects that saw problems
when gcc-3 came out will have adapted their code by now (one hopes).


Frederick