Missing pthread support for custom libc

Brooks Davis brooks at freebsd.org
Tue Jan 24 08:29:00 UTC 2017


On Tue, Jan 24, 2017 at 01:20:54AM +0000, Derrick McKee wrote:
> Hi,
> 
> I've compiled libc using a custom version of clang, and it seems to be
> missing pthread support.  When I try to compile Firefox and use my version
> of libc, I get the following error:
> 
> checking for pthread_create in -lpthreads... no
> checking for pthread_create in -lpthread... no
[...]
> I've added -pthread to both CFLAGS and LDFLAGS when I compile libc, and you
> can see that it is included when I attempt to compile Firefox.  Any ideas
> on what I am missing?  Thanks.

Your clang's library search path clearly doesn't include a libpthread.
Adding -pthread to CFLAGS and LDFLAGS is unlikely to be to solution
since it just adds -lpthread to the link command which the generated
Makefile will do if it's found during configure.  Also, if you're using
-nostdlib to link your custom libc, it looks like -pthread simply does
nothing at all.

If you can find the clang command used to run the checks above in your
configure log, you may find the result of adding -### to the command
informative.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20170124/3c5465a3/attachment.sig>


More information about the freebsd-hackers mailing list