Skip to content

SDL2 image code somehow implicitly enables Wasm Exnref EH #25430

@juj

Description

@juj

test.c

#include <SDL2/SDL_image.h>
int main() { IMG_Load(""); }

Build with

emcc test.c -sSUPPORT_LONGJMP=wasm -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS=png -o a.html

The resulting file will have a Wasm Tag section, and the resulting file cannot be run in browsers that do not support Wasm Exnref exception handling.

(My understanding is that Tag section did not exist yet for the Wasm Legacy EH, is that right?)

Does -sSUPPORT_LONGJMP=wasm imply Wasm Exnref exception handling support? I am confused if it does, since Emscripten names Wasm Exnref exceptions as just "Wasm EH", and it is ambiguous with previous Wasm exception handling, now called Wasm Legacy EH.

Somehow SDL2_image with PNG support is leaking in a requirement of Wasm Exnref EH, and I'm not sure where it comes from.

This can be seen for example in browser tests

browser.test_sdl2_image_formats_wasm_legacy_wasmfs
browser.test_sdl2_image_formats_wasm_legacy

failing in browsers that do not support Wasm Exnref, because these tests are actually using Wasm Exnref support, and not Wasm Legacy EH.

(Seen when attempting to run browser suite in Firefox 102.15.1esr which did not yet support Wasm Exnref EH) Err, I had a mistake here. Firefox 102.15.1esr actually works, but it was the one version earlier that didn't, so:

(Seen when attempting to run browser suite in Firefox 91.13.0esr which did not yet support Wasm Exnref EH)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions