From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30FF83851142; Fri, 3 Mar 2023 19:10:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30FF83851142 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677870639; bh=5QEALlfsdV8clc32nJB7HeuiPadk+FzVt3Sp3WWoUsU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QGhmAEX531i6TjNLw2H3zcl/pZujcKCkqLoC9ZnpyfHiFcQ5h4lUPyf1VOnrkYM69 BE0u6L8bIQbGHRQDbw+uH8mBTzkTTjU2bQKRB40EhWO4TVtozMFUbnStNM+VekM4YI ksRmgZSgCauW+A3G3fKXY3oM1n6WT6dVBIIGKVBU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/52590] std::thread Segmentation fault static linking Date: Fri, 03 Mar 2023 19:10:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52590 --- Comment #7 from CVS Commits --- The master branch has been updated by Alexandre Oliva : https://gcc.gnu.org/g:21edd841611a97442a6b95e8ec7e91ff8fd3a451 commit r13-6461-g21edd841611a97442a6b95e8ec7e91ff8fd3a451 Author: Alexandre Oliva Date: Fri Mar 3 15:59:36 2023 -0300 link pthread_join from std::thread ctor Like pthread_create, pthread_join may fail to be statically linked in absent strong uses, so add to user code strong references to both when std::thread objects are created. for libstdc++-v3/ChangeLog PR libstdc++/104852 PR libstdc++/95989 PR libstdc++/52590 * include/bits/std_thread.h (thread::_M_thread_deps): New static implicitly-inline member function. (std::thread template ctor): Pass it to _M_start_thread. * src/c++11/thread.cc (thread::_M_start_thread): Name depend parameter, force it live on entry.=