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

Asset loads fail #15

Closed
itowlson opened this issue Aug 14, 2022 · 2 comments · Fixed by #16
Closed

Asset loads fail #15

itowlson opened this issue Aug 14, 2022 · 2 comments · Fixed by #16

Comments

@itowlson
Copy link
Contributor

The file open calls fail because WASI sets up preopened directory mounts as part of the C runtime library load during main, and we bypass that.

According to WebAssembly/wasi-sdk#110, we should be able to pass -mexec-model=reactor to the C compiler (somewhere), though I'm not sure how this will interact if the underlying SDK compiles a main entry point.

@itowlson
Copy link
Contributor Author

The Clang args are set in the .NET WASI SDK build/Wasi.Sdk.targets. Not sure whether we can interact with those from a consumer.

@itowlson
Copy link
Contributor Author

Huh, apparently we can explicitly call __wasm_call_ctors from ensure_preinitialized and it works. YES I AM SLIGHTLY TERRIFIED BY THIS. Would be good to understand whether and how we can implement a more tool-supported approach.

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

Successfully merging a pull request may close this issue.

1 participant