-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Version of emscripten/emsdk: 3.1.31
We had a big discussion in #17911 and I think it would be great to talk about that again. The current solution to export symbols on Module with MINIMAL_RUNTIME+MODULARIZE is to use EXPORT_ALL (added in the linked PR). However, this is also going to export internal library symbols, which is most likely not wanted.
Some of the ideas that were added in the PR:
- Create a new
EMSCRIPTEN_EXPORTmacro - Create a new flag
EXPORT_KEEPALIVE
From what I remember, EMSCRIPTEN_EXPORT required a patch to LLVM, so I would vote for the second solution. If I am correct, the solution would be to take all kept alive symbols and to append it to EXPORTED_FUNCTIONS. AFAIK, this should just work because EXPORTED_FUNCTIONS is used here:
Line 424 in fbc5d5c
| contentText += `\nModule["${mangled}"] = ${mangled};`; |
Am I correct? If you are happy with the idea, I can start implementing it, maybe with some guidelines.