diff options
| author | Oliver Schneider <oli-obk@users.noreply.github.com> | 2017-09-16 15:06:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-16 15:06:26 +0200 |
| commit | 709ab245df91bf3bafd9f83b2e98e410b2646a0d (patch) | |
| tree | 70265a503a249a9d16d9f4f4adae58dbbb9f423b | |
| parent | cf925284269a1fbefbf1dfb53c1040c50d5be243 (diff) | |
| parent | 8bddd6a065ec7b0125e9040ae5e0b67dacb8a391 (diff) | |
| download | rust-709ab245df91bf3bafd9f83b2e98e410b2646a0d.tar.gz rust-709ab245df91bf3bafd9f83b2e98e410b2646a0d.zip | |
Merge branch 'master' into windows
| -rw-r--r-- | miri/bin/miri.rs | 16 | ||||
| -rw-r--r-- | tests/compiletest.rs | 3 |
2 files changed, 3 insertions, 16 deletions
diff --git a/miri/bin/miri.rs b/miri/bin/miri.rs index 65f855a513f..d38f63610a0 100644 --- a/miri/bin/miri.rs +++ b/miri/bin/miri.rs @@ -22,8 +22,6 @@ use std::path::PathBuf; struct MiriCompilerCalls { default: RustcDefaultCalls, - /// whether we are building for the host - host_target: bool, } impl<'a> CompilerCalls<'a> for MiriCompilerCalls { @@ -80,8 +78,8 @@ impl<'a> CompilerCalls<'a> for MiriCompilerCalls { let mut control = self.default.build_controller(sess, matches); control.after_hir_lowering.callback = Box::new(after_hir_lowering); control.after_analysis.callback = Box::new(after_analysis); - if !self.host_target { - // only fully compile targets on the host + if sess.target.target != sess.host { + // only fully compile targets on the host. linking will fail for cross-compilation. control.after_analysis.stop = Compilation::Stop; } control @@ -258,18 +256,10 @@ fn main() { args.push(find_sysroot()); } - // for auxilary builds in unit tests + // Make sure we always have all the MIR (e.g. for auxilary builds in unit tests). args.push("-Zalways-encode-mir".to_owned()); - let mut host_target = false; - args.retain(|arg| if arg == "--miri_host_target" { - host_target = true; - false // remove the flag, rustc doesn't know it - } else { - true - }); rustc_driver::run_compiler(&args, &mut MiriCompilerCalls { default: RustcDefaultCalls, - host_target, }, None, None); } diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 82fc4968a46..b1ea3fc8b0d 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -123,9 +123,6 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) { // For now, only validate without optimizations. Inlining breaks validation. flags.push("-Zmir-emit-validate=1".to_owned()); } - if target == host { - flags.push("--miri_host_target".to_owned()); - } config.target_rustcflags = Some(flags.join(" ")); compiletest::run_tests(&config); } |
