]> git.lizzy.rs Git - rust.git/commitdiff
README: make our cross-interpretation feature stand out more
authorRalf Jung <post@ralfj.de>
Sun, 11 Oct 2020 08:48:34 +0000 (10:48 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 11 Oct 2020 08:49:59 +0000 (10:49 +0200)
README.md

index ceaf993924efde9cb8f07cedf6d42daec8780cd6..66f4801fc6055b1d78ea72f3b71de361e41ac499 100644 (file)
--- a/README.md
+++ b/README.md
@@ -87,11 +87,6 @@ can pass arguments to Miri via `MIRIFLAGS`. For example,
 `MIRIFLAGS="-Zmiri-disable-stacked-borrows" cargo miri run` runs the program
 without checking the aliasing of references.
 
-Miri supports cross-execution: if you want to run the program as if it was a
-Linux program, you can do `cargo miri run --target x86_64-unknown-linux-gnu`.
-This is particularly useful if you are using Windows, as the Linux target is
-much better supported than Windows targets.
-
 When compiling code via `cargo miri`, the `cfg(miri)` config flag is set.  You
 can use this to ignore test cases that fail under Miri because they do things
 Miri does not support:
@@ -116,6 +111,19 @@ error: unsupported operation: can't call foreign function: bind
             performed an operation that the interpreter does not support
 ```
 
+### Cross-interpretation: running for different targets
+
+Miri cannot just run a binary or test suite for your host target, it can also
+perform cross-interpretation for arbitrary foreign targets: `cargo miri run
+--target x86_64-unknown-linux-gnu` will run your program as if it was a Linux
+program, no matter your host OS.  This is particularly useful if you are using
+Windows, as the Linux target is much better supported than Windows targets.
+
+You can also use this to test platforms with different properties than your host
+platform.  For example `cargo miri test --target mips64-unknown-linux-gnuabi64`
+will run your test suite on a big-endian target, which is useful for testing
+endian-sensitive code.
+
 ### Running Miri on CI
 
 To run Miri on CI, make sure that you handle the case where the latest nightly