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

wasm32-wasi: Use __errno_location instead of feature(thread_local). #66

Merged
merged 1 commit into from
Jan 14, 2023

Conversation

sunfishcode
Copy link
Collaborator

Recent versions of wasi-libc provide an __errno_location function which returns the address of errno, similar to other platforms. Change the errno crate to use that, instead of using the unstable feature(thread_local).

At the moment, only Rust nightly has a new enough wasi-libc to support this, however it's not a regression because the feature(thread_local) already dependend on nightly. In the future, the newer wasi-libc will be in stable Rust too, making this work on stable.

Recent versions of wasi-libc provide an `__errno_location` function
which returns the address of errno, similar to other platforms. Change
the errno crate to use that, instead of using the unstable
`feature(thread_local)`.

At the moment, only Rust nightly has a new enough wasi-libc to support
this, however it's not a regression because the `feature(thread_local)`
already dependend on nightly. In the future, the newer wasi-libc will
be in stable Rust too, making this work on stable.
@lambda-fairy lambda-fairy merged commit b8cc39b into lambda-fairy:main Jan 14, 2023
@lambda-fairy
Copy link
Owner

Thanks!

@est31
Copy link

est31 commented Jan 29, 2023

@sunfishcode for the record this wasi update you are referring to is that this PR? That PR will be included in 1.68.0, which is already the next release.

@sunfishcode
Copy link
Collaborator Author

@est31 Yes, the wasi-libc version in that PR has the __errno_location function.

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.

3 participants