This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
using assert (__eprintf) in shared libraries
- To: help-gcc at gnu dot org
- Subject: using assert (__eprintf) in shared libraries
- From: rocky at panix dot com (R. Bernstein)
- Date: 25 Dec 1999 13:47:02 -0500
- Newsgroups: gnu.gcc.help
- Organization: PANIX Public Access Internet and UNIX, NYC
- Xref: wodc7nx0 gnu.gcc.help:2289
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?