rust: update patches

This commit is contained in:
Cody P Schafer
2014-12-04 21:26:06 -05:00
parent 928b291621
commit 3badeb4b5e
13 changed files with 131 additions and 126 deletions
@@ -1,7 +1,7 @@
From 3a42bfdbf3ad198deecdbfc2c5741c8d1b5cbb2f Mon Sep 17 00:00:00 2001
From f44cc2a67ad292043da06759d3e0c31fa8645e31 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Wed, 26 Nov 2014 10:00:32 -0500
Subject: [PATCH 01/11] libstd/io/process/Command: fully quote and escape the
Subject: [PATCH 01/10] libstd/io/process/Command: fully quote and escape the
command and all args
This makes the command (which may have trailing or leading white space
@@ -1,7 +1,7 @@
From 9af37c0bae0925de62b106b8bad3c8b3c81a20b9 Mon Sep 17 00:00:00 2001
From 26e8dcbdca19b167f69611322e761a315e869580 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 1 Dec 2014 15:50:13 -0500
Subject: [PATCH 02/11] std/io/process: add Show tests
Subject: [PATCH 02/10] std/io/process: add Show tests
---
src/libstd/io/process.rs | 12 ++++++++++++
@@ -1,7 +1,7 @@
From 76975beaff8cd6a7123c1ac65bf301559656d9ab Mon Sep 17 00:00:00 2001
From fdff8ab61314dcb89c4868f9508714ca3bb35999 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Sat, 15 Nov 2014 20:12:48 -0500
Subject: [PATCH 03/11] platform.mk: avoid choking on i586
Subject: [PATCH 03/10] platform.mk: avoid choking on i586
---
mk/platform.mk | 4 +++-
@@ -1,7 +1,7 @@
From 9f5da84a1bfc2f17c56af11c98e03f80cdd0505c Mon Sep 17 00:00:00 2001
From 1f6acefac88b2a175472415295bf75d51b36cfb8 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 17 Nov 2014 16:14:15 -0500
Subject: [PATCH 04/11] mk/rt/compiler_rt: pass LDFLAGS from
Subject: [PATCH 04/10] mk/rt/compiler_rt: pass LDFLAGS from
CFG_GCCISH_LINK_FLAGS
---
@@ -1,7 +1,7 @@
From 57865c3a06909470918db23e3d5c5b0fa925a29c Mon Sep 17 00:00:00 2001
From e6faded5eb13349f4d7aba02d39f3fef0d8b1ef6 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 01:40:21 -0500
Subject: [PATCH 05/11] Target: add default target.json path:
Subject: [PATCH 05/10] Target: add default target.json path:
$libdir/rust/targets
---
@@ -11,7 +11,7 @@ Subject: [PATCH 05/11] Target: add default target.json path:
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 3c2dbae..e99bf2c 100644
index 33de2c9..bc90f90 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -546,8 +546,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
@@ -1,7 +1,7 @@
From fa47c64a5b41597786b8212b92fc59ee87af096f Mon Sep 17 00:00:00 2001
From acf5bafb0c2c2fcb35932c94a7faf2f62aa0eb3f Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 14:52:56 -0500
Subject: [PATCH 06/11] mk: for stage0, use RUSTFLAGS to override target libs
Subject: [PATCH 06/10] mk: for stage0, use RUSTFLAGS to override target libs
dir
Setting HLIB specially for stage0 (and even more specially for windows)
@@ -1,7 +1,7 @@
From 2deaa6d8455b277f9f1980f8bf5dc237eca7462c Mon Sep 17 00:00:00 2001
From fda66b4ff221ef687878fa32792d5e1718882402 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Tue, 18 Nov 2014 13:48:14 -0500
Subject: [PATCH 07/11] mk: add missing CFG_LIBDIR_RELATIVE
Subject: [PATCH 07/10] mk: add missing CFG_LIBDIR_RELATIVE
---
mk/grammar.mk | 4 ++--
@@ -1,7 +1,7 @@
From 49d9ff71a7ab92c28241f599af0b2343f2d9f442 Mon Sep 17 00:00:00 2001
From 592d635387c99882fe0a8204b4efa6177e3473c3 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:10:15 -0500
Subject: [PATCH 08/11] configure: support --bindir, and extend libdir to
Subject: [PATCH 08/10] configure: support --bindir, and extend libdir to
non-blessed dirs
Adds --bindir, and:
@@ -10,33 +10,80 @@ Allows --bindir and --libdir to have multiple elements in their paths
relative to sysroot, and allows libdir to end in an arbitrary directory
(previously it was limited to lib, lib32, and lib64).
Note that this adds the requirement of the 'realpath' tool
Note that this assumes absolute paths start with '/', which may break
windows platforms
---
configure | 10 +++++
configure | 51 +++++++++++++++++-------
mk/host.mk | 6 ++-
mk/install.mk | 4 +-
mk/main.mk | 11 ++++++
mk/perf.mk | 4 +-
mk/prepare.mk | 4 +-
src/etc/install.sh | 29 +++++++++++---
src/etc/install.sh | 54 ++++++++++++++++++++++---
src/librustc/metadata/filesearch.rs | 78 ++++++++++++++-----------------------
src/librustc_trans/back/link.rs | 3 +-
9 files changed, 85 insertions(+), 64 deletions(-)
9 files changed, 137 insertions(+), 78 deletions(-)
diff --git a/configure b/configure
index 613f62d..bc92474 100755
index 70d6ba3..c79a218 100755
--- a/configure
+++ b/configure
@@ -340,6 +340,7 @@ need_cmd date
need_cmd tr
need_cmd sed
need_cmd file
+need_cmd realpath
@@ -309,6 +309,31 @@ envopt() {
fi
}
msg "inspecting environment"
+abspath () {
+ case "$1" in
+ /*) echo "$1" ;;
+ *) echo "$PWD/$1" ;;
+ esac
+}
+
+relpath () {
+ local src=$(abspath "$1")
+ local dst=$(abspath "$2")
+ local common=$src
+ local result=
+
+ # Start by checking if the whole src is common, then strip off pack
+ # components until we find the common element.
+ while [ "${dst#"$common"}" = "$dst" ]; do
+ common=$(dirname "$common")
+ result="../$result"
+ done
+
+ local down="${dst#"$common"}"
+ result="${result}${down#/}"
+ echo "$result"
+}
+
to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -549,31 +574,28 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
then
CFG_LIBDIR_RELATIVE=bin
-else
- CFG_LIBDIR_RELATIVE=lib
fi
@@ -568,12 +569,20 @@ if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ];
err "libdir on windows should be set to 'bin'"
-valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
+valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
-case "$CFG_LIBDIR" in
- "$CFG_PREFIX"/*) CAT_INC=2;;
- "$CFG_PREFIX"*) CAT_INC=1;;
- *)
- err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
-esac
-
-CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
-
-if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
- err "libdir on windows should be set to 'bin'"
+if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "$CFG_BINDIR_RELATIVE" ]; then
+ err "Windows builds currently require that LIBDIR == BINDIR (we have libdir{$CFG_LIBDIR_RELATIVE} != bindir{$CFG_BINDIR_RELATIVE} )"
fi
+CFG_BINDIR_RELATIVE=bin
@@ -50,13 +97,13 @@ index 613f62d..bc92474 100755
+# Determine libdir and bindir relative to prefix
+step_msg "calculating relative paths to prefix = ${CFG_PREFIX}"
+CFG_BINDIR_RELATIVE=$(realpath -m --relative-to="${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(realpath -m --relative-to="${CFG_PREFIX}" "${CFG_LIBDIR}")
+CFG_BINDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_LIBDIR}")
+
# Validate Options
step_msg "validating $CFG_SELF args"
validate_opt
@@ -1333,6 +1342,7 @@ putvar CFG_PREFIX
@@ -1332,6 +1354,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
@@ -174,18 +221,43 @@ index d404d3d..afc6d81 100644
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
prepare-base-$(1): prepare-everything-$(1)
diff --git a/src/etc/install.sh b/src/etc/install.sh
index 8bc48fc..e524510 100644
index 8bc48fc..05dd983 100644
--- a/src/etc/install.sh
+++ b/src/etc/install.sh
@@ -213,6 +213,7 @@ need_cmd grep
need_cmd uname
need_cmd tr
need_cmd sed
+need_cmd realpath
@@ -205,6 +205,32 @@ absolutify() {
ABSOLUTIFIED="${FILE_PATH}"
}
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)"
CFG_SELF="$0"
@@ -285,6 +286,8 @@ then
+abspath () {
+ case "$1" in
+ /*) echo "$1" ;;
+ *) echo "$PWD/$1" ;;
+ esac
+}
+
+relpath () {
+ local src=$(abspath "$1")
+ local dst=$(abspath "$2")
+ local common=$src
+ local result=
+
+ # Start by checking if the whole src is common, then strip off pack
+ # components until we find the common element.
+ while [ "${dst#"$common"}" = "$dst" ]; do
+ common=$(dirname "$common")
+ result="../$result"
+ done
+
+ local down="${dst#"$common"}"
+ result="${result}${down#/}"
+ echo "$result"
+}
+
+
msg "looking for install programs"
need_cmd mkdir
need_cmd printf
@@ -285,6 +311,8 @@ then
CFG_LIBDIR_RELATIVE=bin
fi
@@ -194,7 +266,7 @@ index 8bc48fc..e524510 100644
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
then
CFG_LD_PATH_VAR=PATH
@@ -311,6 +314,7 @@ case "$CFG_LIBDIR" in
@@ -311,6 +339,7 @@ case "$CFG_LIBDIR" in
esac
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
@@ -202,19 +274,19 @@ index 8bc48fc..e524510 100644
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
if [ $HELP -eq 1 ]
@@ -319,6 +323,11 @@ then
@@ -319,6 +348,11 @@ then
exit 0
fi
+# Determine libdir and bindir relative to prefix
+step_msg "calculating relative paths to prefix = ${CFG_PREFIX}"
+CFG_BINDIR_RELATIVE=$(realpath -m --relative-to="${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(realpath -m --relative-to="${CFG_PREFIX}" "${CFG_LIBDIR}")
+CFG_BINDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_LIBDIR}")
+
step_msg "validating $CFG_SELF args"
validate_opt
@@ -332,8 +341,8 @@ then
@@ -332,8 +366,8 @@ then
if [ -z "${CFG_UNINSTALL}" ]
then
msg "verifying platform can run binaries"
@@ -225,7 +297,7 @@ index 8bc48fc..e524510 100644
if [ $? -ne 0 ]
then
err "can't execute rustc binary on this platform"
@@ -431,6 +440,7 @@ need_ok "failed to create installed manifest"
@@ -431,6 +465,7 @@ need_ok "failed to create installed manifest"
# Now install, iterate through the new manifest and copy files
while read p; do
@@ -233,7 +305,7 @@ index 8bc48fc..e524510 100644
# Decide the destination of the file
FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
@@ -441,6 +451,13 @@ while read p; do
@@ -441,6 +476,13 @@ while read p; do
FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp"
fi
@@ -247,7 +319,7 @@ index 8bc48fc..e524510 100644
if echo "$p" | grep "^share/man/" > /dev/null
then
pp=`echo $p | sed 's/^share\/man\///'`
@@ -458,7 +475,7 @@ while read p; do
@@ -458,7 +500,7 @@ while read p; do
# Install the file
msg "${FILE_INSTALL_PATH}"
@@ -256,7 +328,7 @@ index 8bc48fc..e524510 100644
then
install -m755 "${CFG_SRC_DIR}/$p" "${FILE_INSTALL_PATH}"
else
@@ -493,11 +510,11 @@ fi
@@ -493,11 +535,11 @@ fi
if [ -z "${CFG_DISABLE_VERIFY}" ]
then
msg "verifying installed binaries are executable"
@@ -403,10 +475,10 @@ index 89f3343..b626308 100644
// The name of rustc's own place to organize libraries.
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 3715256..efa7ed4 100644
index d8cdffe..76c2bd8 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -1014,11 +1014,10 @@ fn link_args(cmd: &mut Command,
@@ -1002,11 +1002,10 @@ fn link_args(cmd: &mut Command,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {
@@ -1,7 +1,7 @@
From b1ea0b2db188b21f17af2206dcff059ed309a690 Mon Sep 17 00:00:00 2001
From 58f69e6978ed1975c27c3b0450c75be40b737688 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:54:42 -0500
Subject: [PATCH 11/11] Parallelize submake invocations
Subject: [PATCH 09/10] Parallelize submake invocations
---
mk/clean.mk | 2 +-
@@ -1,38 +0,0 @@
From cb25ce23ce1105d8695a8cc20f3e763c494c51bd Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:20:57 -0500
Subject: [PATCH 09/11] XXX: remove conflicting realpath hack
---
configure | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/configure b/configure
index bc92474..4b05c91 100755
--- a/configure
+++ b/configure
@@ -550,20 +550,9 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
then
CFG_LIBDIR_RELATIVE=bin
-else
- CFG_LIBDIR_RELATIVE=lib
fi
-valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
-
-case "$CFG_LIBDIR" in
- "$CFG_PREFIX"/*) CAT_INC=2;;
- "$CFG_PREFIX"*) CAT_INC=1;;
- *)
- err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
-esac
-
-CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
+valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
err "libdir on windows should be set to 'bin'"
--
2.1.3
@@ -1,27 +0,0 @@
From e52460bf2c9550e4fbc10944f2868ed02ed71497 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 24 Nov 2014 13:22:43 -0500
Subject: [PATCH 10/11] XXX: configure: unneeded windows check
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 4b05c91..a9bd175 100755
--- a/configure
+++ b/configure
@@ -554,8 +554,8 @@ fi
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
-if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
- err "libdir on windows should be set to 'bin'"
+if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "$CFG_BINDIR_RELATIVE" ]; then
+ err "Windows builds currently require that LIBDIR == BINDIR (we have libdir{$CFG_LIBDIR_RELATIVE} != bindir{$CFG_BINDIR_RELATIVE} )"
fi
CFG_BINDIR_RELATIVE=bin
--
2.1.3
@@ -1,7 +1,7 @@
From 4003a6e93e558fb327879b1d500bdbaa85ae06ae Mon Sep 17 00:00:00 2001
From 7de72f3bde37bf724704d541407aaf794909fd4d Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Wed, 3 Dec 2014 19:15:19 -0500
Subject: [PATCH] std/thread_local: workaround for NULL __dso_handle
Subject: [PATCH 10/10] std/thread_local: workaround for NULL __dso_handle
---
src/libstd/thread_local/mod.rs | 2 +-
+2 -4
View File
@@ -10,8 +10,6 @@ SRC_URI_append = "\
file://0006-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://0007-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://0008-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://0009-XXX-remove-conflicting-realpath-hack.patch \
file://0010-XXX-configure-unneeded-windows-check.patch \
file://0011-Parallelize-submake-invocations.patch \
file://0020-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://0009-Parallelize-submake-invocations.patch \
file://0010-std-thread_local-workaround-for-NULL-__dso_handle.patch \
"