<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - undefined reference to '__atomic_is_lock_free' with libstdc++"
href="https://bugs.llvm.org/show_bug.cgi?id=34044">34044</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>undefined reference to '__atomic_is_lock_free' with libstdc++
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>raj.khem@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Compile this sample with clang++ results in error while g++ works fine
#include <atomic>
#include <iostream>
struct Simple1 { int i; };
int main()
{
std::atomic<Simple1> s1;
std::cout << std::boolalpha << s1.is_lock_free() << '\n';
return 0;
}
clang++ test.cpp -std=c++11
(08-03 06:47)
/tmp/tmp.Ro4Nz5NMoq/test-5d79a3.o: In function
`std::atomic<Simple1>::is_lock_free() const':
test.cpp:(.text._ZNKSt6atomicI7Simple1E12is_lock_freeEv[_ZNKSt6atomicI7Simple1E12is_lock_freeEv]+0x1b):
undefined reference to `__atomic_is_lock_free'
if I use -stdlib=libc++ it links successfully, it seems to be only a problem
when
using libstdc++</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>