3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/rust/hardcode_paths.patch

42 lines
1.2 KiB
Diff
Raw Normal View History

diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
2014-04-25 21:40:51 +01:00
index f198a41..3a47e51 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
2014-04-25 21:40:51 +01:00
@@ -730,7 +730,7 @@ pub fn get_cc_prog(sess: &Session) -> ~str {
_ => {},
}
- get_system_tool(sess, "cc")
+ ~"@gccPath@"
}
2014-04-25 21:40:51 +01:00
pub fn get_ar_prog(sess: &Session) -> ~str {
@@ -739,26 +739,7 @@ pub fn get_ar_prog(sess: &Session) -> ~str {
None => {}
}
- get_system_tool(sess, "ar")
2014-04-25 21:40:51 +01:00
-}
-
-fn get_system_tool(sess: &Session, tool: &str) -> ~str {
- match sess.targ_cfg.os {
2014-04-25 21:40:51 +01:00
- abi::OsAndroid => match sess.opts.cg.android_cross_path {
- Some(ref path) => {
- let tool_str = match tool {
- "cc" => "gcc",
- _ => tool
- };
- format!("{}/bin/arm-linux-androideabi-{}", *path, tool_str)
- }
- None => {
- sess.fatal(format!("need Android NDK path for the '{}' tool \
2014-04-25 21:40:51 +01:00
- (-C android-cross-path)", tool))
- }
- },
- _ => tool.to_owned(),
- }
2014-04-25 21:40:51 +01:00
+ ~"@binutilsPath@"
}
2014-04-25 21:40:51 +01:00
fn remove(sess: &Session, path: &Path) {