-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Support for separate compilation with LLVM backend #6830
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
Comments
I think we'd like to wind up in a world where we build object files by default, but we don't need to land there immediately. |
First of all, this is great! :) I don't have strong feelings here either way. Keeping flags consistent with current behavior seems nice for migrating to the wasm backend by default more easily, but on the other hand if we're going to change the meaning of flags later on, that could also be surprising. It might be less work to not change things later again, so I guess I'd have a slight preference for that (option 2). Regarding LLVM LTO passes, currently we don't run LLVM LTO passes by default because historically they've had bugs, increased code size, and been slow. Those might no longer be the case. Regardless though, I think it's worth supporting 3 modes, a. wasm object files are linked, can't do LLVM LTO The middle mode may not be that important in general, but for comparisons to the asm.js backend it could help us in debugging. Maybe in the wasm backend we'd do (a) or (c) by default (that is, the same behavior as native), and optionally |
I'm gonna close this for now since we do support it. We can open a new issue for making it the default perhaps. |
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 runningopt
, 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:
-s WASM_OBJECT_FILES
option. By default we still produce bitcode objects.-flto
compiler line flag which requires bitcode 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
The text was updated successfully, but these errors were encountered: