diff options
| author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-02-11 16:51:08 -0500 |
|---|---|---|
| committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-02-13 18:11:23 -0500 |
| commit | ffdda22aa28b9231bd3d62ee4db5239f616fce8d (patch) | |
| tree | 4d44b956fed9a4edefa0fff6b5a2f79480068999 /src | |
| parent | 58eeb07c2a128cbba403d6204c2f291af4ddf938 (diff) | |
| download | rust-ffdda22aa28b9231bd3d62ee4db5239f616fce8d.tar.gz rust-ffdda22aa28b9231bd3d62ee4db5239f616fce8d.zip | |
mk: Fix non-android cross builds.
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiletest/common.rs | 7 | ||||
| -rw-r--r-- | src/compiletest/compiletest.rs | 9 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 14 |
3 files changed, 20 insertions, 10 deletions
diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 4cf224cf404..4d1f7ab5956 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -77,8 +77,11 @@ pub struct config { // for running under valgrind runtool: Option<~str>, - // Flags to pass to the compiler - rustcflags: Option<~str>, + // Flags to pass to the compiler when building for the host + host_rustcflags: Option<~str>, + + // Flags to pass to the compiler when building for the target + target_rustcflags: Option<~str>, // Run tests using the JIT jit: bool, diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 5530c3b9086..c479e5bb2b9 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -64,7 +64,8 @@ pub fn parse_config(args: ~[~str]) -> config { optflag("", "ignored", "run tests marked as ignored"), optopt("", "runtool", "supervisor program to run tests under \ (eg. emulator, valgrind)", "PROGRAM"), - optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"), + optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS"), + optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS"), optflag("", "verbose", "run tests verbosely, showing all output"), optopt("", "logfile", "file to log test execution to", "FILE"), optopt("", "save-metrics", "file to save metrics to", "FILE"), @@ -132,7 +133,8 @@ pub fn parse_config(args: ~[~str]) -> config { ratchet_noise_percent: matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)), runtool: matches.opt_str("runtool"), - rustcflags: matches.opt_str("rustcflags"), + host_rustcflags: matches.opt_str("host-rustcflags"), + target_rustcflags: matches.opt_str("target-rustcflags"), jit: matches.opt_present("jit"), target: opt_str2(matches.opt_str("target")).to_str(), host: opt_str2(matches.opt_str("host")).to_str(), @@ -161,7 +163,8 @@ pub fn log_config(config: &config) { logv(c, format!("run_ignored: {}", config.run_ignored)); logv(c, format!("filter: {}", opt_str(&config.filter))); logv(c, format!("runtool: {}", opt_str(&config.runtool))); - logv(c, format!("rustcflags: {}", opt_str(&config.rustcflags))); + logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags))); + logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags))); logv(c, format!("jit: {}", config.jit)); logv(c, format!("target: {}", config.target)); logv(c, format!("host: {}", config.host)); diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index f906c0fc4e1..a2c61352e6f 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -250,7 +250,7 @@ actual:\n\ ~"-L", config.build_base.as_str().unwrap().to_owned(), ~"-L", aux_dir.as_str().unwrap().to_owned()]; - args.push_all_move(split_maybe_args(&config.rustcflags)); + args.push_all_move(split_maybe_args(&config.target_rustcflags)); args.push_all_move(split_maybe_args(&props.compile_flags)); // FIXME (#9639): This needs to handle non-utf8 paths return ProcArgs {prog: config.rustc_path.as_str().unwrap().to_owned(), args: args}; @@ -260,9 +260,9 @@ actual:\n\ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { // do not optimize debuginfo tests - let mut config = match config.rustcflags { + let mut config = match config.target_rustcflags { Some(ref flags) => config { - rustcflags: Some(flags.replace("-O", "")), + target_rustcflags: Some(flags.replace("-O", "")), .. (*config).clone() }, None => (*config).clone() @@ -329,7 +329,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { break; } - let args = split_maybe_args(&config.rustcflags); + let args = split_maybe_args(&config.target_rustcflags); let mut tool_path:~str = ~""; for arg in args.iter() { if arg.contains("android-cross-path=") { @@ -770,7 +770,11 @@ fn make_compile_args(config: &config, ThisDirectory(path) => { args.push(~"--out-dir"); path } }; args.push(path.as_str().unwrap().to_owned()); - args.push_all_move(split_maybe_args(&config.rustcflags)); + if props.force_host { + args.push_all_move(split_maybe_args(&config.host_rustcflags)); + } else { + args.push_all_move(split_maybe_args(&config.target_rustcflags)); + } args.push_all_move(split_maybe_args(&props.compile_flags)); return ProcArgs {prog: config.rustc_path.as_str().unwrap().to_owned(), args: args}; } |
