Skip to content

Commit fbf0165

Browse files
committed
Auto merge of #3047 - RalfJung:target-support, r=saethlin
update target support section The MIPS targets were demoted to tier 3, so let's recommend a different big-endian target. Also instead of listing the targets we test individually, just say we test all tier 1 targets. r? `@rust-lang/miri`
2 parents ecff956 + c27f6f2 commit fbf0165

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ program, no matter your host OS. This is particularly useful if you are using
156156
Windows, as the Linux target is much better supported than Windows targets.
157157

158158
You can also use this to test platforms with different properties than your host
159-
platform. For example `cargo miri test --target mips64-unknown-linux-gnuabi64`
159+
platform. For example `cargo miri test --target s390x-unknown-linux-gnu`
160160
will run your test suite on a big-endian target, which is useful for testing
161161
endian-sensitive code.
162162

@@ -220,20 +220,18 @@ using `--target`!
220220
The following targets are tested on CI and thus should always work (to the
221221
degree documented below):
222222

223-
- The best-supported target is `x86_64-unknown-linux-gnu`. Miri releases are
224-
blocked on things working with this target. Most other Linux targets should
225-
also work well; we do run the test suite on `i686-unknown-linux-gnu` as a
226-
32bit target and `mips64-unknown-linux-gnuabi64` as a big-endian target, as
227-
well as the ARM targets `aarch64-unknown-linux-gnu` and
228-
`arm-unknown-linux-gnueabi`.
229-
- `x86_64-apple-darwin` should work basically as well as Linux. We also test
230-
`aarch64-apple-darwin`. However, we might ship Miri with a nightly even when
231-
some features on these targets regress.
232-
- `x86_64-pc-windows-msvc` works, but supports fewer features than the Linux and
233-
Apple targets. For example, file system access and concurrency are not
234-
supported on Windows. We also test `i686-pc-windows-msvc`, with the same
235-
reduced feature set. We might ship Miri with a nightly even when some features
236-
on these targets regress.
223+
- All Rust [Tier 1 targets](https://doc.rust-lang.org/rustc/platform-support.html) are supported by
224+
Miri. They are all checked on Miri's CI, and some (at least one per OS) are even checked on every
225+
Rust PR, so the shipped Miri should always work on these targets.
226+
- We also support `s390x-unknown-linux-gnu` as our "big-endian target of choice".
227+
- For every other target with OS `linux`, `macos`, or `windows`, Miri should generally work, but we
228+
make no promises.
229+
- For targets on other operating systems, even basic operations such as printing to the standard
230+
output might not work, and Miri might fail before even reaching the `main` function.
231+
232+
However, even for targets that we do support, the degree of support for accessing platform APIs
233+
(such as the file system) differs between targets: generally, Linux targets have the best support,
234+
and macOS targets are usually on par. Windows is supported less well.
237235

238236
### Running tests in parallel
239237

ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ case $HOST_TARGET in
116116
MIRI_TEST_TARGET=tests/avr.json MIRI_NO_STD=1 run_tests_minimal no_std # JSON target file
117117
;;
118118
x86_64-apple-darwin)
119-
MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
119+
MIRI_TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture
120120
MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
121121
;;
122122
i686-pc-windows-msvc)

tests/pass/function_calls/abi_compat.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#![feature(portable_simd)]
21
use std::mem;
32
use std::num;
4-
use std::simd;
53

64
#[derive(Copy, Clone)]
75
struct Zst;
@@ -56,19 +54,15 @@ fn test_abi_newtype<T: Copy>(t: T) {
5654

5755
fn main() {
5856
// Here we check:
59-
// - unsigned vs signed integer is allowed
60-
// - u32/i32 vs char is allowed
57+
// - u32 vs char is allowed
6158
// - u32 vs NonZeroU32/Option<NonZeroU32> is allowed
6259
// - reference vs raw pointer is allowed
6360
// - references to things of the same size and alignment are allowed
6461
// These are very basic tests that should work on all ABIs. However it is not clear that any of
6562
// these would be stably guaranteed. Code that relies on this is equivalent to code that relies
6663
// on the layout of `repr(Rust)` types. They are also fragile: the same mismatches in the fields
6764
// of a struct (even with `repr(C)`) will not always be accepted by Miri.
68-
test_abi_compat(0u32, 0i32);
69-
test_abi_compat(simd::u32x8::splat(1), simd::i32x8::splat(1));
7065
test_abi_compat(0u32, 'x');
71-
test_abi_compat(0i32, 'x');
7266
test_abi_compat(42u32, num::NonZeroU32::new(1).unwrap());
7367
test_abi_compat(0u32, Some(num::NonZeroU32::new(1).unwrap()));
7468
test_abi_compat(&0u32, &0u32 as *const u32);
@@ -83,9 +77,6 @@ fn main() {
8377
test_abi_newtype(0u32);
8478
test_abi_newtype(0f32);
8579
test_abi_newtype((0u32, 1u32, 2u32));
86-
// FIXME: skipping the array tests on mips64 due to https://github.com/rust-lang/rust/issues/115404
87-
if !cfg!(target_arch = "mips64") {
88-
test_abi_newtype([0u32, 1u32, 2u32]);
89-
test_abi_newtype([0i32; 0]);
90-
}
80+
test_abi_newtype([0u32, 1u32, 2u32]);
81+
test_abi_newtype([0i32; 0]);
9182
}

0 commit comments

Comments
 (0)