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

Preliminary fixes and improvements to the wasm backend #812

Open
wants to merge 3 commits into
base: dev-slice
Choose a base branch
from

Conversation

TerrorJack
Copy link

The wasm backend seems to have bitrotted a bit, I couldn't get it to compile in the latest dev-slice branch, so I did some preliminary fixes and improvements. Summary of changes:

  • Making the wasm prim.c compile again by adding missing includes and moving a few helper functions around.
  • Use the __wasm__ macro uniformly across the codebase. This is better than __wasi__ since the linear memory characteristics really are not wasi-specific, and this macro works out of the box for both emscripten and wasi-sdk.
  • Remove redundant __builtin_wasm_memory_grow logic in the wasm backend. We always use sbrk for wasm at the moment, which works fine as long as the argument is a multiple of wasm page size.
  • Use getentropy to fix the random buffer source for the wasm backend. getentropy is present in the sysroots of both emscripten and wasi-sdk.

@TerrorJack
Copy link
Author

@microsoft-github-policy-service agree

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 this pull request may close these issues.

1 participant