[llvm-bugs] [Bug 47123] New: lld fails to build on targets that need -latomic

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 11 14:43:31 PDT 2020


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

            Bug ID: 47123
           Summary: lld fails to build on targets that need -latomic
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jistone at redhat.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

In Rust CI, while trying to upgrade to LLVM 11 rc1, arm-unknown-linux-gnueabi
failed to link lld due to missing symbols for Timer.cpp:

https://github.com/rust-lang/rust/pull/73526#issuecomment-671549737

> [100%] Linking CXX executable ../../bin/lld
> /x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/8.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: ../../lib/liblldCommon.a(Timer.cpp.o): in function `lld::ScopedTimer::stop()':
> Timer.cpp:(.text._ZN3lld11ScopedTimer4stopEv+0x44): undefined reference to `__atomic_fetch_add_8'
> /x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/8.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: ../../lib/liblldCommon.a(Timer.cpp.o): in function `lld::Timer::millis() const':
> Timer.cpp:(.text._ZNK3lld5Timer6millisEv+0x8): undefined reference to `__atomic_load_8'
> /x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/8.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: ../../lib/liblldCommon.a(Timer.cpp.o): in function `lld::Timer::print(int, double, bool) const':
> Timer.cpp:(.text._ZNK3lld5Timer5printEidb+0x2c0): undefined reference to `__atomic_load_8'
> /x-tools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/8.3.0/../../../../arm-unknown-linux-gnueabi/bin/ld: ../../lib/liblldCommon.a(Timer.cpp.o): in function `lld::Timer::print()':
> Timer.cpp:(.text._ZN3lld5Timer5printEv+0x34): undefined reference to `__atomic_load_8'

This can be solved by linking libatomic on targets that need it. I've tried to
add this in https://reviews.llvm.org/D85691, but it seems that the use of
atomics for Timer at all is controversial.

-- 
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/20200811/bf1ae223/attachment.html>


More information about the llvm-bugs mailing list