Debugger: cmake 3.27.0 FTBFS under raspios bullseye armv7l
cmake 3.27.0 build error under raspios bullseye (32bit) armv7l
Reproducible
Install Basesoftware under RaspOS
apt-get install i2c-tools gcc g++ make libc6-dev libcap-dev
Install cmake from source
cd /usr/local/src
wget https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0.tar.gz
cd cmake-3.27.0
mkdir cmake-build && cd cmake-build
./bootstrap --prefix=/usr/local
Error Message
[ 88%] Linking CXX executable ../bin/cmake
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `std::_Function_handler<void (void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&), dap::Session::registerHandler<cmDebugger::cmDebuggerAdapter::cmDebuggerAdapter(std::shared_ptr<cmDebugger::cmDebuggerConnection>, std::optional<std::shared_ptr<dap::Writer> >)::{lambda(dap::NextRequest const&)#10}, dap::NextRequest>(std::integral_constant::SignatureOf&&)::{lambda(void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)':
cmDebuggerAdapter.cxx:(.text+0x998): undefined reference to `__atomic_store_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `std::_Function_handler<void (void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&), dap::Session::registerHandler<cmDebugger::cmDebuggerAdapter::cmDebuggerAdapter(std::shared_ptr<cmDebugger::cmDebuggerConnection>, std::optional<std::shared_ptr<dap::Writer> >)::{lambda(dap::StepOutRequest const&)#12}, dap::StepOutRequest>(std::integral_constant::SignatureOf&&)::{lambda(void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)':
cmDebuggerAdapter.cxx:(.text+0xab8): undefined reference to `__atomic_store_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `std::_Function_handler<void (void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&), dap::Session::registerHandler<cmDebugger::cmDebuggerAdapter::cmDebuggerAdapter(std::shared_ptr<cmDebugger::cmDebuggerConnection>, std::optional<std::shared_ptr<dap::Writer> >)::{lambda(dap::DisconnectRequest const&)#14}, dap::DisconnectRequest>(std::integral_constant::SignatureOf&&)::{lambda(void const*, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, std::function<void (dap::TypeInfo const*, void const*)> const&, std::function<void (dap::TypeInfo const*, dap::Error const&)> const&)':
cmDebuggerAdapter.cxx:(.text+0xbe4): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0xc04): undefined reference to `__atomic_store_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `std::_Function_handler<void (char const*), cmDebugger::cmDebuggerAdapter::cmDebuggerAdapter(std::shared_ptr<cmDebugger::cmDebuggerConnection>, std::optional<std::shared_ptr<dap::Writer> >)::{lambda(char const*)#1}>::_M_invoke(std::_Any_data const&, char const*&&)':
cmDebuggerAdapter.cxx:(.text+0xe1c): undefined reference to `__atomic_store_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o):cmDebuggerAdapter.cxx:(.text+0xe3c): more undefined references to `__atomic_store_8' follow
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `cmDebugger::cmDebuggerAdapter::OnBeginFunctionCall(cmMakefile*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cmListFileFunction const&)':
cmDebuggerAdapter.cxx:(.text+0x24e8): undefined reference to `__atomic_load_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x2524): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x2544): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x2750): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x2770): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x2848): undefined reference to `__atomic_load_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerAdapter.cxx.o): in function `cmDebugger::cmDebuggerAdapter::cmDebuggerAdapter(std::shared_ptr<cmDebugger::cmDebuggerConnection>, std::optional<std::shared_ptr<dap::Writer> >)':
cmDebuggerAdapter.cxx:(.text+0x543c): undefined reference to `__atomic_store_8'
/usr/bin/ld: cmDebuggerAdapter.cxx:(.text+0x545c): undefined reference to `__atomic_store_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerStackFrame.cxx.o): in function `cmDebugger::cmDebuggerStackFrame::cmDebuggerStackFrame(cmMakefile*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, cmListFileFunction const&)':
cmDebuggerStackFrame.cxx:(.text+0x2c): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerVariables.cxx.o): in function `cmDebugger::cmDebuggerVariables::cmDebuggerVariables(std::shared_ptr<cmDebugger::cmDebuggerVariablesManager>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
cmDebuggerVariables.cxx:(.text+0x30f0): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerVariables.cxx.o): in function `cmDebugger::cmDebuggerVariables::cmDebuggerVariables(std::shared_ptr<cmDebugger::cmDebuggerVariablesManager>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, std::function<std::vector<cmDebugger::cmDebuggerVariableEntry, std::allocator<cmDebugger::cmDebuggerVariableEntry> > ()>)':
cmDebuggerVariables.cxx:(.text+0x32b8): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: libCMakeLib.a(cmDebuggerThreadManager.cxx.o): in function `cmDebugger::cmDebuggerThreadManager::StartThread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
cmDebuggerThreadManager.cxx:(.text+0x23c): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ../Utilities/cmcppdap/libcmcppdap.a(typeof.cpp.o): in function `(anonymous namespace)::TypeInfos::get()::Instance::~Instance()':
typeof.cpp:(.text+0xd0): undefined reference to `__atomic_fetch_sub_8'
/usr/bin/ld: ../Utilities/cmcppdap/libcmcppdap.a(typeof.cpp.o): in function `dap::initialize()':
typeof.cpp:(.text+0x6c0): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ../Utilities/cmcppdap/libcmcppdap.a(typeof.cpp.o): in function `dap::terminate()':
typeof.cpp:(.text+0x6f0): undefined reference to `__atomic_fetch_sub_8'
collect2: error: ld returned 1 exit status
make[2]: *** [Source/CMakeFiles/cmake.dir/build.make:130: bin/cmake] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:2280: Source/CMakeFiles/cmake.dir/all] Fehler 2
make: *** [Makefile:166: all] Fehler 2
I already have set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")
in the end of CMakeLists.txt
, but without success.
The latest git version also has the error but cmake 3.26.5 works