From b9373257bf09f5c25d9eaa437a76352b286f78b1 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 2 Dec 2023 07:59:14 +0000 Subject: [PATCH] CI ? --- ci/ci.sh | 1 + src/shims/unix/foreign_items.rs | 3 ++- src/shims/unix/solarish/foreign_items.rs | 4 +++- tests/pass-dep/shims/libc-misc.rs | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ci/ci.sh b/ci/ci.sh index 67835960bd..964bc983e0 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -143,6 +143,7 @@ case $HOST_TARGET in # Partially supported targets (tier 2) MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align num_cpus MIRI_TEST_TARGET=i686-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align num_cpus + MIRI_TEST_TARGET=x86_64-unknown-illumos run_tests_minimal libc-misc concurrency/simple pthread-threadname libc-getentropy libc-getrandom MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic MIRI_TEST_TARGET=wasm32-wasi run_tests_minimal no_std integer strings wasm MIRI_TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std integer strings wasm diff --git a/src/shims/unix/foreign_items.rs b/src/shims/unix/foreign_items.rs index 0c498a32de..35dd77afe0 100644 --- a/src/shims/unix/foreign_items.rs +++ b/src/shims/unix/foreign_items.rs @@ -594,7 +594,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { } "getentropy" => { // This function is non-standard but exists with the same signature and behavior on - // Linux, macOS, and FreeBSD. + // Linux, macOS, FreeBSD and Solaris/Illumos. if !matches!(&*this.tcx.sess.target.os, "linux" | "macos" | "freebsd" | "illumos" | "solaris") { throw_unsup_format!( "`getentropy` is not supported on {}", @@ -611,6 +611,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { // FreeBSD: https://man.freebsd.org/cgi/man.cgi?query=getentropy&sektion=3&format=html // Linux: https://man7.org/linux/man-pages/man3/getentropy.3.html // macOS: https://keith.github.io/xcode-man-pages/getentropy.2.html + // Solaris/Illumos: https://illumos.org/man/3C/getentropy if bufsize > 256 { let err = this.eval_libc("EIO"); this.set_last_error(err)?; diff --git a/src/shims/unix/solarish/foreign_items.rs b/src/shims/unix/solarish/foreign_items.rs index 584527f568..066581a4ef 100644 --- a/src/shims/unix/solarish/foreign_items.rs +++ b/src/shims/unix/solarish/foreign_items.rs @@ -16,7 +16,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { link_name: Symbol, abi: Abi, args: &[OpTy<'tcx, Provenance>], - dest: &PlaceTy<'tcx, Provenance>, + dest: &MPlaceTy<'tcx, Provenance>, ) -> InterpResult<'tcx, EmulateForeignItemResult> { let this = self.eval_context_mut(); match link_name.as_str() { @@ -51,6 +51,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { )?; this.write_scalar(res, dest)?; } + + // Misc "getrandom" => { let [ptr, len, flags] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?; diff --git a/tests/pass-dep/shims/libc-misc.rs b/tests/pass-dep/shims/libc-misc.rs index 4000c61ca4..c320480928 100644 --- a/tests/pass-dep/shims/libc-misc.rs +++ b/tests/pass-dep/shims/libc-misc.rs @@ -153,12 +153,12 @@ fn test_sync_file_range() { /// Tests whether each thread has its own `__errno_location`. fn test_thread_local_errno() { + #[cfg(any(target_os = "solaris", target_os = "illumos"))] + use libc::__errno as __errno_location; #[cfg(target_os = "linux")] use libc::__errno_location; #[cfg(any(target_os = "macos", target_os = "freebsd"))] use libc::__error as __errno_location; - #[cfg(any(target_os = "solaris", target_os = "illumos"))] - use libc::__errno as __errno_location; unsafe { *__errno_location() = 0xBEEF;