mention cross-running in docs

This commit is contained in:
Ralf Jung 2020-03-22 08:55:53 +01:00
parent d85f09c4e4
commit e1b654f09a
2 changed files with 11 additions and 4 deletions

View file

@ -52,18 +52,19 @@ all the same flags as `rustc` (though the ones only affecting code generation
and linking obviously will have no effect) [and more][miri-flags].
Running the Miri driver requires some fiddling with environment variables, so
the `miri` script helps you do that. For example, you can run the driver on a
particular file by doing
the `miri` script helps you do that. For example, you can (cross-)run the
driver on a particular file by doing
```sh
./miri run tests/run-pass/format.rs
./miri run tests/run-pass/hello.rs --target i686-unknown-linux-gnu
```
and you can run the test suite using:
and you can (cross-)run the test suite using:
```
./miri test
MIRI_TEST_TARGET=i686-unknown-linux-gnu ./miri test
```
`./miri test FILTER` only runs those tests that contain `FILTER` in their
@ -104,7 +105,8 @@ and then you can use it as if it was installed by `rustup`. Make sure you use
the same toolchain when calling `cargo miri` that you used when installing Miri!
There's a test for the cargo wrapper in the `test-cargo-miri` directory; run
`./run-test.py` in there to execute it.
`./run-test.py` in there to execute it. Like `./miri test`, this respects the
`MIRI_TEST_TARGET` environment variable to execute the test for another target.
## Building Miri with a locally built rustc

View file

@ -76,6 +76,11 @@ Now you can run your project in Miri:
The first time you run Miri, it will perform some extra setup and install some
dependencies. It will ask you for confirmation before installing anything.
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.
You can pass arguments to Miri after the first `--`, and pass arguments to the
interpreted program or test suite after the second `--`. For example, `cargo
miri run -- -Zmiri-disable-validation` runs the program without validation of