Skip to content

Commit

Permalink
Merge pull request #4135 from RalfJung/unsup-targets
Browse files Browse the repository at this point in the history
Add FreeBSD maintainer; test all of Solarish
  • Loading branch information
RalfJung authored Jan 12, 2025
2 parents 95558ba + 3935790 commit 1c87fa0
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 166 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ degree documented below):
- For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we
make no promises and we don't run tests for such targets.
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems.
- `solaris` / `illumos`: maintained by @devnexen. Supports `std::{env, thread, sync}`, but not `std::fs`.
- `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`.
- `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite.
- `freebsd`: maintained by @YohDeadfall. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`.
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
- `wasi`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works.
- For targets on other operating systems, Miri might fail before even reaching the `main` function.
Expand Down
5 changes: 3 additions & 2 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ case $HOST_TARGET in
# Extra tier 2
TEST_TARGET=arm-unknown-linux-gnueabi run_tests
TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture of choice
# Not officially supported tier 2
TEST_TARGET=x86_64-unknown-illumos run_tests
TEST_TARGET=x86_64-pc-solaris run_tests
# Partially supported targets (tier 2)
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync threadname pthread epoll eventfd
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
Expand Down
323 changes: 168 additions & 155 deletions src/shims/unix/foreign_items.rs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/shims/unix/solarish/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
this.write_scalar(result, dest)?;
}

// Sockets and pipes
"__xnet_socketpair" => {
let [domain, type_, protocol, sv] =
this.check_shim(abi, Conv::C, link_name, args)?;
let result = this.socketpair(domain, type_, protocol, sv)?;
this.write_scalar(result, dest)?;
}

// Miscellaneous
"___errno" => {
let [] = this.check_shim(abi, Conv::C, link_name, args)?;
Expand Down
3 changes: 1 addition & 2 deletions tests/fail-dep/libc/affinity.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target: windows # only very limited libc on Windows
//@ignore-target: apple # `sched_setaffinity` is not supported on macOS
//@only-target: linux # these are Linux-specific APIs
//@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4

fn main() {
Expand Down
5 changes: 2 additions & 3 deletions tests/fail-dep/libc/memrchr_null.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//@ignore-target: windows # No `memrchr` on Windows
//@ignore-target: apple # No `memrchr` on some apple targets
//@only-target: linux # `memrchr` is a GNU extension

use std::ptr;

// null is explicitly called out as UB in the C docs.
// null is explicitly called out as UB in the C docs for `memchr`.
fn main() {
unsafe {
libc::memrchr(ptr::null(), 0, 0); //~ERROR: null pointer
Expand Down
3 changes: 1 addition & 2 deletions tests/pass-dep/libc/libc-affinity.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target: windows # only very limited libc on Windows
//@ignore-target: apple # `sched_{g, s}etaffinity` are not supported on macOS
//@only-target: linux # these are Linux-specific APIs
//@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
#![feature(io_error_more)]
#![feature(pointer_is_aligned_to)]
Expand Down

0 comments on commit 1c87fa0

Please sign in to comment.