Skip to content

Commit 20a0257

Browse files
committed
further illumos/solaris support.
fixing part of `miri test alloc/hashmap`.
1 parent 55859d4 commit 20a0257

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

ci/ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ case $HOST_TARGET in
148148
BASIC="$VERY_BASIC hello hashmap alloc align" # ensures we have the shims for stdout and basic data structures
149149
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-mem libc-misc libc-random libc-time fs env num_cpus
150150
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-mem libc-misc libc-random libc-time fs env num_cpus
151-
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $VERY_BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random
152-
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $VERY_BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random
151+
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random env
152+
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC hello panic/panic concurrency/simple pthread-sync libc-mem libc-misc libc-random env
153153
TEST_TARGET=aarch64-linux-android run_tests_minimal $VERY_BASIC hello panic/panic
154154
TEST_TARGET=wasm32-wasi run_tests_minimal $VERY_BASIC wasm
155155
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal $VERY_BASIC wasm

src/shims/extern_static.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
7676
Self::null_ptr_extern_statics(this, &["bsd_signal"])?;
7777
Self::weak_symbol_extern_statics(this, &["signal"])?;
7878
}
79+
"solaris" | "illumos" => {
80+
let environ = this.machine.env_vars.unix().environ();
81+
Self::add_extern_static(this, "environ", environ);
82+
}
7983
"windows" => {
8084
// "_tls_used"
8185
// This is some obscure hack that is part of the Windows TLS story. It's a `u8`.

src/shims/unix/foreign_items.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
714714
this.write_int(super::UID, dest)?;
715715
}
716716

717-
"getpwuid_r"
717+
"getpwuid_r" | "__posix_getpwuid_r"
718718
if this.frame_in_std() => {
719+
// getpwuid_r is the standard name, __posix_getpwuid_r is used on solarish
719720
let [uid, pwd, buf, buflen, result] =
720721
this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
721722
this.check_no_isolation("`getpwuid_r`")?;

tests/fail/environ-gets-deallocated.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
//@ignore-target-windows: Windows does not have a global environ list that the program can access directly
22

3-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
3+
#[cfg(any(
4+
target_os = "linux",
5+
target_os = "freebsd",
6+
target_os = "solaris",
7+
target_os = "illumos"
8+
))]
49
fn get_environ() -> *const *const u8 {
510
extern "C" {
611
static mut environ: *const *const u8;

0 commit comments

Comments
 (0)