[LLVMbugs] [Bug 24182] New: (mingw) clang should implicitly link pthread when the underlying gcc is configured with --enable-threads=posix

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 19 10:23:05 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24182

            Bug ID: 24182
           Summary: (mingw) clang should implicitly link pthread when the
                    underlying gcc is configured with
                    --enable-threads=posix
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: t.poechtrager at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.cpp
#include <thread>

void test(){}

int main() {
    std::thread t(test);
}

$ i686-w64-mingw32-g++ test.cpp -std=c++11
# Works.

$ clang++ -target i686-w64-mingw32 -fno-exceptions -std=c++11 test.cpp
/tmp/test-d91737.o:(.text+0x60): undefined reference to `pthread_equal'
clang-3.7: error: linker command failed with exit code 1 (use -v to see
invocation)


I know this is not easy to solve, but I think one possible solution could be to
have clang to check for <sysroot>/usr/lib/lib[win]pthread[.dll].a and then only
link against pthread when that file is found.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150719/9231479b/attachment.html>


More information about the llvm-bugs mailing list