Skip to content

Commit 8db1e9a

Browse files
authored
Merge pull request rust-lang#4135 from RalfJung/unsup-targets
Add FreeBSD maintainer; test all of Solarish
2 parents 78fdd59 + f4e0584 commit 8db1e9a

File tree

7 files changed

+185
-166
lines changed

7 files changed

+185
-166
lines changed

src/tools/miri/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ degree documented below):
217217
- For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we
218218
make no promises and we don't run tests for such targets.
219219
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems.
220-
- `solaris` / `illumos`: maintained by @devnexen. Supports `std::{env, thread, sync}`, but not `std::fs`.
221-
- `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`.
220+
- `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite.
221+
- `freebsd`: maintained by @YohDeadfall. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`.
222222
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
223223
- `wasi`: **maintainer wanted**. Support very incomplete, not even standard output works, but an empty `main` function works.
224224
- For targets on other operating systems, Miri might fail before even reaching the `main` function.

src/tools/miri/ci/ci.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,14 @@ case $HOST_TARGET in
147147
# Extra tier 2
148148
TEST_TARGET=arm-unknown-linux-gnueabi run_tests
149149
TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture of choice
150+
# Not officially supported tier 2
151+
TEST_TARGET=x86_64-unknown-illumos run_tests
152+
TEST_TARGET=x86_64-pc-solaris run_tests
150153
# Partially supported targets (tier 2)
151154
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
152155
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
153156
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe
154157
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX time hashmap random threadname pthread fs libc-pipe
155-
TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs
156-
TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX time hashmap random thread sync available-parallelism tls libc-pipe fs
157158
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random sync threadname pthread epoll eventfd
158159
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
159160
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std

src/tools/miri/src/shims/unix/foreign_items.rs

+168-155
Large diffs are not rendered by default.

src/tools/miri/src/shims/unix/solarish/foreign_items.rs

+8
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
7878
this.write_scalar(result, dest)?;
7979
}
8080

81+
// Sockets and pipes
82+
"__xnet_socketpair" => {
83+
let [domain, type_, protocol, sv] =
84+
this.check_shim(abi, Conv::C, link_name, args)?;
85+
let result = this.socketpair(domain, type_, protocol, sv)?;
86+
this.write_scalar(result, dest)?;
87+
}
88+
8189
// Miscellaneous
8290
"___errno" => {
8391
let [] = this.check_shim(abi, Conv::C, link_name, args)?;

src/tools/miri/tests/fail-dep/libc/affinity.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@ignore-target: windows # only very limited libc on Windows
2-
//@ignore-target: apple # `sched_setaffinity` is not supported on macOS
1+
//@only-target: linux # these are Linux-specific APIs
32
//@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
43

54
fn main() {

src/tools/miri/tests/fail-dep/libc/memrchr_null.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
//@ignore-target: windows # No `memrchr` on Windows
2-
//@ignore-target: apple # No `memrchr` on some apple targets
1+
//@only-target: linux # `memrchr` is a GNU extension
32

43
use std::ptr;
54

6-
// null is explicitly called out as UB in the C docs.
5+
// null is explicitly called out as UB in the C docs for `memchr`.
76
fn main() {
87
unsafe {
98
libc::memrchr(ptr::null(), 0, 0); //~ERROR: null pointer

src/tools/miri/tests/pass-dep/libc/libc-affinity.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@ignore-target: windows # only very limited libc on Windows
2-
//@ignore-target: apple # `sched_{g, s}etaffinity` are not supported on macOS
1+
//@only-target: linux # these are Linux-specific APIs
32
//@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
43
#![feature(io_error_more)]
54
#![feature(pointer_is_aligned_to)]

0 commit comments

Comments
 (0)