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

Ulrich Spoerlein q at
Mon Jan 3 17:56:27 GMT 2005

On Mon, 03.01.2005 at 16:36:36 +0100, Michael Nottebrock wrote:
> > 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 
> well. get's loaded by ruby on demand. That is when using 'require
wxruby'. I'm pretty sure we don't want to link pthread into ruby itself.

% irb
irb(main):001:0> require "wxruby"
/libexec/ /usr/local/lib/ Undefined symbol "pthread_getschedparam"

% LD_PRELOAD=/usr/lib/ irb
irb(main):001:0> require "wxruby"
=> true

Preloading works too, of course.

(irb is the interactive ruby shell)

Ulrich Spoerlein
 PGP Key ID: F0DB9F44				Encrypted mail welcome!
Fingerprint: F1CE D062 0CA9 ADE3 349B  2FE8 980A C6B5 F0DB 9F44
Ok, which part of "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
didn't you understand?
-------------- 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