From owner-freebsd-ports-bugs@freebsd.org Fri Apr 16 14:27:55 2021 Return-Path: Delivered-To: freebsd-ports-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 D685F5D3D46 for ; Fri, 16 Apr 2021 14:27:55 +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 4FMJTR5XQpz4Trf for ; Fri, 16 Apr 2021 14:27:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id BD4245D3B61; Fri, 16 Apr 2021 14:27:55 +0000 (UTC) Delivered-To: ports-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 BD0845D3BA9 for ; Fri, 16 Apr 2021 14:27:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMJTR4wmYz4TTx for ; Fri, 16 Apr 2021 14:27:55 +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 9CCA6262D9 for ; Fri, 16 Apr 2021 14:27:55 +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 13GERtrv036952 for ; Fri, 16 Apr 2021 14:27:55 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 13GERtI2036951 for ports-bugs@FreeBSD.org; Fri, 16 Apr 2021 14:27:55 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: ports-bugs@FreeBSD.org Subject: [Bug 255123] cmake compiler test fails with pthread Date: Fri, 16 Apr 2021 14:27:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: info@babaei.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name 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-ports-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2021 14:27:55 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255123 Bug ID: 255123 Summary: cmake compiler test fails with pthread Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: info@babaei.net CC: pavelivolkov@gmail.com CC: pavelivolkov@gmail.com Flags: maintainer-feedback?(pavelivolkov@gmail.com) I have a few cmake-based C++ projects, which fail to build on 12.2 and 13.0. They used to work on earlier versions of FreeBSD: $ cat build/CMakeFiles/CMakeError.log Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the follo= wing output: Change Dir: /home/mamadou/barandazstorm/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/local/bin/ninja cmTC_cea33 && [1/2] Building C ob= ject CMakeFiles/cmTC_cea33.dir/src.c.o [2/2] Linking C executable cmTC_cea33 FAILED: cmTC_cea33=20 : && /usr/bin/cc CMakeFiles/cmTC_cea33.dir/src.c.o -o cmTC_cea33 && : ld: error: undefined symbol: pthread_create >>> referenced by src.c >>> CMakeFiles/cmTC_cea33.dir/src.c.o:(main) cc: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. Source file was: #include static void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the backtrace exist failed with the following output: Change Dir: /home/mamadou/barandazstorm/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/local/bin/ninja cmTC_1559d && [1/2] Building C ob= ject CMakeFiles/cmTC_1559d.dir/CheckSymbolExists.c.o [2/2] Linking C executable cmTC_1559d FAILED: cmTC_1559d=20 : && /usr/bin/cc CMakeFiles/cmTC_1559d.dir/CheckSymbolExists.c.o -o cmTC_1559d && : ld: error: undefined symbol: backtrace >>> referenced by CheckSymbolExists.c >>> CMakeFiles/cmTC_1559d.dir/CheckSymbolExists.c.o:(main) cc: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. File /home/mamadou/barandazstorm/build/CMakeFiles/CMakeTmp/CheckSymbolExist= s.c: /* */ #include int main(int argc, char** argv) { (void)argv; #ifndef backtrace return ((int*)(&backtrace))[argc]; #else (void)argc; return 0; #endif } Here is how Threads are being enabled and used: set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) target_link_libraries(bbackend PRIVATE ${libzmq_LIBRARIES} Threads::Threads ) There is a similar thread for databases/sqlite3, but I am not sure how these changes affect cmake-based projects on FreeBSD? --=20 You are receiving this mail because: You are the assignee for the bug.=