jprendes / emception

Run Emscripten in the browser
Other
285 stars 35 forks source link

Failed to run build-llvm.sh #2

Closed km19809 closed 2 years ago

km19809 commented 2 years ago

Condition: I've tried to build latest llvm, not fe2b2cb58ebb57427c0a12e54a4ed63553c397ab. So I rolled back changes by git reset and git apply. And then I run build-llvm.sh again, it failed. Error message:

FAILED: bin/clang-nvlink-wrapper.mjs

error: undefined symbol: wait4 (referenced by top-level compiled C/C++ code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _wait4 may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
em++: error: '/home/minsoo/emsdk/node/14.15.5_64bit/bin/node /home/minsoo/emsdk/upstream/emscripten/src/compiler.js /tmp/tmpw4eki2gi.txt' failed (returned 1)

Additional note: When I cloned this and ran build-with-docker.sh, it successfully built other tools but llvm-box What am I missing? Do I have to remove all the build directories and run this again?

jprendes commented 2 years ago

Hi! What version of Emscripten are you using to build LLVM?

I encountered the wait4 issue when building with Emscripten 2.0.32. Can you try building with Emscripten 2.0.31? My guess would be that the wait4 issue might be related to this change in Emscripten. But that's just a guess.

The build-with-docker.sh script uses Emscripten 2.0.31, What error are you getting in that case?

jprendes commented 2 years ago

I just finished succesfully building llvm-project at 1ed5a90f70eb04997a27026dfc2d9cae1d8cfa75 (was the latest commit about 1h ago) with Emscripten 2.0.31.

If you generated the artefacts in build/llvm with a version of Emscripten other than 2.0.31, you will need to delete it before calling build-with-docker.sh. The build-with-docker.sh script assumes the artefacts were generated with 2.0.31.

km19809 commented 2 years ago

Oh, I missed your comments in Dockerfile. I followed your instructions, then the llvm-box was built successfully. I did not test that one yet, though. Thank you.