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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to