Open toyobayashi opened 1 day ago
It seems that DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
still works because after I removed the first line of JS library, myLibraryInit
went into missingLibrarySymbols
from unexportedSymbols
and function itself didn't exist in output JS file.
So you are looking to force the export of a symbol simply by the inclusion of a JS library? This seems like a reasonable request, but the doing it way you are seems a little dependent on emscripten internals.
Would using the -sEXPORTED_RUNTIME_METHODS
command line flag not work in this case for some reason?
Yes, I have always done this in my js libraries, because I want to control what symbols are exported as the author of the library, and if the exported symbols change in the future, it will be invisible to the users of the library, without requiring user to manually modify -sEXPORTED_RUNTIME_METHODS
OK, I'll see if I can come with an officially blessed way to do this.
Version of emscripten/emsdk:
Reproduce repository: https://github.com/toyobayashi/emscripten-exported-runtime-methods-3160-repro
Full link command and output with
-v
appended: https://github.com/toyobayashi/emscripten-exported-runtime-methods-3160-repro/actions/runs/12132338450/job/33826053152lib.c
:lib.js
:Command:
index.js
:3.1.59 output:
3.1.60 and latest 3.1.73 output: