From owner-freebsd-bugs@freebsd.org Fri Nov 13 20:33:19 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21F482EC666 for ; Fri, 13 Nov 2020 20:33:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4CXqt70H7vz4sY4 for ; Fri, 13 Nov 2020 20:33:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 0985F2ECDE8; Fri, 13 Nov 2020 20:33:19 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 094982ECB9D for ; Fri, 13 Nov 2020 20:33:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXqt66k6lz4sDh for ; Fri, 13 Nov 2020 20:33:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA1091E582 for ; Fri, 13 Nov 2020 20:33:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADKXIAY096029 for ; Fri, 13 Nov 2020 20:33:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0ADKXIk0096028 for bugs@FreeBSD.org; Fri, 13 Nov 2020 20:33:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 251112] Compiling C++ with asan fails by default because libclang_rt.asan-x86_64.so uses symbol pthread_attr_get_np but doesn't link to libpthread.so Date: Fri, 13 Nov 2020 20:33:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: astitcher@apache.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 20:33:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251112 Bug ID: 251112 Summary: Compiling C++ with asan fails by default because libclang_rt.asan-x86_64.so uses symbol pthread_attr_get_np but doesn't link to libpthread.so Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: astitcher@apache.org Compiler error: ... /usr/bin/c++ -g -fno-omit-frame-pointer -shared-libasan -fsanitize=3Daddress,undefined -fsanitize-recover=3Dvptr -O2 -g -DNDEBUG -f= lto=3Dthin c/tests/CMakeFiles/test_main.dir/test_main.cpp.o c/tests/CMakeFiles/c-proactor-test.dir/pn_test.cpp.o c/tests/CMakeFiles/c-proactor-test.dir/pn_test_proactor.cpp.o c/tests/CMakeFiles/c-proactor-test.dir/proactor_test.cpp.o -o c/tests/c-proactor-test -Wl,-rpath,/home/vagrant/qpid-proton/BLD/c=20 c/libqpid-proton-proactor.so.1.7.1 c/libqpid-proton-core.so.10.11.0 && : ld: error: /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.so: undefined reference to pthread_attr_get_np And indeed the library only links in portable pthreads via libc: $ ldd /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.so /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.so: libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x800675000) libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x800742000) libm.so.5 =3D> /lib/libm.so.5 (0x800764000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x800796000) libc.so.7 =3D> /lib/libc.so.7 (0x80024e000) Whereas the needed symbol is in libpthreads: $ objdump -T /usr/lib/libpthread.so | grep pthread_attr_get_np 000000000001b960 w DF .text 0000000000000264 FBSD_1.0=20=20=20 pthread_attr_get_np 000000000001b960 w DF .text 0000000000000264 FBSDprivate_1.0 _pthread_attr_get_np You can work around this by manually linking -lpthreads, but our build files which work elsewhere don't do this as it's not necessary elsewhere. --=20 You are receiving this mail because: You are the assignee for the bug.=