Problem with -pthread linking

Michael Nottebrock lofi at freebsd.org
Thu Dec 21 15:56:26 PST 2006


On Thursday, 21. December 2006 19:56, Alejandro Pulver wrote:
> Hello.
>
> I was updating the games/r1q2 port which consists of a client
> executable (r1q2) that loads the render (ref_gl.so) at run-time with
> dlopen(), when I noticed it wasn't able to load it.
>
> The reason is that the render needs SDL, which needs pthread but
> neither the render or SDL have a reference to pthread (even though the
> render is linked with `sdl-config --libs` which includes '-pthread').
>
> If I link the render with '-lpthread' it adds the reference (is
> reported by 'ldd') and works.
>
> Is there a cleaner way to do this?

Using -pthread effectively means that references to threading functions always 
need to be resolved through executables instead of shared libraries, i.e. 
you'll probably need to link rlq2 itself with -pthread.


Cheers,
-- 
   ,_,   | 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/20061221/8f3e58de/attachment.pgp


More information about the freebsd-ports mailing list