Bug #56492
openundefined reference to "__atomic_load_16" on s390x
0%
Description
On s390x, I get a build failure related to atomics.
[ 42%] Linking CXX executable ../../bin/ceph-bluestore-tool cd /builddir/build/BUILD/ceph-17.2.1/redhat-linux-build/src/os && /usr/bin/cmake -E cmake_link_script CMakeFiles/ceph-bluestore-tool.dir/link.txt --verbose=1 /usr/bin/c++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=z14 -mtune=z15 -fasynchronous-unwind-tables -fstack-clash-protection -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -rdynamic -pie CMakeFiles/ceph-bluestore-tool.dir/bluestore/bluestore_tool.cc.o -o ../../bin/ceph-bluestore-tool -Wl,-rpath,/builddir/build/BUILD/ceph-17.2.1/redhat-linux-build/lib: ../../lib/libos.a ../../lib/libglobal.a ../../lib/libblk.a /lib64/libaio.so ../../../src/liburing/src/liburing.a ../../lib/libkv.a ../../lib/libheap_profiler.a /lib64/libtcmalloc.so ../rocksdb/librocksdb.a /lib64/libsnappy.so /usr/lib64/liblz4.so /usr/lib64/libz.so /usr/lib64/libfuse.so ../../lib/libceph-common.so.2 ../../lib/libjson_spirit.a ../../lib/libcommon_utf8.a ../../lib/liberasure_code.a ../../lib/libcrc32.a ../../lib/libarch.a ../../boost/lib/libboost_thread.a ../../boost/lib/libboost_chrono.a ../../boost/lib/libboost_atomic.a ../../boost/lib/libboost_system.a ../../boost/lib/libboost_random.a ../../boost/lib/libboost_program_options.a ../../boost/lib/libboost_date_time.a ../../boost/lib/libboost_iostreams.a ../../boost/lib/libboost_regex.a /usr/lib64/libblkid.so /usr/lib64/libcrypto.so /usr/lib64/libudev.so /usr/lib64/libibverbs.so /usr/lib64/librdmacm.so /usr/lib64/libz.so -ldl /usr/lib64/librt.a -lresolv make[2]: Leaving directory '/builddir/build/BUILD/ceph-17.2.1/redhat-linux-build' /usr/bin/ld: /tmp/ccrFZZvJ.ltrans64.ltrans.o: in function `boost::lockfree::queue<void*>::~queue()': /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /tmp/ccrFZZvJ.ltrans64.ltrans.o: in function `bool boost::lockfree::queue<void*>::pop<void*>(void*&)': /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:323: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:323: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:355: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /tmp/ccrFZZvJ.ltrans64.ltrans.o: in function `HugePagePoolOfPools::from_desc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:323: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /tmp/ccrFZZvJ.ltrans72.ltrans.o: in function `bool boost::lockfree::queue<void*>::do_push<false>(void* const&) [clone .isra.0]': /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:323: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:271: undefined reference to `__atomic_store_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:285: undefined reference to `__atomic_load_16' /usr/bin/ld: /usr/include/c++/11/atomic:355: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:323: undefined reference to `__atomic_compare_exchange_16' /usr/bin/ld: /usr/include/c++/11/atomic:355: undefined reference to `__atomic_compare_exchange_16' collect2: error: ld returned 1 exit status make[2]: *** [src/os/CMakeFiles/ceph-bluestore-tool.dir/build.make:132: bin/ceph-bluestore-tool] Error 1 make[1]: *** [CMakeFiles/Makefile2:6990: src/os/CMakeFiles/ceph-bluestore-tool.dir/all] Error 2
I do note that HAVE_CXX11_ATOMIC
is different between pacific and quincy:
v16.2.8 on RHEL 9:
-- Performing Test HAVE_CXX11_ATOMIC -- Performing Test HAVE_CXX11_ATOMIC - Failed -- Performing Test HAVE_LIBATOMIC -- Performing Test HAVE_LIBATOMIC - Success
v17.2.1 on RHEL 9:
-- Performing Test HAVE_CXX11_ATOMIC -- Performing Test HAVE_CXX11_ATOMIC - Success
Possibly a problem with this change? https://github.com/ceph/ceph/pull/44264 - EDIT: nevermind, that is in main
, not in v17.2.1
.
Updated by Ronen Friedman almost 2 years ago
not a solution to the root problem, but what worked for me was 'dnf install' of libatomic
Updated by Kaleb KEITHLEY almost 2 years ago
see https://tracker.ceph.com/issues/54514 and https://github.com/ceph/ceph/pull/45339.
But note that I later switched to https://github.com/ceph/ceph/pull/44264 to build 17.2.x on Fedora rawhide.
Updated by Ken Dreyer almost 2 years ago
Thanks Kaleb.
Even when I add "BuildRequires: libatomic" to ceph.spec so that libatomic-11.2.1-9.4.el9 is in the buildroot, it still fails with the same error.
Do we need to backport https://github.com/ceph/ceph/pull/44264 to quincy, then?
Updated by Ken Dreyer almost 2 years ago
0019-cmake-modules-CheckCxxAtomic.cmake.patch
in Fedora has one additional line that was not in https://github.com/ceph/ceph/pull/44264:
void atomic16(std::atomic<tagged_ptr> *ptr) __attribute__ ((used));
Updated by Ken Dreyer almost 2 years ago
In conclusion, we need the following changes:
void atomic16(std::atomic<tagged_ptr> *ptr) __attribute__ ((used));
(which is slightly different than https://github.com/ceph/ceph/pull/45339)BuildRequires: libatomic
inceph.spec
... and then HAVE_CXX11_ATOMIC
properly fails on s390x, and we fall back to HAVE_LIBATOMIC
.
-- Performing Test HAVE_CXX11_ATOMIC -- Performing Test HAVE_CXX11_ATOMIC - Failed -- Performing Test HAVE_LIBATOMIC -- Performing Test HAVE_LIBATOMIC - Success
and the build completes.
So we need to put those changes upstream in CheckCxxAtomic.cmake
on the main
branch. For quincy, we need to backport PR 44264, plus those changes.
Updated by Ken Dreyer almost 2 years ago
- Status changed from New to In Progress
- Assignee set to Ken Dreyer
- Backport set to quincy
- Pull request ID set to 47153
Updated by Ken Dreyer almost 2 years ago
- Is duplicate of Bug #54514: build: LTO can cause false positives in cmake tests resulting in build failures added
Updated by Ken Dreyer over 1 year ago
- Status changed from In Progress to Pending Backport
Updated by Ken Dreyer over 1 year ago
quincy backport in https://github.com/ceph/ceph/pull/48263
Updated by Backport Bot over 1 year ago
- Copied to Backport #57684: quincy: undefined reference to "__atomic_load_16" on s390x added