emscripten-core / emscripten-core/emscripten
LLVM out of memory error when using new pass manager (after emsdk 2.0.17)
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I am using the ninja build system with emscripten. I am able to build my projects successfully with emsdk 2.0.15 and ninja JOB_POOLS_LINK property set to 6 (i.e. max 6 parallel link processes).
However, after upgrading to 2.0.17+, wasm-ld throws `LLVM : out of memory exception` OR the build process terminates with `SIGKILL -9`
In this case, I am able to build my projects only if the ninja JOB_POOL_LINK property is set to 2 (i.e. max 2 parallel link processes).
Any more than 2 parallel link processes and I get the `out of memory` error.
I observed that using the `-Wl, --lto-legacy-pass-manager` linker option resolves this issue. I also noticed that the LLVM legacy pass manager was the default setting till 2.0.15, but it was changed to the new LLVM pass manager in 2.0.17.
It seems like the new LLVM pass manager is causing increased memory consumption when parallel linker processes are run.
Contributor guide
Assessment
This issue has not been assessed yet.