I get cmake/modules/CheckAtomic.cmake:59
Host compiler appears to require libatomic, but cannot find it.
I think this is either a bug in CMake or LLVM’s Linker. I’m using the WASI-SDK from here.
This is while trying to cross-compile LLVM 13 for WASI using the following command line:
cmake ../../../3rdParty/llvm-project/llvm -G "Ninja" -DWASI_SDK_PREFIX=/opt/wasi-sdk --toolchain=/opt/wasi-sdk/share/cmake/wasi-sdk.cmake -DCMAKE_C_FLAGS="--sysroot=/opt/wasi-sdk/share/wasi-sysroot -mno-atomics" -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="WebAssembly" -DLLVM_USE_HOST_TOOLS:BOOL=ON -DCMAKE_HOST_SYSTEM_NAME="Linux" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../../3rdParty/llvm-wasi/debug -DCMAKE_CROSSCOMPILING_EMULATOR="wasmer" -DLLVM_INSTALL_UTILS=ON -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PLUGINS=ON -DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_REQUIRES_RTTI=ON -DLLVM_ENABLE_PIC=ON -DLLVM_ENABLE_THREADS=OFF
Edit
Cross-posted to the LLVM Discourse.