<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW " title="NEW --- - (mingw) clang should implicitly link pthread when the underlying gcc is configured with --enable-threads=posix" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24182&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=F1c_gKuYwLOqLsGm2p2wrvRQ6SrGAaWUCVSmEVjRpLo&s=LIyoexHRAYqWBttdvURwZ1wNRt8FponXo2YUL-VEOVo&e=">24182</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>(mingw) clang should implicitly link pthread when the underlying gcc is configured with --enable-threads=posix
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>t.poechtrager@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>