I trying to build a clang (tag: llvmorg-14.0.0) toolchain with corresponding runtimes for x86_64-pc-linux-gnu and i386-pc-linux-gnu but I am running into some issues. The current cmake call looks like:
cmake \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=tmp_install \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
-DLLVM_RUNTIME_TARGETS="x86_64-pc-linux-gnu;i386-pc-linux-gnu" \
-DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86" \
-DLLVM_HOST_TRIPLE="x86_64-pc-linux-gnu" \
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-linux-gnu" \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \
-DLIBCXX_USE_COMPILER_RT=ON \
-DLIBCXXABI_USE_COMPILER_RT=ON \
-DLIBCXXABI_USE_LLVM_UNWINDER=ON \
-DLLVM_VERSION_SUFFIX="-1" \
-DLLVM_PARALLEL_LINK_JOBS="1" \
-DLLVM_PARALLEL_COMPILE_JOBS="4" \
-S $SRC_DIR/llvm-project/llvm \
-B $WORKSPACE_DIR/build/x86_64-pc-linux-gnu/llvm
-
The first issue is that the flags LIBCXX_USE_COMPILER_RT, LIBCXXABI_USE_LLVM_UNWINDER and LIBCXXABI_USE_LLVM_UNWINDER are not considered by the runtime builds. The cmake cache $WORKSPACE_DIR/build/x86_64-pc-linux-gnu/llvm/runtimes/runtimes-x86_64-pc-linux-gnu-bins/CMakeCache.txt contains for example LIBCXX_USE_COMPILER_RT:BOOL=OFF.
-
The second issue is that the i386-pc-linux-gnu runtime build is failing because the SANITIZER_ALLOW_CXXABI flag is on regarding the cache and that leads to some linker issues with unresolved symbols.
I would be very grateful for further help.