llvm-wasm icon indicating copy to clipboard operation
llvm-wasm copied to clipboard

Doubts regarding certain flags used in the readme

Open anutosh491 opened this issue 1 year ago • 2 comments

Hi @soedirgo

I am trying to compile clang & lld to wasm using emscripten. Although I was able to build stuff (not sure everything works though for eg at runtime), I have doubts about certain flags

  1. Not sure about the use of llvm-tblgen and would appreciate clarification on this comment
# For the actual build, we need to have llvm-tblgen built for the host
cmake -G Ninja -S llvm -B build-host -DCMAKE_BUILD_TYPE=Release
cmake --build build-host --target llvm-tblgen

Which means I am not even using this flag -DLLVM_TABLEGEN=$PWD/build-host/bin/llvm-tblgen

  1. What's the use case behind this CXXFLAGS="-Dwait4=__syscall_wait4"

Would be great if you could clarify these things for me

anutosh491 avatar Oct 21 '24 07:10 anutosh491

Most of our the other flags I have been using are common with your build script so I guess these are the only ones I am not sure/clear about !

anutosh491 avatar Oct 21 '24 07:10 anutosh491

Also maybe some idea on my we need the LDFlags too would be awesome. I am building with any

This is what my build script run

 emcmake cmake ${CMAKE_ARGS} -S ../llvm -B .         \
    -DCMAKE_BUILD_TYPE=MinSizeRel                   \
    -DCMAKE_PREFIX_PATH=$PREFIX                     \
    -DCMAKE_INSTALL_PREFIX=$PREFIX                  \
    -DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten    \
    -DLLVM_TARGETS_TO_BUILD="WebAssembly"           \
    -DLLVM_INCLUDE_BENCHMARKS=OFF                   \
    -DLLVM_INCLUDE_EXAMPLES=OFF                     \
    -DLLVM_INCLUDE_TESTS=OFF                        \
    -DLLVM_ENABLE_LIBEDIT=OFF                       \
    -DLLVM_ENABLE_PROJECTS="clang;lld"              \
    -DCMAKE_VERBOSE_MAKEFILE=ON                     \
    -DLLVM_ENABLE_THREADS=OFF                       \
    -DCMAKE_CXX_FLAGS="-isystem $EMSDK_DIR/upstream/emscripten/cache/sysroot/include/c++/v1"
    ```

anutosh491 avatar Oct 21 '24 07:10 anutosh491