Skip to content

Commit 19e97f5

Browse files
committed
librustc: ar call fix to support android cross compile on mac
1 parent 8adbb38 commit 19e97f5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/librustc/back/archive.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ pub struct ArchiveRO {
3737

3838
fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
3939
paths: &[&Path]) -> ProcessOutput {
40-
let ar = sess.opts.ar.clone().unwrap_or_else(|| ~"ar");
40+
let ar = if sess.opts.target_triple == ~"arm-linux-androideabi" {
41+
match sess.opts.android_cross_path {
42+
Some(ref path) => *path + "/bin/" + "arm-linux-androideabi-ar",
43+
None => ~"arm-linux-androideabi-ar"
44+
}
45+
} else {
46+
sess.opts.ar.clone().unwrap_or_else(|| ~"ar")
47+
};
48+
4149
let mut args = ~[args.to_owned()];
4250
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
4351
args.extend(&mut paths);

0 commit comments

Comments
 (0)