libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Consequence of using ld to link libraries on Solaris


From: Albert Chin
Subject: Consequence of using ld to link libraries on Solaris
Date: Tue, 13 Apr 2004 17:11:50 -0500
User-agent: Mutt/1.5.6i

When linking a C program and using the Sun C compiler, we use the Sun
linker to create a shared libraries. The problem with this is if -mt
is passed to the Sun C compiler _without_ -lpthread/-lthread. From
cc(1):
     -mt  Passes D_REENTRANT to preprocessor. Appends -lthread
          after all other user-specified libraries on the command
          line.  If you are doing your own multithread coding,
          you must use this option in the compile and link steps.
          To obtain faster execution, this option requires a mul-
          tiprocessor system. On a single-processor system, the
          resulting executable usually runs more slowly with this
          option.

So, to accommodate this, how about we use cc to create shared
libraries on Solaris?

I'm currently running into a problem building PHP 4.3.5 on Solaris 8
against a thread-based Apache. The resulting libphp4.so has pthread_*
symbols but no libpthread/libthread as a result of the above.

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]