Merge pull request #4115 from madjar/master
rustc: fixed build after 7068828389
This commit is contained in:
commit
fdfc7f4cff
5 changed files with 54 additions and 9 deletions
32
pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch
Normal file
32
pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
|
||||||
|
index 7a3e912..ced75fa 100644
|
||||||
|
--- a/src/librustc/back/link.rs
|
||||||
|
+++ b/src/librustc/back/link.rs
|
||||||
|
@@ -856,24 +856,15 @@
|
||||||
|
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- // 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 Windows, there is no cc command, so we add a condition to make it use gcc.
|
||||||
|
- match sess.targ_cfg.os {
|
||||||
|
- abi::OsWindows => "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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
|
||||||
index 7a3e912..ced75fa 100644
|
index 7a3e912..ced75fa 100644
|
||||||
--- a/src/librustc/back/link.rs
|
--- a/src/librustc/back/link.rs
|
||||||
+++ b/src/librustc/back/link.rs
|
+++ b/src/librustc/back/link.rs
|
||||||
@@ -856,24 +856,15 @@
|
@@ -766,24 +766,15 @@ pub fn output_lib_filename(id: &CrateId) -> String {
|
||||||
|
|
||||||
pub fn get_cc_prog(sess: &Session) -> String {
|
pub fn get_cc_prog(sess: &Session) -> String {
|
||||||
match sess.opts.cg.linker {
|
match sess.opts.cg.linker {
|
||||||
|
@ -15,9 +15,9 @@ index 7a3e912..ced75fa 100644
|
||||||
- // In the future, FreeBSD will use clang as default compiler.
|
- // In the future, FreeBSD will use clang as default compiler.
|
||||||
- // It would be flexible to use cc (system's default C compiler)
|
- // It would be flexible to use cc (system's default C compiler)
|
||||||
- // instead of hard-coded gcc.
|
- // instead of hard-coded gcc.
|
||||||
- // For Windows, there is no cc command, so we add a condition to make it use gcc.
|
- // For win32, there is no cc command, so we add a condition to make it use gcc.
|
||||||
- match sess.targ_cfg.os {
|
- match sess.targ_cfg.os {
|
||||||
- abi::OsWindows => "gcc",
|
- abi::OsWin32 => "gcc",
|
||||||
- _ => "cc",
|
- _ => "cc",
|
||||||
- }.to_string()
|
- }.to_string()
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ in stdenv.mkDerivation {
|
||||||
configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ];
|
configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ];
|
||||||
|
|
||||||
# The compiler requires cc, so we patch the source to tell it where to find it
|
# The compiler requires cc, so we patch the source to tell it where to find it
|
||||||
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
|
patches = [ ./hardcode_paths.HEAD.patch ./local_stage0.HEAD.patch ];
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/librustc/back/link.rs \
|
substituteInPlace src/librustc/back/link.rs \
|
||||||
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
|
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
|
||||||
|
|
16
pkgs/development/compilers/rustc/local_stage0.HEAD.patch
Normal file
16
pkgs/development/compilers/rustc/local_stage0.HEAD.patch
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
|
||||||
|
index e78f231..6b6773b 100755
|
||||||
|
--- a/src/etc/local_stage0.sh
|
||||||
|
+++ b/src/etc/local_stage0.sh
|
||||||
|
@@ -53,11 +53,6 @@
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
|
||||||
|
-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
|
||||||
|
# do not fail if one of the above fails, as all we need is a working rustc!
|
||||||
|
exit 0
|
|
@ -2,15 +2,12 @@ diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
|
||||||
index e78f231..6b6773b 100755
|
index e78f231..6b6773b 100755
|
||||||
--- a/src/etc/local_stage0.sh
|
--- a/src/etc/local_stage0.sh
|
||||||
+++ b/src/etc/local_stage0.sh
|
+++ b/src/etc/local_stage0.sh
|
||||||
@@ -53,11 +53,6 @@
|
@@ -53,8 +53,3 @@ if [ -z $TARG_DIR ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
|
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
|
-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
|
|
||||||
# do not fail if one of the above fails, as all we need is a working rustc!
|
|
||||||
exit 0
|
|
||||||
|
|
Loading…
Reference in a new issue