[llvm-bugs] [Bug 24908] New: llvm/clang using __atomic_add_fetch_8 which is not available on x86 linux

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 22 05:04:51 PDT 2015


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

            Bug ID: 24908
           Summary: llvm/clang using __atomic_add_fetch_8 which is not
                    available on x86 linux
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat test.cpp
#include <atomic>
std::atomic<uint64_t> foo;
int main() {
  ++foo;
}
$ clang++ test.cpp -o t -std=c++11  -m32
/tmp/test-c543d4.o:test.cpp:function std::__atomic_base<unsigned long
long>::operator++(): error: undefined reference to '__atomic_add_fetch_8'
clang-3.8: error: linker command failed with exit code 1 (use -v to see
invocation)

Running "g++ test.cpp -o t -std=c++11  -m32" works.

gcc produces a "lock cmpxchg8b" instead of a call.

-- 
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/20150922/a39dc0db/attachment.html>


More information about the llvm-bugs mailing list