Skip to content

Commit 996e362

Browse files
committed
Fix source binds for wasm32-linux-musl
1 parent 7e10829 commit 996e362

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

src/unix/linux_like/linux/arch/generic/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ cfg_if! {
232232
target_arch = "aarch64",
233233
target_arch = "s390x",
234234
target_arch = "loongarch64",
235-
all(target_arch = "wasm32", target_vendor = "wali64")))] {
235+
target_arch = "wasm32"))] {
236236
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
237237
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
238238
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;

src/unix/linux_like/linux/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5624,15 +5624,15 @@ extern "C" {
56245624

56255625

56265626
// Syscall libc stub for non Wasm32-WALI targets
5627-
// In Wasm32-WALI, all syscalls are name-bound and typed.
5627+
// In wasm32-linux, all syscalls are name-bound and typed.
56285628
// The 'syscall' implementation from C library is avoided since
56295629
// higher level libraries do not explicitly typecast arguments to
56305630
// 64-bit register sizes, which is expected of C variadic arguments.
5631-
// To overcome this, a wrapper 'syscall' method is implemented in the
5632-
// WALI specific module, which binds the syscall types statically
5633-
// at compile time and binds their numbers at runtime
5631+
// To overcome this, a wrapper 'syscall' method is implemented,
5632+
// which binds the syscall types statically at compile time
5633+
// and binds their numbers at runtime
56345634
cfg_if!(
5635-
if #[cfg(not(all(target_arch = "wasm32", target_vendor = "wali64")))] {
5635+
if #[cfg(not(target_arch = "wasm32"))] {
56365636
extern "C" {
56375637
pub fn syscall(num: ::c_long, ...) -> ::c_long;
56385638
}

src/unix/linux_like/linux/musl/b64/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ cfg_if! {
160160
} else if #[cfg(any(target_arch = "loongarch64"))] {
161161
mod loongarch64;
162162
pub use self::loongarch64::*;
163-
} else if #[cfg(all(target_arch = "wasm32", target_vendor = "wali64"))] {
163+
} else if #[cfg(any(target_arch = "wasm32"))] {
164164
mod wasm32;
165165
pub use self::wasm32::*;
166166
} else {

src/unix/linux_like/linux/musl/b64/wasm32/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,9 @@ pub const TOSTOP: ::tcflag_t = 0x00000100;
912912
pub const FLUSHO: ::tcflag_t = 0x00001000;
913913

914914

915-
cfg_if! {
916-
if #[cfg(target_vendor = "wali64")] {
917-
/* Aliases to syscall constants */
918-
pub const SYS_fadvise: ::c_long = SYS_fadvise64;
919-
920-
mod syscalls_wali;
921-
pub use self::syscalls_wali::*;
922-
}
923-
}
915+
/* Aliases to syscall constants */
916+
pub const SYS_fadvise: ::c_long = SYS_fadvise64;
924917

918+
/* WebAssembly Linux Interface (WALI) syscall specification */
919+
mod syscalls_wali;
920+
pub use self::syscalls_wali::*;

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,8 @@ cfg_if! {
919919
target_arch = "s390x",
920920
target_arch = "riscv64",
921921
target_arch = "loongarch64",
922-
all(target_arch = "wasm32", target_vendor = "wali64")))] {
922+
// wasm32-linux uses the WALI specification with 64-bit struct layout
923+
target_arch = "wasm32"))] {
923924
mod b64;
924925
pub use self::b64::*;
925926
} else if #[cfg(any(target_arch = "x86",

0 commit comments

Comments
 (0)