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.

Reply via email to