Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2017 22:18:02 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Derrick McKee <derrick.mckee@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Missing pthread support for custom libc
Message-ID:  <Pine.GSO.4.64.1701232206230.27558@sea.ntplx.net>
In-Reply-To: <CAJoBWHw_hAXCn30VW3Qbk4GbhhHiyJWvten5CoSGKO4OWXooJg@mail.gmail.com>
References:  <CAJoBWHw_hAXCn30VW3Qbk4GbhhHiyJWvten5CoSGKO4OWXooJg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 24 Jan 2017, 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
> checking for pthread_create in -lc_r... no
> checking for pthread_create in -lc... no
> configure: error: --with-pthreads specified for a system without pthread
> support

[ ... ]

> 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.
>

Is this a custom libc _and_ a custom clang?  As for clang, you'll need
to make sure your version of it supports the -pthread option.  Check
the source code for FreeBSD's native version to see how that is
brought in.  It doesn't look like your version of clang properly
supports it.

If you are building apps (firefox) from ports and using your custom
clang, can also try forcing the threads library by setting
PTHREAD_LIBS=-lpthread in /etc/make.conf.  This should override
the default -pthread option.

If you are also using a custom libc, then you may run into other
problems as there are some internal libc<->libpthread interfaces.

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1701232206230.27558>