You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's more like a question then a bugreport, but please help me understand this.
If I build my own SDL2 library for Emscripten and provide -sUSE_SDL=0 (which is the default anyway), why old SDL1 libsdl.js is pulled by default?
Yes line 146 should probably be if (USE_SDL == 1) {. In practice is probably doesn't matter since your SDL2 library will take precedence of the JS one.
I guess that also could be a problem with SDL2_image and SDL2_ttf as they are also implemented by libsdl.js.
My original issue was with SDL2_image implicitly included and hid undefined symbols, even though I provided -sUSE_SDL=0 and -sUSE_SDL_IMAGE=0.
Technically it would be SDL_image and SDL_ttf if we are talking about libsdl.js since it only implement SDL 1.2 APIs. But yes when the symbols overlap that could be an issue.
Technically it would be SDL_image and SDL_ttf if we are talking about libsdl.js since it only implement SDL 1.2 APIs. But yes when the symbols overlap that could be an issue.
Activity
sbc100 commentedon Feb 16, 2026
Yes line 146 should probably be
if (USE_SDL == 1) {. In practice is probably doesn't matter since your SDL2 library will take precedence of the JS one.I will update line 146 now..
Don't include `libsdl.js` when USE_SDL=0
sbc100 commentedon Feb 16, 2026
Fix is in #26275
Don't include `libsdl.js` when USE_SDL=0
magist3r commentedon Feb 16, 2026
I guess that also could be a problem with SDL2_image and SDL2_ttf as they are also implemented by libsdl.js.
My original issue was with SDL2_image implicitly included and hid undefined symbols, even though I provided -sUSE_SDL=0 and -sUSE_SDL_IMAGE=0.
sbc100 commentedon Feb 16, 2026
Technically it would be
SDL_imageandSDL_ttfif we are talking about libsdl.js since it only implement SDL 1.2 APIs. But yes when the symbols overlap that could be an issue.#26275 should still fix though.
Don't include `libsdl.js` when USE_SDL=0
Don't include `libsdl.js` when USE_SDL=0
Don't include `libsdl.js` when USE_SDL=0
magist3r commentedon Feb 16, 2026
I meant that both
USE_SDL_IMAGEandUSE_SDL_TTFare still =1 by default https://github.com/emscripten-core/emscripten/blob/main/src/settings.js#L1514, so withoutlibsdl.jsit won't work as expected, right?sbc100 commentedon Feb 16, 2026
Ah I see. We should set those to zero too by default.
However any user of
SDL_image.hshould be setting setting-sUSE_SDLtoo. Trying to includeSDL_image.hwithout-sUSE_SDLshould result in build error: https://github.com/emscripten-core/emscripten/blob/main/system/include/fakesdl/SDL_image.hDon't include `libsdl.js` when USE_SDL=0
Don't include `libsdl.js` when USE_SDL=0
Don't include `libsdl.js` when USE_SDL=0
magist3r commentedon Feb 16, 2026
Okay, I see. So everything should be covered then, thanks for clarifications and fixes :)
Don't include `libsdl.js` when USE_SDL=0