-
Notifications
You must be signed in to change notification settings - Fork 637
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
wasm_export.h: Use "default" visibility #3957
Conversation
Since the top-level CMakelists.txt is appending -fvisibility=hidden to the compile options, no public symbols are exported by default. This forbids users from linking against the shared library. Using gcc/clang attributes [1], it is possible to override the definition for WASM_RUNTIME_API_EXTERN so that only required symbols are correctly exported. [1]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
95eec87
to
ef9a4cc
Compare
Please review the changes at #3655. I trust you'll find the information useful. |
Despite these concerns, I have successfully built this branch i.e., without any undefined references. Is there anything else I should take into account? As far as I understand, functions such as |
@bnason-nf @yamt Please review this. Ensure that it does not conflict with your previous plans. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the heads up @lum1n0us. I think this should be ok, but I would need to test more to be sure. I think it's fine to merge and we can revisit later if it causes any problems for me. |
honestly speaking, i don't remember the previous discussion well. @midokura-xavi92 if you care these stuff, you might want to improve the CI coverage. |
Since the top-level
CMakelists.txt
is appending-fvisibility=hidden
to the compile options, no public symbols are exported by default. This forbids users from linking against the shared library.Using
gcc
/clang
attributes 1, it is possible to override the definition forWASM_RUNTIME_API_EXTERN
so that only required symbols are correctly exported.