facing issue for building llvm-clang cross tool chain for arm target

Hi All,

I am building llvm-clang cross tool chain for arm target and getting below error message when I tried to execute below command :

Command :
#CC=‘clang’ CXX=‘clang++’ cmake -G Ninja /home/iiita/crossbuild/llvm -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/home/iiita/crossbuild/build -DLLVM_TABLEGEN=/home/iiita/llvm-3.8/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/home/iiita/llvm-3.8/build/bin/clang-tblgen -DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS=‘-target armv7a-linux-gnueabihf -mcpu=cortex-a9 -I/usr/arm-linux-gnueabihf/include/c++/4.7.3/arm-linux-gnueabihf/ -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard -ccc-gcc-name arm-linux-gnueabihf-gcc’

Error message :

– Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed

– Looking for __atomic_fetch_add_4 in atomic
– Looking for __atomic_fetch_add_4 in atomic - found
– Performing Test HAVE_CXX_ATOMICS_WITH_LIB - Failed
CMake Error at cmake/modules/CheckAtomic.cmake:33 (message):
Host compiler must support std::atomic!
Call Stack (most recent call first):
cmake/config-ix.cmake:296 (include)
CMakeLists.txt:407 (include)

– Configuring incomplete, errors occurred!
See also “/home/iiita/crossbuild/build/CMakeFiles/CMakeOutput.log”.
See also “/home/iiita/crossbuild/build/CMakeFiles/CMakeError.log”.

Does this build issue because of external library not installed or LLVM itself has issue with arm support?


Hi Bala,

LLVM does not have issues with ARM support. Cross compilation is not a
trivial matter. I'm trying to help you on the other thread, let's keep
the discussion there.