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

Warn if SIDE_MODULE=1 without either EXPORT_ALL or EXPORTED_FUNCTIONS #7974

Open
Beuc opened this issue Feb 1, 2019 · 6 comments
Open

Warn if SIDE_MODULE=1 without either EXPORT_ALL or EXPORTED_FUNCTIONS #7974

Beuc opened this issue Feb 1, 2019 · 6 comments

Comments

@Beuc
Copy link
Contributor

@Beuc Beuc commented Feb 1, 2019

AFAIU, in dynamic linking a side module would be useless without either EXPORT_ALL=1 or EXPORTED_FUNCTIONS set.
Hence emcc could warn the user when neither option are present.
(I just spent forever updating a dynamic linking experiment I had done last year...)

@pmp-p
Copy link
Contributor

@pmp-p pmp-p commented Feb 2, 2019

maybe could prevent #7811

@kripken
Copy link
Member

@kripken kripken commented Feb 4, 2019

Good idea @Beuc!

The place to add this is in emcc.py, can search for SIDE_MODULE there to find the right code area.

@rpopensource7
Copy link

@rpopensource7 rpopensource7 commented Sep 2, 2019

Hi @Beuc @kripken I want to push fix to that issue and noticed that EXPORTED_FUNCTIONS by default contains Main function.
When you mean set you mean that it wont be empty or you mean it should be changed by the user to something that it isn't Main?

@Beuc
Copy link
Contributor Author

@Beuc Beuc commented Sep 2, 2019

A side module (e.g. a library .so file) isn't supposed to export _main in the first place, so SIDE_MODULE + EXPORTED_FUNCTIONS=['_main'] sounds suspicious too.
The real warning could be emitted when witnessing that the resulting .wasm file has no symbols (that would include e.g. when the user mistypes the wrong function names).

@stale
Copy link

@stale stale bot commented Sep 2, 2020

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 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Sep 2, 2020
@Beuc
Copy link
Contributor Author

@Beuc Beuc commented Sep 3, 2020

AFAICS the issue is still relevant.

@stale stale bot removed the wontfix label Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants