Hi, all.  I'm in the rather painful position of trying to put together a
multithreaded-capable libc5 environment.  Since there are also binaries
on the system that are not MT-aware (netscape, for example, becomes
particularly useless when linked with a threadsafe libX11.so), I've put
all my threadsafe libraries in /usr/local/lib/MT-safe.  I want to set up
gcc to go fetch them from there (and prefer them to their non-threadsafe
equivalents in the normal link path) anytime libpthread is linked in.
This seemed to have an obvious solution.  I added:

%{lpthread:-L/usr/local/lib/MT-safe}

to the *lib line of my specs file, and added:

%{lpthread:--rpath /usr/local/lib/MT-safe

to the *link line.

I tried compiling a program with both -v and -lpthread on the command line,
and I did not see either of these two arguments passed to the linker.  I
triple-checked the spelling and syntax of everything.  On a lark, I changed
the first to:

%{v:-L/usr/local/lib/MT-safe}

and again compiled with both -v and -lpthread.  This time, the -L argument
was passed to the linker and the --rpath was not.  It appears gcc is not
using -l options as decision keys in the specs file (but it is using -v!).

Has anyone else encountered this?  Is there a good reason for it?  Do more
recent versions of gcc/egcs fix this (I'm currently using 2.7.2.3)?

Does anyone have any other suggestions for how I might set up gcc to
automatically use the threadsafe libraries when appropriate?

Thanks much for any insight...

Carl Miller       ([EMAIL PROTECTED])

Reply via email to