From owner-freebsd-hackers@freebsd.org Tue Jan 24 01:21:07 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 562A9CBD2B0 for ; Tue, 24 Jan 2017 01:21:07 +0000 (UTC) (envelope-from derrick.mckee@gmail.com) Received: from mail-vk0-x22d.google.com (mail-vk0-x22d.google.com [IPv6:2607:f8b0:400c:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11850A34 for ; Tue, 24 Jan 2017 01:21:07 +0000 (UTC) (envelope-from derrick.mckee@gmail.com) Received: by mail-vk0-x22d.google.com with SMTP id t8so102798677vke.3 for ; Mon, 23 Jan 2017 17:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=tEHG1rb3f8tMPQq7kR58L7PXngCQjaXQevG2WWVYMVQ=; b=RmcRZnXW0m2rfxPGgEIdvo7Xpqs3qHB8VtNuU1nsDjAypJD1SrTPos3fOzS/1Ztzte 81q8ZoyKJB5GS+iH1rRlgmXzzKGwmv+7R2v+qBn6JN/tA0xgXQBRTf0pwpr1DnW+vCsO 7CpcCc2iy4i7uM7zIqPWtH8pwztXzkxMKy8+Trzt592OYMNCJxWzEaFN0+D+ia1QDW5x diFsY1tHOyE/NHFDNl1QDMfcEv6AZztt1Mgfi2I1wmMXR0g8baZJcCpTXfe6AmcR1Tnc HevMbv/7+2LdKJqPsgkiNcX/Rh9n1WcF+qq7iM/nZUpXh0bazpoMx/hXQ+zjxU8/DO8G layw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tEHG1rb3f8tMPQq7kR58L7PXngCQjaXQevG2WWVYMVQ=; b=VyIJO9pLeooXFINWPy4F5hwOaj8rIB5FhA/qzQ+TSqdrc80Ryz3ROkTGDWDCFfET+h rDRYojh9JkAr6CQTPwvTiHOrz/2OuQhMRtLImZJQSDhO48X7uSYekSUWo3hnDFKVUjqk A4vRClhGFpnL4mTIFgbMRNG9VvhuzQgjpM2lH7++x1nWYSo6eqotxjNMYPBE671OCSa+ F2hVzj3kaK5MS/cjEQ4KwUiB7dkQh9mVBRkVU5KeMY3Zy6dCJT6dDIepWySe/hC+S79S 9+aysbuERuwL1hOdZsYuXP3nKGR/x6VVXkudKPV8Keb2LSfgsQ7XLNPdbN91T6CGZJzN sgXw== X-Gm-Message-State: AIkVDXI5qZq1r5z8QEIYlOECdtK0mlJBfi7aPEaitgVIaqUZGz9GKOyEs9bNJGKHo8UYUyf217V6z0ylboqVwQ== X-Received: by 10.31.68.130 with SMTP id r124mr14488551vka.98.1485220865810; Mon, 23 Jan 2017 17:21:05 -0800 (PST) MIME-Version: 1.0 From: Derrick McKee Date: Tue, 24 Jan 2017 01:20:54 +0000 Message-ID: Subject: Missing pthread support for custom libc To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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 01:21:07 -0000 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 DEBUG: DEBUG: int main() { DEBUG: pthread_create() DEBUG: ; return 0; } DEBUG: configure:10603: checking for pthread_create in -lc DEBUG: configure:10622: /home/dmc/install/bin/clang -std=gnu99 -o conftest -O2 -pipe -pthread -static -g -mllvm -hexsafe-analysis -Wno-expansion-to-defined -nostdlib -I/usr/src/include -D__GNUC_VA_LIST -D_VA_LIST_DECLARED /usr/src/lib/csu/amd64/crt*.o -O3 -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -Qunused-arguments -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH_TR1 -D_DECLARE_C99_LDBL_MATH -isystem/usr/local/include -DLIBICONV_PLUG -pthread -L/usr/src/lib/libc++ -L/usr/src/lib/libc -L/usr/lib -lc++ -lc -L/usr/local/lib -Wl,-rpath,/usr/local/lib/firefox -Wl,--as-needed -fstack-protector -Wl,-z,noexecstack -Wl,-z,text conftest.c -lc 1>&5 DEBUG: /tmp/conftest-e31ca2.o: In function `main': DEBUG: /usr/ports/www/firefox/work/firefox-50.1.0/obj-x86_64-unknown-freebsd11.0/configure:10618: undefined reference to `pthread_create' DEBUG: clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation) DEBUG: configure: failed program was: DEBUG: #line 10611 "configure" DEBUG: #include "confdefs.h" DEBUG: /* Override any gcc2 internal prototype to avoid an error. */ DEBUG: /* We use char because int might match the return type of a gcc2 DEBUG: builtin and then its argument prototype would still apply. */ DEBUG: char pthread_create(); DEBUG: DEBUG: int main() { DEBUG: pthread_create() DEBUG: ; return 0; } DEBUG: 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. - Derrick McKee -- Derrick McKee Ph.D. Student at Purdue University