update rust

This commit is contained in:
Cody P Schafer
2015-03-09 14:59:34 -04:00
parent 68f9ed6580
commit 6c977f2436
13 changed files with 88 additions and 85 deletions
@@ -1,7 +1,7 @@
From 2711cb85326a872fa88dc675ee9f51178db7e90f Mon Sep 17 00:00:00 2001
From 853675a3609aeb09e0fc6a00e84b8ab4c782a332 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/12] libstd/io/process/Command: fully quote and escape the
Subject: [PATCH 01/11] 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 0622debed9ff0047ce8c4c55fd027255c104ecb5 Mon Sep 17 00:00:00 2001
From 201c382eb7da7b74915f431617f839281d3451d2 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/12] std/io/process: add Debug tests
Subject: [PATCH 02/11] std/io/process: add Debug tests
---
src/libstd/old_io/process.rs | 12 ++++++++++++
@@ -1,7 +1,7 @@
From d113c693a7218f49b7e0f21b125df92bffb57c5e Mon Sep 17 00:00:00 2001
From f0e1084b376a00de29a881b3f3a27eefa7ea0a26 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/12] platform.mk: avoid choking on i586
Subject: [PATCH 03/11] platform.mk: avoid choking on i586
---
mk/platform.mk | 4 +++-
@@ -1,19 +1,28 @@
From fd1f1f2df5f9e3549e90191574b3e1bc515a0c5c Mon Sep 17 00:00:00 2001
From fc801fb0ea65149fcea4ba015338f43d6fb74be2 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/12] Target: add default target.json path:
Subject: [PATCH 04/11] Target: add default target.json path:
$libdir/rust/targets
---
src/librustc/session/config.rs | 6 +++---
src/librustc/session/mod.rs | 8 ++++++--
src/librustc_back/target/mod.rs | 8 +++++---
3 files changed, 14 insertions(+), 8 deletions(-)
src/librustc/session/config.rs | 8 ++++----
src/librustc/session/mod.rs | 8 ++++++--
src/librustc_back/target/mod.rs | 14 +++++++++++---
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 1b09be0..81a690b 100644
index 1b09be0..055e733 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -38,7 +38,7 @@ use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::env;
use std::fmt;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
use llvm;
@@ -661,12 +661,12 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}
@@ -21,7 +30,7 @@ index 1b09be0..81a690b 100644
-pub fn build_target_config(opts: &Options, sp: &SpanHandler) -> Config {
- let target = match Target::search(&opts.target_triple) {
+pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &SpanHandler) -> Config {
+ let target = match Target::search(sysroot, &opts.target_triple[]) {
+ let target = match Target::search(sysroot, &opts.target_triple[..]) {
Ok(t) => t,
Err(e) => {
sp.handler().fatal(&format!("Error loading target specification: {}", e));
@@ -31,7 +40,7 @@ index 1b09be0..81a690b 100644
let (int_type, uint_type) = match &target.target_pointer_width[..] {
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 8bc8426..5ccb50a 100644
index 8bc8426..fff142e 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -346,14 +346,18 @@ pub fn build_session_(sopts: config::Options,
@@ -40,7 +49,7 @@ index 8bc8426..5ccb50a 100644
-> Session {
- let host = match Target::search(config::host_triple()) {
+ let sysroot = match sopts.maybe_sysroot {
+ Some(ref x) => Path::new(x),
+ Some(ref x) => PathBuf::new(x),
+ None => filesearch::get_or_default_sysroot()
+ };
+ let host = match Target::search(&sysroot, config::host_triple()) {
@@ -56,10 +65,19 @@ index 8bc8426..5ccb50a 100644
let default_sysroot = match sopts.maybe_sysroot {
Some(_) => None,
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 4663901..a77b166 100644
index 4663901..f8e00c3 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -309,12 +309,13 @@ impl Target {
@@ -49,6 +49,8 @@ use serialize::json::Json;
use syntax::{diagnostic, abi};
use std::default::Default;
use std::io::prelude::*;
+use std::path::Path;
+use std::borrow::ToOwned;
mod windows_base;
mod linux_base;
@@ -309,12 +311,13 @@ impl Target {
///
/// The error string could come from any of the APIs called, including
/// filesystem access and JSON decoding.
@@ -74,15 +92,19 @@ index 4663901..a77b166 100644
fn load_file(path: &Path) -> Result<Target, String> {
let mut f = try!(File::open(path).map_err(|e| e.to_string()));
@@ -399,9 +400,10 @@ impl Target {
@@ -399,9 +402,14 @@ impl Target {
let target_path = env::var_os("RUST_TARGET_PATH")
.unwrap_or(OsString::from_str(""));
- // FIXME 16351: add a sane default search path?
+ let paths = env::split_paths(&target_path)
+ .chain(Some(sysroot.join_many(&[env!("CFG_LIBDIR_RELATIVE"), "rustlib"])).into_iter());
+ let mut default_path = sysroot.to_owned();
+ default_path.push(env!("CFG_LIBDIR_RELATIVE"));
+ default_path.push("rustlib");
- for dir in env::split_paths(&target_path) {
+ let paths = env::split_paths(&target_path)
+ .chain(Some(default_path).into_iter());
+
+ for dir in paths {
let p = dir.join(&path);
if p.is_file() {
@@ -1,25 +0,0 @@
From 38f4a903ceb9d96d9229540a19c8449739ebf2ef 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/12] mk/rt/compiler_rt: pass LDFLAGS from
CFG_GCCISH_LINK_FLAGS
---
mk/rt.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/mk/rt.mk b/mk/rt.mk
index 527485c..21280be 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -230,6 +230,7 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
AR="$$(AR_$(1))" \
RANLIB="$$(AR_$(1)) s" \
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
+ LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
TargetTriple=$(1) \
triple-builtins
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
--
2.3.1
@@ -1,7 +1,7 @@
From 120438ca81750d676159892a0cc140fd01bbe716 Mon Sep 17 00:00:00 2001
From c6f41099f8d1f183b8d08c0b59825ce459bdc2d4 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/12] mk: for stage0, use RUSTFLAGS to override target libs
Subject: [PATCH 05/11] 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 96c2d7ed4abd5ced4d3550772299d78a74f3e2ae Mon Sep 17 00:00:00 2001
From bb95f40560c254a8e2a605a7cdeaaf4145487749 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/12] mk: add missing CFG_LIBDIR_RELATIVE
Subject: [PATCH 06/11] mk: add missing CFG_LIBDIR_RELATIVE
---
mk/grammar.mk | 4 ++--
@@ -1,7 +1,7 @@
From 85b07a028ac5719da41ece758b114408a1e0c79a Mon Sep 17 00:00:00 2001
From 6aa48e1c7e299eda8cc40e95f9027d9c61eabd54 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/12] configure: support --bindir, and extend libdir to
Subject: [PATCH 07/11] configure: support --bindir, and extend libdir to
non-blessed dirs
Adds --bindir, and:
@@ -13,17 +13,17 @@ relative to sysroot, and allows libdir to end in an arbitrary directory
Note that this assumes absolute paths start with '/', which may break
windows platforms
---
configure | 49 +++++++++++++++++------
configure | 51 +++++++++++++++++-------
mk/host.mk | 6 ++-
mk/main.mk | 11 +++++
mk/main.mk | 11 ++++++
mk/perf.mk | 4 +-
mk/prepare.mk | 4 +-
src/librustc/metadata/filesearch.rs | 80 ++++++++++++++-----------------------
src/librustc/metadata/filesearch.rs | 78 ++++++++++++++-----------------------
src/librustc_trans/back/link.rs | 3 +-
7 files changed, 87 insertions(+), 70 deletions(-)
7 files changed, 88 insertions(+), 69 deletions(-)
diff --git a/configure b/configure
index d56000b..c59c6f2 100755
index d56000b..9026ae1 100755
--- a/configure
+++ b/configure
@@ -309,6 +309,31 @@ envopt() {
@@ -58,7 +58,16 @@ index d56000b..c59c6f2 100755
to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -570,23 +595,15 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
@@ -563,6 +588,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
CFG_HOST=$(to_llvm_triple $CFG_HOST)
CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
+CFG_LIBDIR_RELATIVE=lib
+
# On windows we just store the libraries in the bin directory because
# there's no rpath. This is where the build system itself puts libraries;
# --libdir is used to configure the installation directory.
@@ -570,23 +597,15 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
then
CFG_LIBDIR_RELATIVE=bin
@@ -87,7 +96,7 @@ index d56000b..c59c6f2 100755
fi
if [ $HELP -eq 1 ]
@@ -595,6 +612,11 @@ then
@@ -595,6 +614,11 @@ then
exit 0
fi
@@ -99,7 +108,7 @@ index d56000b..c59c6f2 100755
# Validate Options
step_msg "validating $CFG_SELF args"
validate_opt
@@ -1361,6 +1383,7 @@ putvar CFG_PREFIX
@@ -1361,6 +1385,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
@@ -195,7 +204,7 @@ index f1c4aa6..37c0a1a 100644
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
prepare-base-$(1): prepare-everything-$(1)
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 22a4a6f..c9148bc 100644
index 22a4a6f..ed21d50 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> {
@@ -228,13 +237,11 @@ index 22a4a6f..c9148bc 100644
assert!(p.is_relative());
p.push(&rustlibdir());
p.push(target_triple);
@@ -175,18 +174,25 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf
}
@@ -176,17 +175,24 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf
fn make_target_lib_path(sysroot: &Path,
- target_triple: &str) -> PathBuf {
target_triple: &str) -> PathBuf {
- sysroot.join(&relative_target_lib_path(sysroot, target_triple))
+ target_triple: &str) -> BufPath {
+ sysroot.join(&relative_target_lib_path(target_triple))
}
@@ -1,7 +1,7 @@
From ebe9f1d9d76c62317858d9643ab6baf0e15fd267 Mon Sep 17 00:00:00 2001
From d3e5ed1cd54f4534f830011846fa7a08f5a8db3e 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 09/12] Parallelize submake invocations
Subject: [PATCH 08/11] Parallelize submake invocations
---
mk/clean.mk | 2 +-
@@ -77,7 +77,7 @@ index b07c2a1..683dc60 100644
touch -r $$@.start_time $$@ && rm $$@.start_time
diff --git a/mk/rt.mk b/mk/rt.mk
index 21280be..7f5af72 100644
index 527485c..5d82a11 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -181,7 +181,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
@@ -98,7 +98,7 @@ index 21280be..7f5af72 100644
ProjSrcRoot="$(S)src/compiler-rt" \
ProjObjRoot="$$(abspath $$(COMPRT_BUILD_DIR_$(1)))" \
CC="$$(CC_$(1))" \
@@ -301,7 +301,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
@@ -300,7 +300,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
$$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
@$$(call E, make: libbacktrace)
@@ -1,7 +1,7 @@
From 063c1fe978d1198948ece9cea28532b2ad21e208 Mon Sep 17 00:00:00 2001
From 60877d415f3a1f61c5913de68813e1f869673d57 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 10/12] std/thread_local: workaround for NULL __dso_handle
Subject: [PATCH 09/11] std/thread_local: workaround for NULL __dso_handle
---
src/libstd/thread_local/mod.rs | 2 +-
@@ -1,7 +1,7 @@
From 99bff656142992e54bbf6bec1fa0d532fce13e8d Mon Sep 17 00:00:00 2001
From c672135095f7335b98d46f2e378d4dc5b335bbf7 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 12:57:24 -0500
Subject: [PATCH 11/12] configure & install: support disabling calling of
Subject: [PATCH 10/11] configure & install: support disabling calling of
ldconfig
---
@@ -10,7 +10,7 @@ Subject: [PATCH 11/12] configure & install: support disabling calling of
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index c59c6f2..8200544 100755
index 9026ae1..92858c3 100755
--- a/configure
+++ b/configure
@@ -554,6 +554,7 @@ opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
@@ -1,7 +1,7 @@
From 4c4bce191ec06eddd237481dcb1c3489e9b03921 Mon Sep 17 00:00:00 2001
From 513486437ad3ee406edf87ba95651542180df119 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 13:34:59 -0500
Subject: [PATCH 12/12] mk/install: use disable-rewrite-paths
Subject: [PATCH 11/11] mk/install: use disable-rewrite-paths
This stops the install scripts from doing work we've already handled.
+8 -9
View File
@@ -6,15 +6,14 @@ SRC_URI_append = "\
file://0001-libstd-io-process-Command-fully-quote-and-escape-the.patch \
file://0002-std-io-process-add-Debug-tests.patch \
file://0003-platform.mk-avoid-choking-on-i586.patch \
file://0004-mk-rt-compiler_rt-pass-LDFLAGS-from-CFG_GCCISH_LINK_.patch \
file://0005-Target-add-default-target.json-path-libdir-rust-targ.patch \
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-Parallelize-submake-invocations.patch \
file://0010-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://0011-configure-install-support-disabling-calling-of-ldcon.patch \
file://0012-mk-install-use-disable-rewrite-paths.patch \
file://0004-Target-add-default-target.json-path-libdir-rust-targ.patch \
file://0005-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://0006-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://0007-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://0008-Parallelize-submake-invocations.patch \
file://0009-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://0010-configure-install-support-disabling-calling-of-ldcon.patch \
file://0011-mk-install-use-disable-rewrite-paths.patch \
\
file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
"