forcing symbol versions

Mike Hearn <[email protected]>
Newsgroups gmane.linux.lsb.discuss
Message-ID <[email protected]>
Hi again,

I'm trying to make gcc use only the LSB symbol versions for a hello
world GTK app, so I but I get a load of link errors like:

mike@linux:~/tmp> gcc -L/opt/lsbdev-base/lib `gtk-config --cflags
--libs` -o hello hello.c
/usr/lib/libglib.so: undefined reference to `getpwuid_r@GLIBC_2.1.2'
/usr/lib/libgdk.so: undefined reference to `shmctl@GLIBC_2.2'
/usr/X11R6/lib/libXi.so: undefined reference to `XextAddDisplay'
/usr/X11R6/lib/libXi.so: undefined reference to `_XUnknownNativeEvent'
/usr/lib/libgtk.so: undefined reference to `getresgid@GLIBC_2.0'
/usr/lib/libgtk.so: undefined reference to `getresuid@GLIBC_2.0'
/usr/X11R6/lib/libXi.so: undefined reference to `_XReadPad'

I only vaguely understand why I'm getting these errors, it seems to be
trying to resolve *every* symbol in *every* library to the LSB stub
libs. I only wanted it to do that for the file it was actually
compiling. All those libraries are already linked against the system
libc, so I don't understand why now their symbols have to resolve to the
LSB libc just because I'm trying to use them from my app.

Is this problem due to the lack of grouped fixup (again)? If so, as we
might not be getting that for a while, is there any other way to force
ld to only use a certain set of symbol versions other than using stub
libraries?

thanks -mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.