Skip to content

SIDE_MODULE with WASM seems to have no static initializer #6369

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

Closed
mdboom opened this issue Mar 23, 2018 · 4 comments
Closed

SIDE_MODULE with WASM seems to have no static initializer #6369

mdboom opened this issue Mar 23, 2018 · 4 comments

Comments

@mdboom
Copy link
Contributor

mdboom commented Mar 23, 2018

Thanks for helping me resolve #6365. Behind that, I found another issue using SIDE_MODULE with WASM.

It appears that SIDE_MODULEs don't have static initialization data, and I'm seeing zero'd data where I would expect static values to be. (This is somewhat related to my PR #6355, but that was without WASM -- as far as I can tell that code path is irrelevant when WASM is turned on).

The resulting .wasm files for the SIDE_MODULE don't seem to contain any of the static strings I would expect. Is there maybe just some flag I need to set to output the initialization data?

I have a minimal standalone here: https://github.com/mdboom/emscripten-side-module-no-static

@dschuff
Copy link
Member

dschuff commented Mar 23, 2018

Possibly related: I discovered that #5844 broke things so that static initializers are missing when using wasm+pthreads, so it might be the case that it broke side modules too. I'm working on a fix for pthreads, I can look at side modules after I get that in.

@kripken
Copy link
Member

kripken commented Mar 23, 2018

I can't reproduce this problem (using latest incoming - what version are you on? any local changes?), I see Found static string printed and I do see Message in the .so file properly.

This would surprise me if it were broken, as we have tests for it. Does ./tests/runner.py binaryen0.test_dlfcn* binaryen0.test_dylink* pass for you locally?

@dschuff
Copy link
Member

dschuff commented Mar 23, 2018

I built a side module with #6370 applied and verified that it at least does have a data section (that was the intent of that PR).

@mdboom
Copy link
Contributor Author

mdboom commented Mar 29, 2018

Sorry for wasting time, folks. I think I had emscripten and binaryen out of sync (emscripten had been updated to a recent incoming and binaryen to an older master). Updating both and rebuilding seems to have resolved the issue. Closing.

@mdboom mdboom closed this as completed Mar 29, 2018
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

3 participants