Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSPI and dynamic linking messed up by stub trampoline #23395

Open
hoodmane opened this issue Jan 14, 2025 · 0 comments
Open

JSPI and dynamic linking messed up by stub trampoline #23395

hoodmane opened this issue Jan 14, 2025 · 0 comments

Comments

@hoodmane
Copy link
Collaborator

The dynamic linking code will generate a stub if it's not resolved when first imported:

          // Return a stub function that will resolve the symbol
          // when first called.
          if (!(prop in stubs)) {
            var resolved;
            stubs[prop] = (...args) => {
              resolved ||= resolveSymbol(prop);
              return resolved(...args);
            };
          }

https://github.com/emscripten-core/emscripten/blob/main/src/library_dylink.js?plain=1#L724-L727
This causes trouble when mixed with stack switching. Working around it will be a bit convoluted, but it should be possible with a little helper wasm module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant