Replies: 2 comments 7 replies
-
|
You could try Can you explain what you mean by "a js file available for multiple wasm files". If you are trying to take the generated JS file for one wasm and use it with another, that is not something is supported by emscripten today. The generated JS file bakes in a bunch of assumptions about the specific wasm file it wa built for. We have had plans in the past to allow this but it won't work today. |
Beta Was this translation helpful? Give feedback.
-
|
Well, I have an API and dynamic set of wasm files, each compiled with the same emscripten setup (compiler arguments). I don't want the JavaScript to tampered with by users, but only the wasm files to be interchanged (they will be provided by users). The user compiles their wasm with an editor, using the same emscripten arguments in such in the end, but they only send the .wasm file that the browser runs. So the only thing with the .wasm files change is which imports they call, and they may not use every single api import. Using DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[func1,func2] "works", but I still have to manually change the js afterwards to include the function in the imports list manually, func1: _func1, etc. I suppose (based on your response) there's no way to turn off DCE for a specific js-library ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Edit: In the end I used .net wasi-wasm output, unbundled the component model wasm, and loaded the webassembly in the browser manually by stubbing out the wasi preview1 and preview2 (implementing some bare minimum ones for now). It's a good start, but you gotta do what you gotta do sometimes.
Hi there,
Because I'm having a js file available for multiple wasm files, but using a single js file, is there a way to always include every function from that js library? Currently they get stripped out with dead code elimination.
I've tried
DEFAULT_LIBRARY_FUNCS_TO_INCLUDEto include them, and they do include the functions as _func, but don't include them in the import list. To save me from manually adding every single file manually, is there an option to just include everything in the --js-library to imports?Beta Was this translation helpful? Give feedback.
All reactions