-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Suggestion: Add way to compile only the js wrapper, and not the .wasm #8506
Comments
I don't know of any way to do this no. Why not just build he wasm file multiple times? I'm also not sure there are any guarantees that if you build for a specific environment it won't effect that wasm file also. I can't think how it would.. but its not inconceivable. Out of interest are the wasm files you are getting bit-for-bit identical? |
Good question - I'll run some tests and see. I made an assumption that they would be. It's not the end of the world, but creating this wasm file for this build (https://github.com/kripken/sql.js/pull/255) takes around 10s, and with all of these permutations, that's going to take a while: [release, debug] * [web, node, worker ] = |
Have you tried using the upstream llvm backend? In this mode your object files are ahead of time compiled so linking your final binary should be a lot faster. Also, are you rebuilding all the object files for each config or is it just linking that takes 10s? |
@sbc100 : Hey Sam, I don't think my Google-Fu is working that well this morning. I'm trying to understand how to use the LLVM backend, and I didn't find anything straightforward. I see mention of Fastcomp in a few places, but there is also talk of that being the default. Can you please point me to the appropriate place to tell me how to try the upstream LLVM backend? |
And in answer to your question, they are indeed bit-for-bit compatible when I run these two different compilation steps:
Note that the only difference is the Since the wrapper creation is currently done at the same time the wasm file is created, I could imagine a scenario where the emitted wasm was not compatible with the wrapper, or the emitted wasm was debug and the wrapper was release or vice versa. Still, the idea of being able to emit "just" a wrapper pointing to a particular wasm would be helpful for me, but I think I might be in the minority here :) |
If you'd like to create patch for this feature I think it would have good chance of being accepted. One problem is that the wrapper creation depends on the metadata about the wasm as well as the wasm file itself, so I don't think this is trivial change. Might be easier to just the linker multiple times. |
Cool - thanks @sbc100 . |
To use the llvm backend just update the LLVM in your |
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 am compiling the same .wasm file, but multiple wrappers for different environments (one for the web worker environment, another for the web/node environment). I see that I can tell emcc to only generate the wasm without the wrapper, but I don't see a way to tell it either:
A) Fetch this particular .wasm file at runtime (because WASM_BINARY_FILE is internal only)
B) Only generate the .js wrapper because I've already generated a .wasm file elsewhere.
Am I missing something? Is there a way to do this?
The text was updated successfully, but these errors were encountered: