using assert (__eprintf) in shared libraries
R. Bernstein
rocky@panix.com
Sat Dec 25 10:51:00 GMT 1999
A number of packages, like MesaGL and audiofile want to build
with shared libraries and at run time I often get a message like
ld.so.1: xmms: fatal: relocation error: file /opt/platform/X11/lib/libGL.so: symbol __eprintf: referenced symbol not found
(Note the error is pretty far from the source of the problem: xmms uses
libGL and that uses gcc's __eprintf.)
What is going on is that the source code to say libGL.so uses assert(), and
under gcc this uses in __eprintf from libgcc.a.
I've been able to fix such problems by extracting _eprintf.o from libgcc.a
and linking this in explicitly into the shared objects.
But I'm not sure where the real problem lies -- should there be a shared
libgcc? Are the builds for such programs at fault?
And what the best way to fix?
Any thoughts?
More information about the Gcc-help
mailing list