[libc-commits] [libc] [libc][CPP] clean up and generalize atomic implementation (PR #118996)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Fri Dec 6 09:49:35 PST 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-riscv32-qemu-yocto-fullbuild-dbg` running on `rv32gc-qemu-system` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/2011

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[2004/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.stringview_test.__unit__.__build__
[2005/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.int_seq_test.__unit__.__build__
[2006/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.mutex_test.__unit__.__build__
[2007/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.signbitl_test.__unit__.__build__.dir/signbitl_test.cpp.o
[2008/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isfinitef_test.__unit__.__build__.dir/isfinitef_test.cpp.o
[2009/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.stringstream_test.__unit__.__build__
[2010/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.optional_test.__unit__.__build__
[2011/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isinfl_test.__unit__.__build__.dir/isinfl_test.cpp.o
[2012/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isnanl_test.__unit__.__build__.dir/isnanl_test.cpp.o
[2013/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__
FAILED: projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__ 
: && /usr/local/bin/clang++ -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fuse-ld=lld -Wl,--color-diagnostics    --target=riscv32-unknown-linux-gnu -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o -o projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__  projects/libc/src/errno/CMakeFiles/libc.src.errno.errno.__internal__.dir/./libc_errno.cpp.o  projects/libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/./error_to_string.cpp.o  projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./exit.cpp.o  projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./fcntl.cpp.o  lib/libLibcDeathTestExecutors.unit.a  lib/libLibcTest.unit.a && :
ld.lld: error: undefined symbol: __atomic_load_8
>>> referenced by atomic.h:90 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:90)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:90 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:90)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced 12 more times

ld.lld: error: undefined symbol: __atomic_exchange_8
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:155 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:155)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced 22 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2014/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.span_test.__unit__.__build__
[2015/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isfinitel_test.__unit__.__build__.dir/isfinitel_test.cpp.o
[2016/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.string_test.__unit__.__build__
[2017/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.type_traits_test.__unit__.__build__
[2018/3840] Linking CXX executable projects/libc/test/src/__support/File/libc.test.src.__support.File.platform_file_test.__unit__.__build__
[2019/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.rounding_mode_test.__unit__.__build__
[2020/3840] Linking CXX executable projects/libc/test/src/__support/OSUtil/linux/libc.test.src.__support.OSUtil.linux.vdso_test.__unit__.__build__
[2021/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.creall_test.__unit__.__build__
[2022/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.crealf128_test.__unit__.__build__
[2023/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
[2024/3840] Linking CXX executable projects/libc/test/src/__support/File/libc.test.src.__support.File.file_test.__unit__.__build__
[2025/3840] Linking CXX executable projects/libc/test/src/__support/HashTable/libc.test.src.__support.HashTable.bitmask_test.__unit__.__build__
[2026/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.cimag_test.__unit__.__build__
[2027/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.creal_test.__unit__.__build__
[2028/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.crealf_test.__unit__.__build__
[2029/3840] Linking CXX executable projects/libc/test/src/__support/time/linux/libc.test.src.__support.time.linux.timeout_test.__unit__.__build__
[2030/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.fpbits_test.__unit__.__build__
[2031/3840] Linking CXX executable projects/libc/test/src/__support/threads/linux/libc.test.src.__support.threads.linux.raw_mutex_test.__unit__.__build__
[2032/3840] Linking CXX executable projects/libc/test/src/__support/HashTable/libc.test.src.__support.HashTable.table_test.__unit__.__build__
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[2004/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.stringview_test.__unit__.__build__
[2005/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.int_seq_test.__unit__.__build__
[2006/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.mutex_test.__unit__.__build__
[2007/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.signbitl_test.__unit__.__build__.dir/signbitl_test.cpp.o
[2008/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isfinitef_test.__unit__.__build__.dir/isfinitef_test.cpp.o
[2009/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.stringstream_test.__unit__.__build__
[2010/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.optional_test.__unit__.__build__
[2011/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isinfl_test.__unit__.__build__.dir/isinfl_test.cpp.o
[2012/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isnanl_test.__unit__.__build__.dir/isnanl_test.cpp.o
[2013/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__
FAILED: projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__ 
: && /usr/local/bin/clang++ -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fuse-ld=lld -Wl,--color-diagnostics    --target=riscv32-unknown-linux-gnu -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o -o projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.atomic_test.__unit__.__build__  projects/libc/src/errno/CMakeFiles/libc.src.errno.errno.__internal__.dir/./libc_errno.cpp.o  projects/libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/./error_to_string.cpp.o  projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./exit.cpp.o  projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/./fcntl.cpp.o  lib/libLibcDeathTestExecutors.unit.a  lib/libLibcTest.unit.a && :
ld.lld: error: undefined symbol: __atomic_load_8
>>> referenced by atomic.h:90 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:90)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:90 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:90)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::load(__llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced 12 more times

ld.lld: error: undefined symbol: __atomic_exchange_8
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:0 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:0)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced by atomic.h:155 (/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/src/__support/CPP/atomic.h:155)
>>>               projects/libc/test/src/__support/CPP/CMakeFiles/libc.test.src.__support.CPP.atomic_test.__unit__.__build__.dir/atomic_test.cpp.o:(__llvm_libc_20_0_0_git::cpp::Atomic<TrivialData>::exchange(TrivialData, __llvm_libc_20_0_0_git::cpp::MemoryOrder, __llvm_libc_20_0_0_git::cpp::MemoryScope))
>>> referenced 22 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2014/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.span_test.__unit__.__build__
[2015/3840] Building CXX object projects/libc/test/include/CMakeFiles/libc.test.include.isfinitel_test.__unit__.__build__.dir/isfinitel_test.cpp.o
[2016/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.string_test.__unit__.__build__
[2017/3840] Linking CXX executable projects/libc/test/src/__support/CPP/libc.test.src.__support.CPP.type_traits_test.__unit__.__build__
[2018/3840] Linking CXX executable projects/libc/test/src/__support/File/libc.test.src.__support.File.platform_file_test.__unit__.__build__
[2019/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.rounding_mode_test.__unit__.__build__
[2020/3840] Linking CXX executable projects/libc/test/src/__support/OSUtil/linux/libc.test.src.__support.OSUtil.linux.vdso_test.__unit__.__build__
[2021/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.creall_test.__unit__.__build__
[2022/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.crealf128_test.__unit__.__build__
[2023/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
[2024/3840] Linking CXX executable projects/libc/test/src/__support/File/libc.test.src.__support.File.file_test.__unit__.__build__
[2025/3840] Linking CXX executable projects/libc/test/src/__support/HashTable/libc.test.src.__support.HashTable.bitmask_test.__unit__.__build__
[2026/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.cimag_test.__unit__.__build__
[2027/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.creal_test.__unit__.__build__
[2028/3840] Linking CXX executable projects/libc/test/src/complex/libc.test.src.complex.crealf_test.__unit__.__build__
[2029/3840] Linking CXX executable projects/libc/test/src/__support/time/linux/libc.test.src.__support.time.linux.timeout_test.__unit__.__build__
[2030/3840] Linking CXX executable projects/libc/test/src/__support/FPUtil/libc.test.src.__support.FPUtil.fpbits_test.__unit__.__build__
[2031/3840] Linking CXX executable projects/libc/test/src/__support/threads/linux/libc.test.src.__support.threads.linux.raw_mutex_test.__unit__.__build__
[2032/3840] Linking CXX executable projects/libc/test/src/__support/HashTable/libc.test.src.__support.HashTable.table_test.__unit__.__build__

```

</details>

https://github.com/llvm/llvm-project/pull/118996


More information about the libc-commits mailing list