Subject: Re: Using a different compiler
To: None <netbsd-users@NetBSD.org>
From: Stuart Brooks <stuartb@cat.co.za>
List: netbsd-users
Date: 05/29/2006 09:37:27
> >> >>> 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).
>

Thanks for that, that is really useful. I have been using nm and
grepping on gxx_personality which so far had only yielded GLU in the X
libs and nothing of consequence elsewhere. ldd looks the trick though, a
nice tool to know about!

Stuart