Skip to content

No EXPORT_ALL by default in main modules #7312

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

Closed
wants to merge 2 commits into from
Closed

Conversation

kripken
Copy link
Member

@kripken kripken commented Oct 18, 2018

Do not automatically set EXPORT_ALL for MAIN_MODULEs. This means that if your side modules want to call something from the main module, the main module must either export it (normally, on EXPORTED_FUNCTIONS), or you can manually enable EXPORT_ALL yourself.

This is a breaking change, and documented in the changlog, but it's hard to show a useful error message when a problem occurs in practice. Let's discuss if this is worth doing or not. My guess is that there are few users of dynamic linking currently, and a few of them have requested this change, so it might be worth doing.

Partially fixes #5586. There are still many other exports, due to how function pointers work currently, I think.

… if your side modules want to call something from the main module, the main module must either export it (normally, on EXPORTED_FUNCTIONS), or you can manually enable EXPORT_ALL yourself. fixes #5586
@kripken
Copy link
Member Author

kripken commented Oct 18, 2018

Ah, so what's going on is that this removes the extra JS exports, but the JSBackend adds all functions to Exports internally, for a shared module. So we'd need to change fastcomp to modify that. Trying with that change, quite a lot of dynamic linking tests break. That might require a new option perhaps.

@kripken
Copy link
Member Author

kripken commented Oct 20, 2018

See also #7319. We should do that stuff first before getting to this.

@kripken
Copy link
Member Author

kripken commented Oct 23, 2018

Closing in favor of #7371

@kripken kripken closed this Oct 23, 2018
@kripken kripken deleted the noexportinmain branch April 2, 2019 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WASM shared modules export unnecessary symbols even with -s MAIN_MODULE 2
1 participant