rust: Update to 0.11

This commit is contained in:
Paul Colomiets 2014-07-02 22:43:34 +03:00
parent 48817c8d97
commit febf46bf5c
2 changed files with 39 additions and 50 deletions

View File

@ -16,28 +16,25 @@
with if stdenv.system == "i686-linux" then {
platform = "linux-i386";
snapshot = "3bef5684fd0582fbd4ddebd4514182d4f72924f7";
snapshot_sha = "1c72d65pcgm3z4sly7al09mjvpp8asxbbv7iyzzv5k8f66ny2agy";
snapshot = "84339ea0f796ae468ef86797ef4587274bec19ea";
target = "i686-unknown-linux-gnu";
} else if stdenv.system == "x86_64-linux" then {
platform = "linux-x86_64";
snapshot = "a7b2af1076d48e4a687a71a21478293e834349bd";
snapshot_sha = "1c72d65pcgm3z4sly7al09mjvpp8asxbbv7iyzzv5k8f66ny2agy";
snapshot = "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae";
target = "x86_64-unknown-linux-gnu";
} else if stdenv.system == "x86_64-darwin" then {
platform = "macos-x86_64";
snapshot = "22b884a3876cb3e40ad942ad68a496b5f239fca5";
snapshot_sha = "0qabkvyryiwlqhzy1kscff27rx788bv7lh7d8m1hnsv38wqhwqqb";
snapshot = "4a8c2e1b7634d73406bac32a1a97893ec3ed818d";
} else {};
let snapshotDate = "2014-03-28";
snapshotRev = "b8601a3";
let snapshotDate = "2014-06-21";
snapshotRev = "db9af1d";
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2"; in
stdenv.mkDerivation {
name = "rust-0.10";
name = "rust-0.11.0";
src = fetchurl {
url = http://static.rust-lang.org/dist/rust-0.10.tar.gz;
sha256 = "c72cfbbf03016804a81d7b68e8258ffaf018f8f5a25550ad64571ce6c2642cf9";
url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
sha256 = "1fhi8iiyyj5j48fpnp93sfv781z1dm0xy94h534vh4mz91jf7cyi";
};
# We need rust to build rust. If we don't provide it, configure will try to download it.
@ -45,15 +42,16 @@ stdenv.mkDerivation {
name = "rust-stage0";
src = fetchurl {
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
sha256 = snapshot_sha;
sha1 = snapshot;
};
dontStrip = true;
installPhase = ''
mkdir -p "$out"
cp -r bin "$out/bin"
'' + (if stdenv.isLinux then ''
patchelf --interpreter ${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker} \
--set-rpath ${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/ \
$out/bin/rustc
patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.gcc.dynamicLinker}" \
--set-rpath "${stdenv.gcc.gcc}/lib/:${stdenv.gcc.gcc}/lib64/" \
"$out/bin/rustc"
'' else "");
};
@ -63,8 +61,8 @@ stdenv.mkDerivation {
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
postPatch = ''
substituteInPlace src/librustc/back/link.rs \
--subst-var-by "gccPath" ${stdenv.gcc}/bin/cc \
--subst-var-by "binutilsPath" ${stdenv.gcc.binutils}/bin/ar
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
--subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
'';
buildInputs = [ which file perl curl python27 makeWrapper ];

View File

@ -1,41 +1,32 @@
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index f198a41..3a47e51 100644
index 7a3e912..ced75fa 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -730,7 +730,7 @@ pub fn get_cc_prog(sess: &Session) -> ~str {
_ => {},
@@ -766,24 +766,15 @@ pub fn output_lib_filename(id: &CrateId) -> String {
pub fn get_cc_prog(sess: &Session) -> String {
match sess.opts.cg.linker {
- Some(ref linker) => return linker.to_string(),
- None => {}
+ Some(ref linker) => linker.to_string(),
+ None => "@ccPath@".to_string()
}
- get_system_tool(sess, "cc")
+ ~"@gccPath@"
}
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")
-}
-
-fn get_system_tool(sess: &Session, tool: &str) -> ~str {
- // In the future, FreeBSD will use clang as default compiler.
- // It would be flexible to use cc (system's default C compiler)
- // instead of hard-coded gcc.
- // For win32, there is no cc command, so we add a condition to make it use gcc.
- match sess.targ_cfg.os {
- 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 \
- (-C android-cross-path)", tool))
- }
- },
- _ => tool.to_owned(),
- }
+ ~"@binutilsPath@"
- abi::OsWin32 => "gcc",
- _ => "cc",
- }.to_string()
}
pub fn get_ar_prog(sess: &Session) -> String {
match sess.opts.cg.ar {
Some(ref ar) => (*ar).clone(),
- None => "ar".to_string()
+ None => "@arPath@".to_string()
}
}
fn remove(sess: &Session, path: &Path) {