From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 735 invoked by alias); 27 Jun 2013 20:18:47 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 650 invoked by uid 48); 27 Jun 2013 20:18:43 -0000 From: "roland at gnu dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57740] New: C++11 std::thread not usable with static linking Date: Thu, 27 Jun 2013 20:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: roland at gnu dot org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cf_gcchost attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01706.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57740 Bug ID: 57740 Summary: C++11 std::thread not usable with static linking Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: roland at gnu dot org Host: x86_64-linux-gnu Created attachment 30398 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30398&action=edit test case This bug goes back at least to 4.6, but I don't really care about anything older than 4.8. On x86_64-linux-gnu (and others), the attached test works when compiled with: g++ -std=c++0x -pthread std_mutex.cc -o std_mutex but when compiled with: g++ -std=c++0x -static -pthread std_mutex.cc -o std_mutex it either throws an error or just crashes. The underlying problem is excessive use of weak references in gthr-posix.h. I already have a fix and a testsuite addition in hand and will post them to gcc-patches soon.