nixpkgs/pkgs/development/compilers/rust/hardcode_paths.patch
Georges Dubus 6eed023894 rust: patched the source to hardcode gcc path
to avoid using a wrapper.
2014-01-22 13:33:04 +01:00

45 lines
1.3 KiB
Diff

diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 101b2e3..124267f 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -728,7 +728,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
_ => {},
}
- get_system_tool(sess, "cc")
+ ~"@gccPath@"
}
pub fn get_ar_prog(sess: Session) -> ~str {
@@ -737,27 +737,9 @@ pub fn get_ar_prog(sess: Session) -> ~str {
None => {}
}
- get_system_tool(sess, "ar")
+ ~"@binutilsPath@"
}
-fn get_system_tool(sess: Session, tool: &str) -> ~str {
- match sess.targ_cfg.os {
- abi::OsAndroid => match sess.opts.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 \
- (--android-cross-path)", tool))
- }
- },
- _ => tool.to_owned(),
- }
-}
/// Perform the linkage portion of the compilation phase. This will generate all
/// of the requested outputs for this compilation session.