Skip to content
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

[Feature Request] Unresolved symbol for functions, in case of wasm should get linked to a stub implementation instead of throwing link error #6326

Closed
tarun550 opened this issue Mar 9, 2018 · 4 comments
Labels

Comments

@tarun550
Copy link

tarun550 commented Mar 9, 2018

Hi,

Incase of asm.js, missing functions get "linked" to functions that call abort (please correct me if I am wrong). This strategy is great when you have just started porting a huge code base and want to see something working in the browser(if we make sure we do not hit the stub function in our workflow).

Incase of wasm output, the browser complains of a missing symbol and nothing works which makes it difficult to test wasm output.

I would like to request a flag or something similar by which this behaviour can be altered and wasm does not complain, just like asm.js output.

Thanks.

@kripken
Copy link
Member

kripken commented Mar 9, 2018

The same should happen in wasm, so you may be seeing a bug. What options are you building with? Do you have a testcase showing the problem?

@tarun550
Copy link
Author

Yes. Sorry that was my bad, I did not test with a simpler case.
Basically I have a huge project that works with asm.js but when output is wasm chrome/firefox give this error:

LinkError: WebAssembly Instantiation: Import #6 module="env" function="__XXX" error: global import must be a number

I thought that it could be due to a missing symbol, as the function is indeed missing and a warning is also generated for the same. But since it works in asm.js, shouldn't it also work in wasm?

@kripken
Copy link
Member

kripken commented Mar 19, 2018

It should work, yes, so this may be a bug in asm2wasm (the conversion from asm.js to wasm).

If you can't provide a testcase for us to reproduce the problem, you might use EMCC_DEBUG=1 in the env and look at that symbol through the temp files it emits to the temp dir.

@stale
Copy link

stale bot commented Sep 19, 2019

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.

@stale stale bot added the wontfix label Sep 19, 2019
@stale stale bot closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants