Skip to content

Commit

Permalink
librustc: ar call fix to support android cross compile on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
yichoi committed Jan 6, 2014
1 parent 8adbb38 commit 19e97f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/librustc/back/archive.rs
Expand Up @@ -37,7 +37,15 @@ pub struct ArchiveRO {

fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
paths: &[&Path]) -> ProcessOutput {
let ar = sess.opts.ar.clone().unwrap_or_else(|| ~"ar");
let ar = if sess.opts.target_triple == ~"arm-linux-androideabi" {
match sess.opts.android_cross_path {
Some(ref path) => *path + "/bin/" + "arm-linux-androideabi-ar",
None => ~"arm-linux-androideabi-ar"
}
} else {
sess.opts.ar.clone().unwrap_or_else(|| ~"ar")
};

let mut args = ~[args.to_owned()];
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
args.extend(&mut paths);
Expand Down

0 comments on commit 19e97f5

Please sign in to comment.