emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Question: -sMAIN_MODULE=1 and -sEXPORTED_FUNCTIONS warning no longer valid?

Open hoodmane opened this issue 1 year ago • 3 comments

After #21785 was merged, only things with EMSCRIPTEN_KEEPALIVE are exported. This is problematic if we want to export symbols from libraries. It seems to work to put the library symbols that we wish to export into -sEXPORTED_FUNCTIONS= but we get a warning:

em++: warning: EXPORTED_FUNCTIONS is not valid with LINKABLE set (normally due 
to SIDE_MODULE=1/MAIN_MODULE=1) since all functions are exported this mode.  
To export only a subset use SIDE_MODULE=2/MAIN_MODULE=2 [-Wunused-command-line-argument]

Should this warning be removed now?

hoodmane avatar Apr 26 '24 15:04 hoodmane

Sorry yes, I believe that warning is no longer valid and we should allow -sEXPORTED_FUNCTIONS in this case.

sbc100 avatar Apr 26 '24 19:04 sbc100

BTW are you referring to symbols in the main module or symbols in the side module?

sbc100 avatar Apr 26 '24 19:04 sbc100

Symbols in the main module.

hoodmane avatar Apr 27 '24 12:04 hoodmane