Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubts regarding certain flags used in the readme #5

Open
anutosh491 opened this issue Oct 21, 2024 · 2 comments
Open

Doubts regarding certain flags used in the readme #5

anutosh491 opened this issue Oct 21, 2024 · 2 comments

Comments

@anutosh491
Copy link

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
Copy link
Author

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
Copy link
Author

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"
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant