[llvm-bugs] [Bug 34044] New: undefined reference to '__atomic_is_lock_free' with libstdc++

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 3 06:49:50 PDT 2017


            Bug ID: 34044
           Summary: undefined reference to '__atomic_is_lock_free' with
           Product: clang
           Version: 5.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: raj.khem at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

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':
undefined reference to `__atomic_is_lock_free'

if I use -stdlib=libc++ it links successfully, it seems to be only a problem
using libstdc++

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/20170803/5c8bc39c/attachment.html>

More information about the llvm-bugs mailing list