-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Enable EM_JS in side modules #19705
Enable EM_JS in side modules #19705
Conversation
c823051
to
3ae2e6e
Compare
3ae2e6e
to
f9cdf62
Compare
emcc.py
Outdated
@@ -831,6 +831,7 @@ def process_dynamic_libs(dylibs, lib_dirs): | |||
for dylib in dylibs: | |||
exports = webassembly.get_exports(dylib) | |||
exports = set(e.name for e in exports) | |||
exports = [utils.removeprefix(e, '__em_js__') for e in exports] |
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.
Why remove this prefix? A comment might be good as it looks surprising here I think.
Also, it seems like keeping the prefix might avoid the risk of a conflict with something else?
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.
Added a comment.
The point of this code here is simply to decide which symbols are allowed to be undefined in the main module (i.e. which symbols will be provided by the side module). Duplicates here are not going to be problem, but I'm actually not sure what happens in the normal (non-shared) case when a symbol is exported both as a normal function and as a EM_JS function... whatever the case that would be an existing bug.
f9cdf62
to
825fef4
Compare
825fef4
to
ff5d29b
Compare
This works in a similar way to EM_ASM. See #18228. Depends on WebAssembly/binaryen#5780
ff5d29b
to
b53ba11
Compare
This was fixed in emscripten-core#19705.
This works in a similar way to EM_ASM. See #18228.
Depends on WebAssembly/binaryen#5780