]> git.lizzy.rs Git - rust.git/commitdiff
librustc: ar call fix to support android cross compile on mac
authorYoung-il Choi <duddlf.choi@samsung.com>
Fri, 6 Dec 2013 06:44:27 +0000 (15:44 +0900)
committerYoung-il Choi <duddlf.choi@samsung.com>
Mon, 6 Jan 2014 04:04:26 +0000 (13:04 +0900)
src/librustc/back/archive.rs

index 07457b1db27ccdb7f35128f9a7e8d0d778a6da68..e7535d8199dfe5564b6472a5b43d59d1e2251167 100644 (file)
@@ -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);