about summary refs log tree commit diff
path: root/pkgs/development/compilers/rust/hardcode_paths.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/rust/hardcode_paths.patch')
-rw-r--r--pkgs/development/compilers/rust/hardcode_paths.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/compilers/rust/hardcode_paths.patch b/pkgs/development/compilers/rust/hardcode_paths.patch
new file mode 100644
index 000000000000..1500446cea93
--- /dev/null
+++ b/pkgs/development/compilers/rust/hardcode_paths.patch
@@ -0,0 +1,44 @@
+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.
+
+