[compiler-rt] [libcxx] [libcxxabi] [libunwind] [libunwind][libcxx][libcxxabi][compiler-rt-builtins] Fix Exception Handling build for wasm (PR #79667)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 1 12:20:05 PDT 2024
trcrsired wrote:
@EricWF You need to build it with wasi-libc
```cpp
mkdir -p "$CURRENTTRIPLEPATH/build/runtimes"
cd $CURRENTTRIPLEPATH/build/runtimes
cmake $LLVMPROJECTPATH/runtimes \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_ASM_COMPILER=clang \
-DCMAKE_SYSROOT=$SYSROOTPATH -DCMAKE_INSTALL_PREFIX=$RUNTIMESINSTALLPATH \
-DCMAKE_C_COMPILER_TARGET=$TARGETTRIPLE -DCMAKE_CXX_COMPILER_TARGET=$TARGETTRIPLE -DCMAKE_ASM_COMPILER_TARGET=$TARGETTRIPLE \
-DCMAKE_C_COMPILER_WORKS=On -DCMAKE_CXX_COMPILER_WORKS=On -DCMAKE_ASM_COMPILER_WORKS=On \
-DCMAKE_SYSTEM_PROCESSOR=$TARGETTRIPLE_CPU \
-DCMAKE_SYSTEM_NAME=Generic \
-DLLVM_ENABLE_RUNTIMES=$EHBUILDLIBS \
-DLIBCXXABI_SILENT_TERMINATE=On \
-DLIBCXX_CXX_ABI=libcxxabi \
-DLIBCXX_ENABLE_SHARED=Off \
-DLIBCXX_ABI_VERSION=1 \
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="${LLVMPROJECTPATH}/libcxxabi/include" \
${THREADS_FLAGS} \
-DLIBCXX_ENABLE_EXCEPTIONS=${ENABLE_EH} \
-DLIBCXXABI_ENABLE_EXCEPTIONS=${ENABLE_EH} \
-DLIBCXX_ENABLE_RTTI=${ENABLE_EH} \
-DLIBCXXABI_ENABLE_RTTI=${ENABLE_EH} \
-DLLVM_ENABLE_ASSERTIONS=Off -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_ENABLE_BACKTRACES=Off -DLLVM_INCLUDE_TESTS=Off -DLIBCXX_INCLUDE_BENCHMARKS=Off \
-DLIBCXX_ENABLE_SHARED=Off -DLIBCXXABI_ENABLE_SHARED=Off \
-DLIBUNWIND_ENABLE_SHARED=Off ${EH_FLAGS}
ninja
ninja install/strip
```
https://github.com/llvm/llvm-project/pull/79667
More information about the cfe-commits
mailing list