Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 29, 2022

The EMSCRIPTEN_KEEPALIVE macro relies on attribute((used)) which
works slightly differently under emscripten
(wasm32-unknown-emscripten) compared to other triples.

This change avoids EMSCRIPTEN_KEEPALIVE here in favor of the
export_name attribute which is more precise and correct although not
(yet) suitable for us in EMSCRIPTEN_KEEPALIVE itself (We would need
something like https://reviews.llvm.org/D76547 to make that work).

@sbc100 sbc100 requested a review from kripken January 29, 2022 19:44
@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 29, 2022

Looks like this requires an llvm-side changes since export_name is not currently supported for non-function symbols.

…S` macro

The `EMSCRIPTEN_KEEPALIVE` macro relies on `attribute((used))` which
works slightly differently under emscripten
(`wasm32-unknown-emscripten`) compared to other triples.

This change avoids `EMSCRIPTEN_KEEPALIVE` here in favor of the
`export_name` attribute which is more precise and correct although not
(yet) suitable for us in `EMSCRIPTEN_KEEPALIVE` itself (We would need
something like https://reviews.llvm.org/D76547 to make that work).
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan sgtm

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.

3 participants