-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
EM_JS functions can only be called from the files in which they're defined #18927
Comments
Thanks for filing this. I agree we need to figure this one out. I think we can probably find a way to make (1) work. |
Investigating this I noticed that this only happens if there are no references to the EM_JS function withing the same file in which it is declared. As long as there is at least one file-local caller than all the other call sites in the program work just fine. |
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. Fixes: #18927
I founds a fairly straight forward fix: #18928 |
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. This use case was broken by the switch to LLD_REPORT_UNDEFINED in #16003. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. This use case was broken by the switch to LLD_REPORT_UNDEFINED in #16003. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. This use case was broken by the switch to LLD_REPORT_UNDEFINED in #16003. Fixes: #18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. This use case was broken by the switch to LLD_REPORT_UNDEFINED in emscripten-core#16003. Fixes: emscripten-core#18927
When no local usage of an EM_JS function is present the compiler was completely removing the import of the function (and its import_name). With this change we force at least one reference to the function by taking its address in an otherwise unused (and GC-able) pointer. This use case was broken by the switch to LLD_REPORT_UNDEFINED in emscripten-core#16003. Fixes: emscripten-core#18927
Just posting as a new issue so it doesn't get forgotten...
Originally posted by @sbc100 in #16003 (comment)
There seems to be two options:
The text was updated successfully, but these errors were encountered: