PThread Issue: -pthread vs. -lpthread for a new port

Michael Nottebrock michaelnottebrock at
Mon Jan 3 15:36:58 GMT 2005

On Monday, 3. January 2005 12:42, Ulrich Spoerlein wrote:
> Hi all,
> I ported [1] wxruby [2] but am running into an issue wrt pthreads. The
> wxruby library gets linked like this:


> And running a ruby program requiring wxruby I get this error:
> /libexec/ /usr/local/lib/ Undefined
> symbol "pthread_getschedparam"

This is expected: When shared libraries are linked with -pthread, the linker 
only resolves the necessary symbols but does not emit a DT_NEEDED symbol for 
the resulting shared library, it only does for programs.

Bottom line: Pthread symbols must always be resolved through the actual 
program. Make sure the program that uses wxruby is linked with -pthread as 

   ,_,   | Michael Nottebrock               | lofi at
 (/^ ^\) | FreeBSD - The Power to Serve     |
   \u/   | K Desktop Environment on FreeBSD |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list