-
Couldn't load subscription status.
- Fork 3.4k
Description
We now have support for wasm object files in the upstream LLVM backend. This means we can optionally perform separate compilation. However we also want to be able to preserve the existing LTO support in emscripten.
Currently emscripten always outputs bitcode objects and performs some amount of "LTO" by linking with llvm-link and then running opt, in addition there is an --llvm-lto flag which will trigger additional LTO passes over the bitcode.
In order to continue to enable both bitcode objects and native object we have a new different options to choose from:
- Enable wasm object files via a specific new
-s WASM_OBJECT_FILESoption. By default we still produce bitcode objects. - Build wasm object files by default and disable with
-fltocompiler line flag which requires bitcode objects. - Re-purpose the existing --llvm-lto flag. When this flag is present build bitcode objects, otherwise default to wasm objects.
(1) is probably least disruptive and might be a good option for the initial implementation. We could later change the default and/or have the default driven by -flto