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

Michael Nottebrock michaelnottebrock at gmx.net
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/ld-elf.so.1: /usr/local/lib/libgthread-2.0.so.400: 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.

-- 
   ,_,   | Michael Nottebrock               | lofi at freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050103/df203825/attachment.bin


More information about the freebsd-ports mailing list