]> git.lizzy.rs Git - rust.git/commitdiff
get rid of the --miri_host_target hack
authorRalf Jung <post@ralfj.de>
Sat, 16 Sep 2017 11:29:38 +0000 (13:29 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 16 Sep 2017 11:29:38 +0000 (13:29 +0200)
miri/bin/miri.rs
tests/compiletest.rs

index 65f855a513f746b73eaa12dd03988753781677c8..d38f63610a0e00f9a5b50003e0d9a7ea4b70f66f 100644 (file)
@@ -22,8 +22,6 @@
 
 struct MiriCompilerCalls {
     default: RustcDefaultCalls,
-    /// whether we are building for the host
-    host_target: bool,
 }
 
 impl<'a> CompilerCalls<'a> for MiriCompilerCalls {
@@ -80,8 +78,8 @@ fn build_controller(
         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);
 }
index b87fd7d243469ceda47b9b51f330f28be210f564..f0849af00ea3383c1bf0cd1dbd6bddfbfbba082b 100644 (file)
@@ -122,9 +122,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);
 }