diff --git a/README.md b/README.md index 6d0173aaf0..eb60b88fef 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,11 @@ Several `-Z` flags are relevant for Miri: sets this flag per default. * `-Zmir-emit-retag` controls whether `Retag` statements are emitted. Miri enables this per default because it is needed for validation. +* `-Zno-codegen` makes rustc skip generating LLVM IR for MIR (though it still + writes out empty object files). This is needed to prevent rustc from trying + to codegen certain panic-related intrinsics, which will not work with a + `libpanic_unwind` compiled in `cfg(miri)` mode. It also speeds up + building our custom libstd. Moreover, Miri recognizes some environment variables: diff --git a/src/lib.rs b/src/lib.rs index 59acff3586..c84d13795a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,5 +51,5 @@ pub use crate::eval::{eval_main, create_ecx, MiriConfig}; /// Insert rustc arguments at the beginning of the argument list that Miri wants to be /// set per default, for maximal validation power. pub fn miri_default_args() -> &'static [&'static str] { - &["-Zalways-encode-mir", "-Zmir-emit-retag", "-Zmir-opt-level=0", "--cfg=miri"] + &["-Zalways-encode-mir", "-Zmir-emit-retag", "-Zmir-opt-level=0", "-Zno-codegen", "--cfg=miri"] }