-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix static wasm build without wasi #94
Conversation
@tbu- I'd prefer not to special-case WebAssembly here. Could you, instead, submit a PR to the libc crate defining off_t for WebAssembly targets? |
@joshtriplett There's no |
WASI does indeed define This is only included when targeting WASI though, not on all of WebAssembly: But WASI is just a possible environment of WebAssembly, libz also works without WASI, and in this case |
@tbu- Then in that case, can you please modify this to only apply for wasm targets with OS "unknown", but not WASI targets? |
a1488c9
to
9b1d7a6
Compare
The |
Done. Thanks for your patience and working with me. :) The CI failure is unrelated, it's a 500 error from crates.io. Should I add a CI job testing this? It works locally. |
`libc` doesn't have `off_t` for WebAssembly without WASI, so it falls back to `long`. Do the same in this crate to fix the build error when trying to statically build libz for WebAssembly. Rough code from `zconf.h` declaring `z_off_t`: ```c++ #ifndef Z_SOLO # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) // [...] # ifndef z_off_t # define z_off_t off_t # endif # endif #endif // [...] #ifndef z_off_t # define z_off_t long #endif ``` Fixes rust-lang#95.
Done. By experimenting, I found that I need |
Right, good catch. Mixed it up with |
libc
doesn't haveoff_t
for WebAssembly without WASI, so it fallsback to
long
. Do the same in this crate to fix the build error whentrying to statically build libz for WebAssembly.
Rough code from
zconf.h
declaringz_off_t
:Fixes #95.