[wasi-common]: add armv7 support to wasi-common (#1269)
* Add armv7 support to wasi-common This commit enables `target_pointer_width = 32` compatibility for `wasi-common` (and by transitivity, any crate found inside, e.g., `yanix`). I've also added a simplistic (bare minimum) check to our CI to ensure that `wasi-common` cross-compiles to `armv7-unknown-gnueabihf` fine. While here, I've done the same for `wasm32-unknown-emscripten`. * Clean arch-specific impls + reuse libc consts * Make SeekLoc::from_raw platform independent * Collapse CI cc jobs into one
This commit is contained in:
@@ -57,10 +57,3 @@ impl EntryExt for Entry {
|
||||
Ok(self.0.loc)
|
||||
}
|
||||
}
|
||||
|
||||
impl SeekLoc {
|
||||
pub unsafe fn from_raw(loc: i64) -> Result<Self> {
|
||||
let loc = loc.into();
|
||||
Ok(Self(loc))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,34 +2,11 @@
|
||||
//! with setting the file times specific to BSD-style *nixes.
|
||||
use crate::filetime::FileTime;
|
||||
use crate::from_success_code;
|
||||
use cfg_if::cfg_if;
|
||||
use std::ffi::CStr;
|
||||
use std::fs::File;
|
||||
use std::io::Result;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(any(
|
||||
target_os = "macos",
|
||||
target_os = "freebsd",
|
||||
target_os = "ios",
|
||||
target_os = "dragonfly"
|
||||
))] {
|
||||
pub(crate) const UTIME_NOW: i64 = -1;
|
||||
pub(crate) const UTIME_OMIT: i64 = -2;
|
||||
} else if #[cfg(target_os = "openbsd")] {
|
||||
// These are swapped compared to macos, freebsd, ios, and dragonfly.
|
||||
// https://github.com/openbsd/src/blob/master/sys/sys/stat.h#L187
|
||||
pub(crate) const UTIME_NOW: i64 = -2;
|
||||
pub(crate) const UTIME_OMIT: i64 = -1;
|
||||
} else if #[cfg(target_os = "netbsd" )] {
|
||||
// These are the same as for Linux.
|
||||
// http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/stat.h?rev=1.69&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
|
||||
pub(crate) const UTIME_NOW: i64 = 1_073_741_823;
|
||||
pub(crate) const UTIME_OMIT: i64 = 1_073_741_822;
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper for `utimensat` syscall, however, with an added twist such that `utimensat` symbol
|
||||
/// is firstly resolved (i.e., we check whether it exists on the host), and only used if that is
|
||||
/// the case. Otherwise, the syscall resorts to a less accurate `utimesat` emulated syscall.
|
||||
|
||||
Reference in New Issue
Block a user