rust: update to modern version

This commit is contained in:
Cody P Schafer
2015-05-26 11:11:15 -04:00
parent cc7f43afae
commit ee6dbd5854
16 changed files with 153 additions and 482 deletions
@@ -1,74 +0,0 @@
From 116d45a000c9ce5a9bcba8c413066c5179cfac05 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/13] 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
the user does not expect) unambiguous.
It also makes any usage of a literal ' (single quote) in arguments or
the command name unambiguous by escaping them in the same style as posix
shell.
---
src/libstd/old_io/process.rs | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs
index 54fd20f4..d201f3b 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -34,6 +34,7 @@ use sync::mpsc::{channel, Receiver};
use sys::fs::FileDesc;
use sys::process::Process as ProcessImp;
use sys;
+use string::CowString;
use thread;
#[cfg(windows)] use hash;
@@ -400,15 +401,39 @@ impl Command {
}
}
+struct SingleQuotedStr<'a> {
+ s: CowString<'a>
+}
+
+impl<'b> SingleQuotedStr<'b> {
+ fn new<'a>(i: CowString<'a>) -> SingleQuotedStr<'a> {
+ SingleQuotedStr { s: i }
+ }
+}
+
+impl<'a> fmt::Debug for SingleQuotedStr<'a> {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ let mut elems = self.s.split('\'');
+ let fst = elems.next().unwrap_or("");
+ try!(write!(f, "'{:?}", fst));
+ for elem in elems {
+ try!(write!(f, "'\\''{:?}", elem));
+ }
+ write!(f, "'")
+ }
+}
+
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for Command {
/// Format the program and arguments of a Command for display. Any
/// non-utf8 data is lossily converted using the utf8 replacement
/// character.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- try!(write!(f, "{:?}", self.program));
- for arg in &self.args {
- try!(write!(f, " '{:?}'", arg));
+ try!(write!(f, "{:?}", SingleQuotedStr::new(String::from_utf8_lossy(
+ self.program.as_bytes()))));
+ for arg in self.args.iter() {
+ try!(write!(f, " {:?}", SingleQuotedStr::new(String::from_utf8_lossy(
+ arg.as_bytes()))));
}
Ok(())
}
--
2.3.3
@@ -1,14 +1,14 @@
From 6ad97fa123626a4d13d7c761683245e76784902b Mon Sep 17 00:00:00 2001
From 5132c9c4056ce5837f82b0a68da38d3895710355 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/13] platform.mk: avoid choking on i586
Subject: [PATCH 1/9] platform.mk: avoid choking on i586
---
mk/platform.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/platform.mk b/mk/platform.mk
index ed50585..14221d7 100644
index 26a6db1..72f2b4a 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -14,7 +14,9 @@
@@ -23,5 +23,5 @@ index ed50585..14221d7 100644
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))
--
2.3.3
2.4.1
@@ -1,21 +1,21 @@
From 0c6d20636de66db860c441e097b21df04243c392 Mon Sep 17 00:00:00 2001
From a728ae609845a3ae7ee74f8de8c92bf086674237 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 04/13] Target: add default target.json path:
Subject: [PATCH 2/9] Target: add default target.json path:
$libdir/rust/targets
---
src/librustc/session/config.rs | 8 ++++----
src/librustc/session/config.rs | 6 +++---
src/librustc/session/mod.rs | 8 ++++++--
src/librustc_back/target/mod.rs | 14 +++++++++++---
3 files changed, 21 insertions(+), 9 deletions(-)
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index e368a66..4ea57b0 100644
index 48fe574..78919ba 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};
@@ -37,7 +37,7 @@ use getopts;
use std::collections::HashMap;
use std::env;
use std::fmt;
-use std::path::PathBuf;
@@ -23,7 +23,7 @@ index e368a66..4ea57b0 100644
use llvm;
@@ -661,12 +661,12 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
@@ -665,8 +665,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}
@@ -34,22 +34,17 @@ index e368a66..4ea57b0 100644
Ok(t) => t,
Err(e) => {
sp.handler().fatal(&format!("Error loading target specification: {}", e));
- }
+ }
};
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..fff142e 100644
index 6b5f587..4432440 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -346,14 +346,18 @@ pub fn build_session_(sopts: config::Options,
@@ -381,14 +381,18 @@ pub fn build_session_(sopts: config::Options,
local_crate_source_file: Option<PathBuf>,
span_diagnostic: diagnostic::SpanHandler)
-> Session {
- let host = match Target::search(config::host_triple()) {
+ let sysroot = match sopts.maybe_sysroot {
+ Some(ref x) => PathBuf::new(x),
+ Some(ref x) => PathBuf::from(x),
+ None => filesearch::get_or_default_sysroot()
+ };
+ let host = match Target::search(&sysroot, config::host_triple()) {
@@ -61,23 +56,23 @@ index 8bc8426..fff142e 100644
};
- let target_cfg = config::build_target_config(&sopts, &span_diagnostic);
+ let target_cfg = config::build_target_config(&sysroot, &sopts, &span_diagnostic);
let p_s = parse::new_parse_sess_special_handler(span_diagnostic);
let p_s = parse::ParseSess::with_span_handler(span_diagnostic);
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..f8e00c3 100644
index 22d9660..ed98477 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -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 syntax::{diagnostic, abi};
+use std::borrow::ToOwned;
+use std::path::Path;
mod windows_base;
mod linux_base;
@@ -309,12 +311,13 @@ impl Target {
mod android_base;
mod apple_base;
@@ -305,12 +307,13 @@ impl Target {
///
/// The error string could come from any of the APIs called, including
/// filesystem access and JSON decoding.
@@ -94,7 +89,7 @@ index 4663901..f8e00c3 100644
let mut f = try!(File::open(path).map_err(|e| e.to_string()));
@@ -399,9 +402,14 @@ impl Target {
let target_path = env::var_os("RUST_TARGET_PATH")
.unwrap_or(OsString::from_str(""));
.unwrap_or(OsString::new());
- // FIXME 16351: add a sane default search path?
+ let mut default_path = sysroot.to_owned();
@@ -110,5 +105,5 @@ index 4663901..f8e00c3 100644
if p.is_file() {
return load_file(&p);
--
2.3.3
2.4.1
@@ -1,33 +0,0 @@
From 50cac2149528f7400c7623e5fd31cf579e18a82b 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/13] std/io/process: add Debug tests
---
src/libstd/old_io/process.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs
index d201f3b..f4dbd68 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -1262,4 +1262,16 @@ mod tests {
let val = env.get(&EnvKey(CString::new("PATH").unwrap()));
assert!(val.unwrap() == &CString::new("bar").unwrap());
}
+
+ fn check_debug<D : fmt::Debug>(c: D, v: &str) {
+ assert_eq!(format!("{:?}", c), v)
+ }
+
+ #[test]
+ fn debug() {
+ check_debug(Command::new("gcc ").arg("-Ifoo'bar"), "'gcc ' '-Ifoo'\\''bar'");
+ check_debug(Command::new("c99"), "'c99'");
+ check_debug(Command::new("c99 "), "'c99 '");
+ check_debug(Command::new("Can't buy me love"), "'Can'\\''t buy me love'");
+ }
}
--
2.3.3
@@ -1,8 +1,7 @@
From 9214b3532667cf8f734acd4e61beaec2e52cd09f Mon Sep 17 00:00:00 2001
From 614552b0678ffe0e07282dd18e7c6b8ef5c4043c 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 05/13] mk: for stage0, use RUSTFLAGS to override target libs
dir
Subject: [PATCH 3/9] mk: for stage0, use RUSTFLAGS to override target libs dir
Setting HLIB specially for stage0 (and even more specially for windows)
also affects the location we place TLIB. To keep the TLIBs we build in
@@ -13,10 +12,10 @@ stage0-rustc at the appropriate location.
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/mk/main.mk b/mk/main.mk
index b9f2cf1..f8c0488 100644
index de5adfd..13bed1b 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -362,21 +362,22 @@ define SREQ
@@ -375,21 +375,22 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
@@ -47,7 +46,7 @@ index b9f2cf1..f8c0488 100644
# Preqrequisites for using the stageN compiler
ifeq ($(1),0)
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
@@ -488,6 +489,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
@@ -501,6 +502,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
@@ -55,7 +54,7 @@ index b9f2cf1..f8c0488 100644
$$(RUSTC_FLAGS_$(2))
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -496,6 +498,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -509,6 +511,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
@@ -64,5 +63,5 @@ index b9f2cf1..f8c0488 100644
endef
--
2.3.3
2.4.1
@@ -1,7 +1,7 @@
From 3f457496ba8184b44f74507c65f79e0819d62a4e Mon Sep 17 00:00:00 2001
From 331bf90f1a59e96749d17b005dd84cf7bd3c785a 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 06/13] mk: add missing CFG_LIBDIR_RELATIVE
Subject: [PATCH 4/9] mk: add missing CFG_LIBDIR_RELATIVE
---
mk/grammar.mk | 4 ++--
@@ -23,5 +23,5 @@ index d9c66e2..585206d 100644
ifeq ($(CFG_OSTYPE),apple-darwin)
FLEX_LDFLAGS=-ll
--
2.3.3
2.4.1
@@ -1,7 +1,7 @@
From 4113b24b2f14225ada5e21fd409042e855de69dc Mon Sep 17 00:00:00 2001
From 66dbf7c11151c2c3419786161233576f07c850b0 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 07/13] configure: support --bindir, and extend libdir to
Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to
non-blessed dirs
Adds --bindir, and:
@@ -13,20 +13,20 @@ 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 | 51 +++++++++++++++++-------
configure | 49 ++++++++++++++++------
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 | 78 ++++++++++++++-----------------------
src/librustc/metadata/filesearch.rs | 84 ++++++++++++++-----------------------
src/librustc_trans/back/link.rs | 3 +-
7 files changed, 88 insertions(+), 69 deletions(-)
7 files changed, 90 insertions(+), 71 deletions(-)
diff --git a/configure b/configure
index fdc28ee..d63956a 100755
index efa836c..368bc50 100755
--- a/configure
+++ b/configure
@@ -309,6 +309,31 @@ envopt() {
@@ -323,6 +323,31 @@ envopt() {
fi
}
@@ -58,7 +58,7 @@ index fdc28ee..d63956a 100755
to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -566,6 +591,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
@@ -606,6 +631,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)
@@ -67,8 +67,8 @@ index fdc28ee..d63956a 100755
# 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.
@@ -573,23 +600,15 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
@@ -613,24 +640,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ]
then
CFG_LIBDIR_RELATIVE=bin
-else
@@ -88,27 +88,20 @@ index fdc28ee..d63956a 100755
+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries"
-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
if [ $HELP -eq 1 ]
@@ -598,6 +617,11 @@ then
exit 0
fi
+# Determine libdir and bindir relative to prefix
+step_msg "calculating relative paths to prefix = ${CFG_PREFIX}"
+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
@@ -1365,6 +1389,7 @@ putvar CFG_PREFIX
if ( [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] ) \
- && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
- err "libdir on windows should be set to 'bin'"
+ && [ "$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
if [ $HELP -eq 1 ]
@@ -1567,6 +1591,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
@@ -136,10 +129,10 @@ index 59a0095..b8e8345 100644
endef
diff --git a/mk/main.mk b/mk/main.mk
index f8c0488..db19ae4 100644
index 13bed1b..aa2d4ba 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -331,7 +331,9 @@ export CFG_RELEASE_CHANNEL
@@ -344,7 +344,9 @@ export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT
export CFG_PREFIX
export CFG_LIBDIR
@@ -149,7 +142,7 @@ index f8c0488..db19ae4 100644
export CFG_DISABLE_INJECT_STD_VERSION
ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
@@ -361,7 +363,16 @@ define SREQ
@@ -374,7 +376,16 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
@@ -187,10 +180,10 @@ index 16cbaab..f8a354c 100644
endif
diff --git a/mk/prepare.mk b/mk/prepare.mk
index 4ded8a7..84c7bf2 100644
index 573b7ac..c8085bd 100644
--- a/mk/prepare.mk
+++ b/mk/prepare.mk
@@ -168,10 +168,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
@@ -177,10 +177,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
define DEF_PREPARE
prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
@@ -204,7 +197,7 @@ index 4ded8a7..84c7bf2 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..ed21d50 100644
index 311ab1c..1b03b1a 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> {
@@ -217,10 +210,19 @@ index 22a4a6f..ed21d50 100644
debug!("is {} in visited_dirs? {}", tlib_path.display(),
visited_dirs.contains(&tlib_path));
@@ -96,7 +95,7 @@ impl<'a> FileSearch<'a> {
where F: FnMut(&Path, PathKind) -> FileMatch
{
self.for_each_lib_search_path(|lib_search_path, kind| {
- debug!("searching {}", lib_search_path.display());
+ info!("searching {}", lib_search_path.display());
match fs::read_dir(lib_search_path) {
Ok(files) => {
let files = files.filter_map(|p| p.ok().map(|s| s.path()))
@@ -157,7 +156,7 @@ impl<'a> FileSearch<'a> {
// Returns a list of directories where target-specific tool binaries are located.
pub fn get_tools_search_paths(&self) -> Vec<PathBuf> {
let mut p = PathBuf::new(self.sysroot);
let mut p = PathBuf::from(self.sysroot);
- p.push(&find_libdir(self.sysroot));
+ p.push(libdir_str());
p.push(&rustlibdir());
@@ -231,13 +233,13 @@ index 22a4a6f..ed21d50 100644
}
-pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
- let mut p = PathBuf::new(&find_libdir(sysroot));
- let mut p = PathBuf::from(&find_libdir(sysroot));
+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf {
+ let mut p = PathBuf::new(&libdir_str());
+ let mut p = PathBuf::from(&libdir_str());
assert!(p.is_relative());
p.push(&rustlibdir());
p.push(target_triple);
@@ -176,17 +175,24 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf
@@ -176,17 +175,28 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf
fn make_target_lib_path(sysroot: &Path,
target_triple: &str) -> PathBuf {
@@ -260,13 +262,17 @@ index 22a4a6f..ed21d50 100644
+}
+
+pub fn bindir_relative_path() -> PathBuf {
+ PathBuf::new(bindir_relative_str())
+ PathBuf::from(bindir_relative_str())
+}
+
+pub fn libdir_str() -> &'static str {
+ env!("CFG_LIBDIR_RELATIVE")
+}
+
pub fn get_or_default_sysroot() -> PathBuf {
// Follow symlinks. If the resolved path is relative, make it absolute.
fn canonicalize(path: Option<PathBuf>) -> Option<PathBuf> {
@@ -199,7 +205,17 @@ pub fn get_or_default_sysroot() -> PathBuf {
@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf {
}
match canonicalize(env::current_exe().ok()) {
@@ -275,6 +281,7 @@ index 22a4a6f..ed21d50 100644
+ // Remove the exe name
+ p.pop();
+ let mut rel = bindir_relative_path();
+
+ // Remove a number of elements equal to the number of elements in the bindir relative
+ // path
+ while rel.pop() {
@@ -285,7 +292,7 @@ index 22a4a6f..ed21d50 100644
None => panic!("can't determine value for sysroot")
}
}
@@ -254,45 +270,9 @@ pub fn rust_path() -> Vec<PathBuf> {
@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec<PathBuf> {
env_rust_path
}
@@ -328,17 +335,16 @@ index 22a4a6f..ed21d50 100644
-#[cfg(windows)]
-fn find_libdir(_sysroot: &Path) -> String {
- "bin".to_string()
+// The name of the directory rustc expects libraries to be located, relative to the sysroot
+fn libdir_str() -> &'static str {
+ env!("CFG_LIBDIR_RELATIVE")
}
-}
-
// The name of rustc's own place to organize libraries.
// Used to be "rustc", now the default is "rustlib"
pub fn rustlibdir() -> String {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 34a23f3..5a81790 100644
index 844a0a6..9f5b12c 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -1015,11 +1015,10 @@ fn link_args(cmd: &mut Command,
@@ -984,11 +984,10 @@ fn link_args(cmd: &mut Linker,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {
@@ -348,9 +354,9 @@ index 34a23f3..5a81790 100644
let install_prefix = option_env!("CFG_PREFIX").expect("CFG_PREFIX");
- let tlib = filesearch::relative_target_lib_path(sysroot, target_triple);
+ let tlib = filesearch::relative_target_lib_path(target_triple);
let mut path = PathBuf::new(install_prefix);
let mut path = PathBuf::from(install_prefix);
path.push(&tlib);
--
2.3.3
2.4.1
@@ -1,17 +1,17 @@
From 1d2eadd39ff0d51f28be970aa081979242de8da1 Mon Sep 17 00:00:00 2001
From 739f9cd792311c4a6c1bf5ad2b99a29e44d3aebf 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 09/13] std/thread_local: workaround for NULL __dso_handle
Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle
---
src/libstd/thread_local/mod.rs | 2 +-
src/libstd/thread/local.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index 0878029..cbadc28 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -402,7 +402,7 @@ mod imp {
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 2e043c5..add3e51 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -363,7 +363,7 @@ mod imp {
#[linkage = "extern_weak"]
static __cxa_thread_atexit_impl: *const ();
}
@@ -21,5 +21,5 @@ index 0878029..cbadc28 100644
arg: *mut u8,
dso_handle: *mut u8) -> libc::c_int;
--
2.3.3
2.4.1
@@ -1,7 +1,7 @@
From fe2537c9f307b81b12b39aba612b9d8ceb61b762 Mon Sep 17 00:00:00 2001
From a4fd94b8986d8a05e76f86f3fd661dc1f9259b28 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 11/13] mk/install: use disable-rewrite-paths
Subject: [PATCH 7/9] mk/install: use disable-rewrite-paths
This stops the install scripts from doing work we've already handled.
@@ -11,33 +11,33 @@ Path rewriting is only useful for prepackaged binary installers.
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/install.mk b/mk/install.mk
index c8bed09..edaea49 100644
index cabc97a..273bb0e 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -26,9 +26,9 @@ else
$(Q)$(P)$(MAKE) prepare_install
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" $(CFG_INSTALL_OPTS)
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" $(CFG_INSTALL_OPTS)
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -42,9 +42,9 @@ else
$(Q)$(P)$(MAKE) prepare_uninstall
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" $(CFG_INSTALL_OPTS)
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" $(CFG_INSTALL_OPTS)
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.3.3
2.4.1
@@ -1,123 +0,0 @@
From 40e421711db1c44f18f4e7ecdb337e7f7fe2a22c 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 08/13] Parallelize submake invocations
---
mk/clean.mk | 2 +-
mk/install.mk | 8 ++++----
mk/llvm.mk | 6 +++---
mk/rt.mk | 6 +++---
mk/util.mk | 2 ++
5 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/mk/clean.mk b/mk/clean.mk
index 5b90d41..2a7ba6d 100644
--- a/mk/clean.mk
+++ b/mk/clean.mk
@@ -122,7 +122,7 @@ $(foreach host, $(CFG_HOST), \
define DEF_CLEAN_LLVM_HOST
ifeq ($(CFG_LLVM_ROOT),)
clean-llvm$(1):
- $$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean
+ $$(Q)$$(P)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean
else
clean-llvm$(1): ;
diff --git a/mk/install.mk b/mk/install.mk
index 8850cd7..8878cf5 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -17,9 +17,9 @@ endif
install:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
# Build the dist as the original user
- $(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_install
+ $(Q)$(P)sudo -u "$$SUDO_USER" $(MAKE) prepare_install
else
- $(Q)$(MAKE) prepare_install
+ $(Q)$(P)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
@@ -33,9 +33,9 @@ prepare_install: dist-tar-bins | tmp/empty_dir
uninstall:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
# Build the dist as the original user
- $(Q)sudo -u "$$SUDO_USER" $(MAKE) prepare_uninstall
+ $(Q)$(P)sudo -u "$$SUDO_USER" $(MAKE) prepare_uninstall
else
- $(Q)$(MAKE) prepare_uninstall
+ $(Q)$(P)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
diff --git a/mk/llvm.mk b/mk/llvm.mk
index 1861dd3..00c39f8 100644
--- a/mk/llvm.mk
+++ b/mk/llvm.mk
@@ -28,7 +28,7 @@ LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
@$$(call E, make: llvm)
- $$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1)) ONLY_TOOLS="$$(LLVM_TOOLS)"
+ $$(Q)$$(P)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1)) ONLY_TOOLS="$$(LLVM_TOOLS)"
$$(Q)touch $$(LLVM_CONFIG_$(1))
endif
@@ -38,8 +38,8 @@ endif
# the stamp in the source dir.
$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
@$$(call E, make: cleaning llvm)
- $(Q)touch $$@.start_time
- $(Q)$(MAKE) clean-llvm$(1)
+ $$(Q)touch $$@.start_time
+ $$(Q)$$(P)$$(MAKE) clean-llvm$(1)
@$$(call E, make: done cleaning llvm)
touch -r $$@.start_time $$@ && rm $$@.start_time
diff --git a/mk/rt.mk b/mk/rt.mk
index 527485c..5d82a11 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -181,7 +181,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
RANLIB="$$(AR_$(1)) s" \
CPPFLAGS="-I $(S)src/rt/" \
EXTRA_CFLAGS="-g1 -ffunction-sections -fdata-sections"
- $$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
+ $$(Q)$$(P)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
ifeq ($$(CFG_DISABLE_JEMALLOC),)
RUSTFLAGS_alloc := --cfg jemalloc
@@ -223,7 +223,7 @@ COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
@$$(call E, make: compiler-rt)
- $$(Q)$$(MAKE) -C "$(S)src/compiler-rt" \
+ $$(Q)$$(P)$$(MAKE) -C "$(S)src/compiler-rt" \
ProjSrcRoot="$(S)src/compiler-rt" \
ProjObjRoot="$$(abspath $$(COMPRT_BUILD_DIR_$(1)))" \
CC="$$(CC_$(1))" \
@@ -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)
- $$(Q)$$(MAKE) -C $$(BACKTRACE_BUILD_DIR_$(1)) \
+ $$(Q)$$(P)$$(MAKE) -C $$(BACKTRACE_BUILD_DIR_$(1)) \
INCDIR=$(S)src/libbacktrace
$$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
diff --git a/mk/util.mk b/mk/util.mk
index b419c0b..0dd68dd 100644
--- a/mk/util.mk
+++ b/mk/util.mk
@@ -16,4 +16,6 @@ else
E = echo $(1)
endif
+P = +
+
S := $(CFG_SRC_DIR)
--
2.3.3
@@ -1,65 +1,40 @@
From d009973a538bc272b51e8502116918329dbb97ae Mon Sep 17 00:00:00 2001
From 5bf79280fddac29f5ebd3055a3bfedc094448004 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 10/13] configure & install: support disabling calling of
ldconfig
Date: Tue, 26 May 2015 12:09:36 -0400
Subject: [PATCH 8/9] install: disable ldconfig
---
configure | 1 +
mk/install.mk | 12 ++++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
mk/install.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index d63956a..822b8f7 100755
--- a/configure
+++ b/configure
@@ -557,6 +557,7 @@ opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
opt rpath 0 "build rpaths into rustc itself"
opt nightly 0 "build nightly packages"
opt verify-install 1 "verify installed binaries work"
+opt ldconfig 1 "try to run ldconfig on linux systems to complete the install"
# This is used by the automation to produce single-target nightlies
opt dist-host-only 0 "only install bins for the host architecture"
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
diff --git a/mk/install.mk b/mk/install.mk
index 8878cf5..c8bed09 100644
index 273bb0e..58cfc99 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -14,6 +14,10 @@ else
MAYBE_DISABLE_VERIFY=
endif
+ifdef CFG_DISABLE_LDCONFIG
+CFG_INSTALL_OPTS +=--disable-ldconfig
+endif
+
install:
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
# Build the dist as the original user
@@ -22,9 +26,9 @@ else
$(Q)$(P)$(MAKE) prepare_install
@@ -16,9 +16,9 @@ else
$(Q)$(MAKE) prepare_install
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
@@ -38,9 +42,9 @@ else
$(Q)$(P)$(MAKE) prepare_uninstall
@@ -32,9 +32,9 @@ else
$(Q)$(MAKE) prepare_uninstall
endif
ifeq ($(CFG_DISABLE_DOCS),)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(DOC_PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
endif
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" $(CFG_INSTALL_OPTS)
- $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths
+ $(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" --disable-rewrite-paths --disable-ldconfig
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist
--
2.3.3
2.4.1
@@ -1,40 +0,0 @@
From df8c5991b2417ab0458efc114f0fe458143a2c00 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 9 Mar 2015 16:33:27 -0400
Subject: [PATCH 12/13] filesearch: add info! to show path searching
---
src/librustc/metadata/filesearch.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index ed21d50..d6dc516 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -46,6 +46,7 @@ impl<'a> FileSearch<'a> {
let mut found = false;
for (path, kind) in self.search_paths.iter(self.kind) {
+ info!("Searching {:?} for {:?}", path, kind);
match f(path, kind) {
FileMatches => found = true,
FileDoesntMatch => ()
@@ -57,6 +58,7 @@ impl<'a> FileSearch<'a> {
let tlib_path = make_target_lib_path(self.sysroot,
self.triple);
if !visited_dirs.contains(&tlib_path) {
+ info!("Searching {:?} for {:?}", tlib_path, PathKind::All);
match f(&tlib_path, PathKind::All) {
FileMatches => found = true,
FileDoesntMatch => ()
@@ -76,6 +78,7 @@ impl<'a> FileSearch<'a> {
visited_dirs.insert(tlib_path.clone());
// Don't keep searching the RUST_PATH if one match turns up --
// if we did, we'd get a "multiple matching crates" error
+ info!("Searching {:?} for {:?}", tlib_path, PathKind::All);
match f(&tlib_path, PathKind::All) {
FileMatches => {
break;
--
2.3.3
@@ -1,28 +0,0 @@
From 029b75f89707bb47f1fae0e02312525661233e96 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 9 Mar 2015 17:29:02 -0400
Subject: [PATCH 13/13] filesearch: fix for new path
---
src/librustc/metadata/filesearch.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index d6dc516..3946376 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -217,6 +217,11 @@ pub fn get_or_default_sysroot() -> PathBuf {
while rel.pop() {
p.pop();
}
+
+ // The last element in a relative path can't be popped, so remove it here.
+ if let Some(_) = p.file_name() {
+ p.pop();
+ }
p
}
None => panic!("can't determine value for sysroot")
--
2.3.3
@@ -1,4 +1,4 @@
From c450a78a454be2848c896da3bba22ee209b053d2 Mon Sep 17 00:00:00 2001
From c7daec775a917d9e3017bc35ea7d88cc9418f181 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 2 Mar 2015 13:27:49 -0500
Subject: [PATCH] add option to disable rewriting of install paths
@@ -14,10 +14,10 @@ case:
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/install-template.sh b/install-template.sh
index fea699b..caa9e24 100644
index 042b955..4ecf430 100644
--- a/install-template.sh
+++ b/install-template.sh
@@ -605,16 +605,18 @@ install_components() {
@@ -618,16 +618,18 @@ install_components() {
# Decide the destination of the file
local _file_install_path="$_dest_prefix/$_file"
@@ -45,14 +45,14 @@ index fea699b..caa9e24 100644
fi
# Make sure there's a directory for it
@@ -794,6 +796,7 @@ valopt mandir "$CFG_DESTDIR_PREFIX/share/man" "install man pages in PATH"
@@ -810,6 +812,7 @@ valopt mandir "$CFG_DESTDIR_PREFIX/share/man" "install man pages in PATH"
opt ldconfig 1 "run ldconfig after installation (Linux only)"
opt verify 1 "obsolete"
flag verbose "run with verbose output"
+opt rewrite-paths 1 "enable rewriting install paths for libdir & mandir"
+opt rewrite-paths 1 "rewrite install paths for libdir & mandir"
if [ $HELP -eq 1 ]
then
--
2.3.1
2.4.1
+1 -1
View File
@@ -22,7 +22,7 @@ LIC_FILES_CHKSUM ="\
## stage0 (format_args!() change)
USE_LOCAL_RUST ??= "0"
SRC_URI += "${@base_conditional('USE_LOCAL_RUST', '1', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0', '', d)}"
SRC_URI += "${@base_conditional('USE_LOCAL_RUST', '1', '', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0', d)}"
# We generate local targets, and need to be able to locate them
export RUST_TARGET_PATH="${WORKDIR}/targets/"
+12 -18
View File
@@ -1,25 +1,19 @@
# 2015-03-23
SRCREV = "b0aad7dd4fad8d7e2e2f877a511a637258949597"
# 2015-05-26
SRCREV = "c654a07d29c77b5a023cb9d36dfc61811349f64e"
require rust-git.inc
RUST_SNAPSHOT = "rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2"
SRC_URI[md5sum] = "6447489e0009519c845b8e350c220636"
SRC_URI[sha256sum] = "b62eed6bdb3cb356c90d587e9d9ee7fb5aedad917ff872c04e67e20b4c8f1c91"
RUST_SNAPSHOT = "rust-stage0-2015-04-27-857ef6e-linux-x86_64-94089740e48167c5975c92c139ae9c286764012f.tar.bz2"
SRC_URI[md5sum] = "e0d49475a787aaa9481ec0b1a28d1f7a"
SRC_URI[sha256sum] = "e7858a90c2c6c35299ebe2cb6425f3f84d0ba171dcbce20ff68295a1ff75c7e5"
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-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://0012-filesearch-add-info-to-show-path-searching.patch \
file://0001-platform.mk-avoid-choking-on-i586.patch \
file://0002-Target-add-default-target.json-path-libdir-rust-targ.patch \
file://0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \
file://0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \
file://0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \
file://0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \
file://0007-mk-install-use-disable-rewrite-paths.patch \
\
file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \
"
#file://0013-filesearch-fix-for-new-path.patch \