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
Proposal to split linking part of emcc.py into emlink.py #9218
Comments
@kripken we spoke briefly about this. I've got a WIP here: https://github.com/emscripten-core/emscripten/pull/new/seperate_link |
What do you mean by "linking logic" specifically? (is it the linking of system libraries, calling of wasm-ld, js linking, and/or post-link stuff like finalize and wasm-opt that we sometimes call the "link" stage?) |
I forgot to say, I greatly like this idea!
|
All of the above I think. With the exception perhaps of selecting which system libraries to include. I'm not sure if its better to do that in emcc.py still. |
I think this is a good idea in principle. It does bring up some interesting questions about where certain bits of functionality go. For example you could argue that some of the post-linking stuff could belong logically to the link step, or belongs as a separate step invoked by emcc (or perhaps in a third wrapper, if there is a use case for separating it from both the link step and from emcc). |
If it's all of the above, then it seems like we can almost just rename Is that basically the direction here? If so that sounds good! |
In the long run you could even imagine using clang itself as the compiler driver, and invoking custom steps post-link (and/or perhaps the link wrapper instead of lld). Then we could remove all of that from emcc. There would still be a lot of compatibility flags though, so that might be undesirable unless we also want a flag reset. But we could have emcc.py just for flags and still remove compiling-c-files logic if the behavior is close enough. |
That is an intersting idea! The actuall approach I took was to basically take the bottom half of emcc.py and move it to emlink.py (basically everything after is prints "stopping at bitcode"). It seems to be mostly working. |
That sounds good to me. We do have
I see, yeah, that sounds good too - maybe the two approaches would end up pretty much the same, actually. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
I think we still want this @sbc100 ? Odd stalebot tries to close issues with someone assigned to them. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
We now have How ever I still think it would be nice to split the linker code out of the |
Today emcc.py act as both the compiler driver and the linker. In the interests of separation of concerns and in order to make emscripten more componentized I've been working on a change to put all the linking logic in emlink.py and have emcc.py call this if needed under the hood.
This change should also allow for other use cases, such as taking an externally built wasm file (from rust, or go, or kotlin, or wasi) and running emlink.py on it in order to "emscriptenize" it and create JS and html around it.
The text was updated successfully, but these errors were encountered: