Skip to content

wasm_export.h: Use "default" visibility for gcc and clang (#3957)#4204

Closed
midokura-xavi92 wants to merge 1 commit intobytecodealliance:mainfrom
SonySemiconductorSolutions:wamr-so
Closed

wasm_export.h: Use "default" visibility for gcc and clang (#3957)#4204
midokura-xavi92 wants to merge 1 commit intobytecodealliance:mainfrom
SonySemiconductorSolutions:wamr-so

Conversation

@midokura-xavi92
Copy link
Copy Markdown
Contributor

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.

…liance#3957)

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
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.

1 participant