emscripten-core / emscripten-core/emscripten

LLVM out of memory error when using new pass manager (after emsdk 2.0.17)

Open
#15,072 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.