From owner-freebsd-hackers@freebsd.org Tue Jan 24 08:29:00 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D98CBE00F for ; Tue, 24 Jan 2017 08:29:00 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81110F9A for ; Tue, 24 Jan 2017 08:29:00 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9B4E25A9F12; Tue, 24 Jan 2017 08:20:20 +0000 (UTC) Date: Tue, 24 Jan 2017 08:20:20 +0000 From: Brooks Davis To: Derrick McKee Cc: "freebsd-hackers@freebsd.org" Subject: Re: Missing pthread support for custom libc Message-ID: <20170124082020.GA7873@spindle.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2017 08:29:00 -0000 --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 24, 2017 at 01:20:54AM +0000, Derrick McKee wrote: > Hi, >=20 > 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: >=20 > 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 y= ou > 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 --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYhw5EAAoJEKzQXbSebgfAwbYH/RBLUKPpbxczB6pSQetzxFY0 AHN/RqzqzOVLZ94oisO101oIKzUcjtyOGUZlrm5HwZCqQvD0+yhoduMG6t8rccYV RRR0JcfRhjxLYmZlgTCaDjiM1PTTKWhDeiLfHbLNY2Id1c/fTb2n5i2hgySvRtDt eamSXHDRynuUUiDzWkGA952COJsMwbi/oLQVqDg1sgktVAGUdZBPasJav50qyr9A 8icYmdUD68+29dYmgfYsv4Ojarrut+PP6j7RA17XfdoMIz60fMBPudu4P1Jy1oC9 cmL2/41JIAXMz1pjKqI1GLJ3X7dogR2fhmh+fG7h+EaBD6K8g/6NQETR7+ug7IY= =RN53 -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn--