Merge /home/cody/C/meta-rust

This commit is contained in:
Cody P Schafer
2015-02-12 14:16:39 -05:00
16 changed files with 316 additions and 200 deletions
+4 -1
View File
@@ -23,7 +23,10 @@ PV .= "+git${SRCPV}"
S = "${WORKDIR}/git"
B = "${S}"
# PACKAGECONFIG is set in .bb files
PACKAGECONFIG ??= ""
# Note: this does not appear to work very well due to our use of bitbake triples
# & rust's use of cooked triples
PACKAGECONFIG[rust-snapshot] = "--local-rust-root=${B}/rustc"
do_configure () {
+7 -7
View File
@@ -1,5 +1,5 @@
SRCREV_cargo = "e6abfbb959b363248ee03c731a67d2897dd061ce"
PACKAGECONFIG ??= "rust-snapshot"
# 2015-2-12
SRCREV_cargo = "0b84923203dce67ff8cf051728b6908c9c2e303c"
require cargo.inc
@@ -12,11 +12,11 @@ SRC_URI += " \
file://ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch;patchdir=../ssh2-rs \
"
# 0.1.4
#SRCREV_curl-rust = "6f4d66ed0bc5e71a0ea86a37f038f7c9f73dc3ae"
# 0.1.3
SRCREV_curl-rust = "4517ee606c65bbe03e4ad4f661725eb80e667a69"
SRCREV_ssh2-rs = "509a8459e466ffa4705a0c686b80ac80b499f5d5"
# 0.1.14
SRCREV_curl-rust = "9181ea8f4ea2c7eb60224b5ebf464751165e2881"
# libssh2-sys 0.1.5 +2015-2-10
SRCREV_ssh2-rs = "8baa8ccb39cd1a43362d2a1ee87d8c3b91496cd7"
SRCREV_FORMAT = "cargo_curl-rust_ssh2-rs"
EXTRA_OECARGO_PATHS = "\
${WORKDIR}/curl-rust \
@@ -1,7 +1,7 @@
From b850685d1411a03164401db202b9e85ac42d3b26 Mon Sep 17 00:00:00 2001
From 3355850b0f387355e83bbdcdbbab7850c898d711 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/10] 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
@@ -11,54 +11,64 @@ 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/io/process.rs | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
src/libstd/old_io/process.rs | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index 93aa627..3319408 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -384,14 +384,38 @@ impl Command {
diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs
index 195d33c..db0dd91 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -31,6 +31,7 @@ use sys::fs::FileDesc;
use sys::process::Process as ProcessImp;
use sys;
use thread::Thread;
+use string::CowString;
#[cfg(windows)] use hash;
#[cfg(windows)] use str;
@@ -394,15 +395,39 @@ impl Command {
}
}
+struct SingleQuotedStr<'a> {
+ s: &'a str
+ s: CowString<'a>
+}
+
+impl<'b> SingleQuotedStr<'b> {
+ fn new<'a>(i: &'a str) -> SingleQuotedStr<'a> {
+ fn new<'a>(i: CowString<'a>) -> SingleQuotedStr<'a> {
+ SingleQuotedStr { s: i }
+ }
+}
+
+impl<'a> fmt::Show for SingleQuotedStr<'a> {
+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));
+ try!(write!(f, "'{:?}", fst));
+ for elem in elems {
+ try!(write!(f, "'\\''{}", elem));
+ try!(write!(f, "'\\''{:?}", elem));
+ }
+ write!(f, "'")
+ }
+}
+
impl fmt::Show for Command {
#[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, "{}", String::from_utf8_lossy(self.program.as_bytes_no_nul())));
+ try!(write!(f, "{}", SingleQuotedStr::new(String::from_utf8_lossy(
+ self.program.as_bytes_no_nul()).as_slice())));
for arg in self.args.iter() {
- try!(write!(f, " '{}'", String::from_utf8_lossy(arg.as_bytes_no_nul())));
+ try!(write!(f, " {}", SingleQuotedStr::new(String::from_utf8_lossy(
+ arg.as_bytes_no_nul()).as_slice())));
- 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.2.1
2.3.0
@@ -0,0 +1,33 @@
From b1761599f03139070a3354ec2b6f2f25db27bac8 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 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 db0dd91..d715848 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -1254,4 +1254,16 @@ mod tests {
let val = env.get(&EnvKey(CString::from_slice(b"PATH")));
assert!(val.unwrap() == &CString::from_slice(b"bar"));
}
+
+ 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.0
@@ -1,33 +0,0 @@
From 5ec27dbc4ad64d837e15ff30c4489e8bdd045ed9 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/10] std/io/process: add Show tests
---
src/libstd/io/process.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index 3319408..3f8c7ff 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -1237,4 +1237,16 @@ mod tests {
let val = env.get(&EnvKey("PATH".to_c_str()));
assert!(val.unwrap() == &"bar".to_c_str());
}
+
+ fn check_show(c: Command, v: &str) {
+ assert_eq!(format!("{}", c), v)
+ }
+
+ #[test]
+ fn show() {
+ check_show(Command::new("gcc ").arg("-Ifoo'bar"), "'gcc ' '-Ifoo'\\''bar'");
+ check_show(Command::new("c99"), "'c99'");
+ check_show(Command::new("c99 "), "'c99 '");
+ check_show(Command::new("Can't buy me love"), "'Can'\\''t buy me love'");
+ }
}
--
2.2.1
@@ -1,14 +1,14 @@
From a3192892b91d1df606f4b237b1cc08118d66658c Mon Sep 17 00:00:00 2001
From d17171eeca05291a8652fd61c7ae4463013bd39f 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/10] platform.mk: avoid choking on i586
Subject: [PATCH 03/11] 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 7ca2473..cc69851 100644
index 78c1057..d28562c 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -14,7 +14,9 @@
@@ -23,5 +23,5 @@ index 7ca2473..cc69851 100644
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))
--
2.2.1
2.3.0
@@ -1,7 +1,7 @@
From 269155039002d97223d0053f6436c47da07c3d4e Mon Sep 17 00:00:00 2001
From 497fb616163eabd5ed8a08ec0fc22ed75091c38d 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/10] mk/rt/compiler_rt: pass LDFLAGS from
Subject: [PATCH 04/11] mk/rt/compiler_rt: pass LDFLAGS from
CFG_GCCISH_LINK_FLAGS
---
@@ -9,10 +9,10 @@ Subject: [PATCH 04/10] mk/rt/compiler_rt: pass LDFLAGS from
1 file changed, 1 insertion(+)
diff --git a/mk/rt.mk b/mk/rt.mk
index 6a7be26..65b6ae1 100644
index a8bbeb4..a8ac839 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -230,6 +230,7 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
@@ -232,6 +232,7 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
AR="$$(AR_$(1))" \
RANLIB="$$(AR_$(1)) s" \
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
@@ -21,5 +21,5 @@ index 6a7be26..65b6ae1 100644
triple-builtins
$$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
--
2.2.1
2.3.0
@@ -1,71 +1,93 @@
From 9220aae4ace6ade2c22c42a4d141d6938512242a Mon Sep 17 00:00:00 2001
From 8430a9b57867be21a070182c305329fba1dcb85b 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/10] Target: add default target.json path:
Subject: [PATCH 05/11] Target: add default target.json path:
$libdir/rust/targets
---
src/librustc/session/config.rs | 4 ++--
src/librustc/session/mod.rs | 6 +++++-
src/librustc_back/target/mod.rs | 6 +++---
3 files changed, 10 insertions(+), 6 deletions(-)
src/librustc/session/config.rs | 6 +++---
src/librustc/session/mod.rs | 8 ++++++--
src/librustc_back/target/mod.rs | 9 ++++++---
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 5f3fbf8..99ffb6e 100644
index cd664b7..51537bd 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -635,8 +635,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
@@ -633,12 +633,12 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}
-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(&opts.target_triple[]) {
+pub fn build_target_config(sysroot: &std::old_io::Path, opts: &Options, sp: &SpanHandler) -> Config {
+ let target = match Target::search(sysroot, &opts.target_triple[]) {
Ok(t) => t,
Err(e) => {
sp.handler().fatal((format!("Error loading target specification: {}", 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 35c325b..402effb 100644
index bd44dbe..cb7b709 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -242,7 +242,11 @@ pub fn build_session_(sopts: config::Options,
@@ -328,14 +328,18 @@ pub fn build_session_(sopts: config::Options,
local_crate_source_file: Option<Path>,
span_diagnostic: diagnostic::SpanHandler)
-> Session {
- let target_cfg = config::build_target_config(&sopts, &span_diagnostic);
- let host = match Target::search(config::host_triple()) {
+ let sysroot = match sopts.maybe_sysroot {
+ Some(ref x) => Path::new(x),
+ None => filesearch::get_or_default_sysroot()
+ };
+ let host = match Target::search(&sysroot, config::host_triple()) {
Ok(t) => t,
Err(e) => {
span_diagnostic.handler()
.fatal(&format!("Error loading host specification: {}", e));
}
};
- 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 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 99a25be..612f456 100644
index afb5c94..c27afcb 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -291,7 +291,7 @@ impl Target {
@@ -302,12 +302,13 @@ impl Target {
///
/// The error string could come from any of the APIs called, including filesystem access and
/// JSON decoding.
- pub fn search(target: &str) -> Result<Target, String> {
+ pub fn search(sysroot: &Path, target: &str) -> Result<Target, String> {
use std::os;
use std::io::File;
use std::path::Path;
@@ -365,8 +365,8 @@ impl Target {
use std::env;
use std::ffi::OsString;
use std::old_io::File;
use std::old_path::Path;
use serialize::json;
+ use std::iter::IntoIterator;
let target_path = os::getenv("RUST_TARGET_PATH").unwrap_or(String::new());
fn load_file(path: &Path) -> Result<Target, String> {
let mut f = try!(File::open(path).map_err(|e| format!("{:?}", e)));
@@ -387,9 +388,11 @@ impl Target {
let target_path = env::var("RUST_TARGET_PATH")
.unwrap_or(OsString::from_str(""));
- let paths = os::split_paths(target_path[]);
- // FIXME 16351: add a sane default search path?
+ let mut paths = os::split_paths(target_path[]);
+ paths.push(sysroot.join_many(&[env!("CFG_LIBDIR_RELATIVE"), "rust", "targets"]));
+ let paths = env::split_paths(&target_path)
+ .chain(Some(sysroot.join_many(&[env!("CFG_LIBDIR_RELATIVE"), "rustlib"])).into_iter());
for dir in paths.iter() {
- for dir in env::split_paths(&target_path) {
+
+ for dir in paths {
let p = dir.join(path.clone());
if p.is_file() {
return load_file(&p);
--
2.2.1
2.3.0
@@ -1,7 +1,7 @@
From b127eaf1de5c38a98aadc3fe9fcac952c850504e Mon Sep 17 00:00:00 2001
From baca81cff977cb7a2a9291b06ca45e2ab6305da5 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/10] mk: for stage0, use RUSTFLAGS to override target libs
Subject: [PATCH 06/11] mk: for stage0, use RUSTFLAGS to override target libs
dir
Setting HLIB specially for stage0 (and even more specially for windows)
@@ -13,10 +13,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 4aed1ce..867d919 100644
index a6b201a..ab75a47 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -335,21 +335,22 @@ define SREQ
@@ -357,21 +357,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 +47,7 @@ index 4aed1ce..867d919 100644
# Preqrequisites for using the stageN compiler
ifeq ($(1),0)
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
@@ -461,6 +462,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
@@ -483,6 +484,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 +55,7 @@ index 4aed1ce..867d919 100644
$$(RUSTC_FLAGS_$(2))
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -469,6 +471,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -491,6 +493,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 +64,5 @@ index 4aed1ce..867d919 100644
endef
--
2.2.1
2.3.0
@@ -1,14 +1,14 @@
From 544d3997edacfd414664c14cc628d573023af28e Mon Sep 17 00:00:00 2001
From 67e86a885f0361f7e69476d017337df56cfa6fc7 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/10] mk: add missing CFG_LIBDIR_RELATIVE
Subject: [PATCH 07/11] mk: add missing CFG_LIBDIR_RELATIVE
---
mk/grammar.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mk/grammar.mk b/mk/grammar.mk
index a9f4590..d254941 100644
index d9c66e2..585206d 100644
--- a/mk/grammar.mk
+++ b/mk/grammar.mk
@@ -11,8 +11,8 @@
@@ -20,8 +20,8 @@ index a9f4590..d254941 100644
+L = $(B)$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib
+LD = $(CFG_BUILD)/stage2/$(CFG_LIBDIR_RELATIVE)/rustlib/$(CFG_BUILD)/lib/
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
# Run the reference lexer against libsyntax and compare the tokens and spans.
ifeq ($(CFG_OSTYPE),apple-darwin)
FLEX_LDFLAGS=-ll
--
2.2.1
2.3.0
@@ -1,7 +1,7 @@
From 9dc70d95f890865b8f3f87edba9a9441b8ad3755 Mon Sep 17 00:00:00 2001
From c8c79e972cdc2529acbdf5403feda71666f30e60 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/10] configure: support --bindir, and extend libdir to
Subject: [PATCH 08/11] configure: support --bindir, and extend libdir to
non-blessed dirs
Adds --bindir, and:
@@ -13,17 +13,18 @@ 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/perf.mk | 4 +-
mk/prepare.mk | 4 +-
src/librustc/metadata/filesearch.rs | 78 ++++++++++++++-----------------------
src/librustc/session/config.rs | 2 +-
src/librustc_trans/back/link.rs | 3 +-
7 files changed, 87 insertions(+), 70 deletions(-)
8 files changed, 87 insertions(+), 70 deletions(-)
diff --git a/configure b/configure
index f14009b..8659809 100755
index a80dafc..e0efaf2 100755
--- a/configure
+++ b/configure
@@ -309,6 +309,31 @@ envopt() {
@@ -58,7 +59,7 @@ index f14009b..8659809 100755
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)
@@ -561,23 +586,15 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
then
CFG_LIBDIR_RELATIVE=bin
@@ -75,7 +76,9 @@ index f14009b..8659809 100755
- *)
- err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
-esac
-
+CFG_BINDIR_RELATIVE=bin
+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
@@ -84,12 +87,8 @@ index f14009b..8659809 100755
+ err "Windows builds currently require that LIBDIR == BINDIR (we have libdir{$CFG_LIBDIR_RELATIVE} != bindir{$CFG_BINDIR_RELATIVE} )"
fi
+CFG_BINDIR_RELATIVE=bin
+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries"
+
if [ $HELP -eq 1 ]
then
echo
@@ -586,6 +603,11 @@ then
exit 0
fi
@@ -101,7 +100,7 @@ index f14009b..8659809 100755
# Validate Options
step_msg "validating $CFG_SELF args"
validate_opt
@@ -1331,6 +1353,7 @@ putvar CFG_PREFIX
@@ -1342,6 +1364,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
@@ -129,10 +128,10 @@ index 59a0095..b8e8345 100644
endef
diff --git a/mk/main.mk b/mk/main.mk
index 867d919..cfbc1b0 100644
index ab75a47..6659dc9 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -318,7 +318,9 @@ export CFG_BUILD
@@ -326,7 +326,9 @@ export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT
export CFG_PREFIX
export CFG_LIBDIR
@@ -140,9 +139,9 @@ index 867d919..cfbc1b0 100644
export CFG_LIBDIR_RELATIVE
+export CFG_BINDIR_RELATIVE
export CFG_DISABLE_INJECT_STD_VERSION
######################################################################
@@ -334,7 +336,16 @@ define SREQ
ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
@@ -356,7 +358,16 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
@@ -180,10 +179,10 @@ index 16cbaab..f8a354c 100644
endif
diff --git a/mk/prepare.mk b/mk/prepare.mk
index d404d3d..afc6d81 100644
index f1c4aa6..37c0a1a 100644
--- a/mk/prepare.mk
+++ b/mk/prepare.mk
@@ -147,10 +147,10 @@ endef
@@ -168,10 +168,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
define DEF_PREPARE
prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
@@ -197,20 +196,20 @@ 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/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 0b859ab..f92fca6 100644
index 1b2d82e..0405d67 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -72,8 +72,7 @@ impl<'a> FileSearch<'a> {
@@ -67,8 +67,7 @@ impl<'a> FileSearch<'a> {
if !found {
let rustpath = rust_path();
for path in rustpath.iter() {
for path in &rustpath {
- let tlib_path = make_rustpkg_lib_path(
- self.sysroot, path, self.triple);
+ let tlib_path = make_rustpkg_lib_path(path, self.triple);
debug!("is {} in visited_dirs? {}", tlib_path.display(),
visited_dirs.contains(&tlib_path.as_vec().to_vec()));
@@ -155,7 +154,7 @@ impl<'a> FileSearch<'a> {
@@ -154,7 +153,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<Path> {
let mut p = Path::new(self.sysroot);
@@ -219,7 +218,7 @@ index 0b859ab..f92fca6 100644
p.push(rustlibdir());
p.push(self.triple);
p.push("bin");
@@ -163,8 +162,8 @@ impl<'a> FileSearch<'a> {
@@ -162,8 +161,8 @@ impl<'a> FileSearch<'a> {
}
}
@@ -230,7 +229,7 @@ index 0b859ab..f92fca6 100644
assert!(p.is_relative());
p.push(rustlibdir());
p.push(target_triple);
@@ -174,17 +173,24 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> Path {
@@ -173,17 +172,24 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> Path {
fn make_target_lib_path(sysroot: &Path,
target_triple: &str) -> Path {
@@ -259,10 +258,10 @@ index 0b859ab..f92fca6 100644
pub fn get_or_default_sysroot() -> Path {
// Follow symlinks. If the resolved path is relative, make it absolute.
fn canonicalize(path: Option<Path>) -> Option<Path> {
@@ -196,7 +202,17 @@ pub fn get_or_default_sysroot() -> Path {
@@ -195,7 +201,17 @@ pub fn get_or_default_sysroot() -> Path {
}
match canonicalize(os::self_exe_name()) {
match canonicalize(env::current_exe().ok()) {
- Some(mut p) => { p.pop(); p.pop(); p }
+ Some(mut p) => {
+ // Remove the exe name
@@ -278,7 +277,7 @@ index 0b859ab..f92fca6 100644
None => panic!("can't determine value for sysroot")
}
}
@@ -254,45 +270,9 @@ pub fn rust_path() -> Vec<Path> {
@@ -252,45 +268,9 @@ pub fn rust_path() -> Vec<Path> {
env_rust_path
}
@@ -303,12 +302,12 @@ index 0b859ab..f92fca6 100644
- }
- }
-
- #[cfg(target_word_size = "64")]
- #[cfg(target_pointer_width = "64")]
- fn primary_libdir_name() -> String {
- "lib64".to_string()
- }
-
- #[cfg(target_word_size = "32")]
- #[cfg(target_pointer_width = "32")]
- fn primary_libdir_name() -> String {
- "lib32".to_string()
- }
@@ -327,17 +326,30 @@ index 0b859ab..f92fca6 100644
}
// The name of rustc's own place to organize libraries.
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 51537bd..54d995c 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -633,7 +633,7 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}
-pub fn build_target_config(sysroot: &std::old_io::Path, opts: &Options, sp: &SpanHandler) -> Config {
+pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &SpanHandler) -> Config {
let target = match Target::search(sysroot, &opts.target_triple[]) {
Ok(t) => t,
Err(e) => {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index ec61d3a..7928699 100644
index 9f26e91..7f50224 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -1000,11 +1000,10 @@ fn link_args(cmd: &mut Command,
@@ -1004,11 +1004,10 @@ fn link_args(cmd: &mut Command,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {
- let sysroot = sess.sysroot();
let target_triple = sess.opts.target_triple[];
let get_install_prefix_lib_path = |:| {
let target_triple = &sess.opts.target_triple[];
let get_install_prefix_lib_path = || {
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);
@@ -345,5 +357,5 @@ index ec61d3a..7928699 100644
path.push(&tlib);
--
2.2.1
2.3.0
@@ -1,7 +1,7 @@
From 1bfe46dd62c1a72b20be921eba8fcd57c56974ef Mon Sep 17 00:00:00 2001
From f8ec11a7e7420d740b41179976c44163f4a6c5f4 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/10] Parallelize submake invocations
Subject: [PATCH 09/11] Parallelize submake invocations
---
mk/clean.mk | 2 +-
@@ -12,10 +12,10 @@ Subject: [PATCH 09/10] Parallelize submake invocations
5 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/mk/clean.mk b/mk/clean.mk
index aadc55b..f671745 100644
index 5b90d41..2a7ba6d 100644
--- a/mk/clean.mk
+++ b/mk/clean.mk
@@ -121,7 +121,7 @@ $(foreach host, $(CFG_HOST), \
@@ -122,7 +122,7 @@ $(foreach host, $(CFG_HOST), \
define DEF_CLEAN_LLVM_HOST
ifeq ($(CFG_LLVM_ROOT),)
clean-llvm$(1):
@@ -25,7 +25,7 @@ index aadc55b..f671745 100644
clean-llvm$(1): ;
diff --git a/mk/install.mk b/mk/install.mk
index 632df3c..954d494 100644
index 60c0a6b..a3a44ed 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -17,9 +17,9 @@ endif
@@ -38,9 +38,9 @@ index 632df3c..954d494 100644
- $(Q)$(MAKE) prepare_install
+ $(Q)$(P)$(MAKE) prepare_install
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)"
# Remove tmp files because it's a decent amount of disk space
@@ -30,9 +30,9 @@ prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
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
@@ -50,8 +50,8 @@ index 632df3c..954d494 100644
- $(Q)$(MAKE) prepare_uninstall
+ $(Q)$(P)$(MAKE) prepare_uninstall
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)"
# Remove tmp files because it's a decent amount of disk space
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 ba2e073..3998806 100644
--- a/mk/llvm.mk
@@ -75,10 +75,10 @@ index ba2e073..3998806 100644
touch $$@
diff --git a/mk/rt.mk b/mk/rt.mk
index 65b6ae1..a064ee1 100644
index a8ac839..d609cd2 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -181,7 +181,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
@@ -183,7 +183,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
RANLIB="$$(AR_$(1)) s" \
CPPFLAGS="-I $(S)src/rt/" \
EXTRA_CFLAGS="-g1 -ffunction-sections -fdata-sections"
@@ -87,7 +87,7 @@ index 65b6ae1..a064ee1 100644
ifeq ($$(CFG_DISABLE_JEMALLOC),)
RUSTFLAGS_alloc := --cfg jemalloc
@@ -223,7 +223,7 @@ COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
@@ -225,7 +225,7 @@ COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
@$$(call E, make: compiler-rt)
@@ -96,7 +96,7 @@ index 65b6ae1..a064ee1 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)
@@ -303,7 +303,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
$$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
@$$(call E, make: libbacktrace)
@@ -118,5 +118,5 @@ index 3bbc8f4..4300b02 100644
S := $(CFG_SRC_DIR)
--
2.2.1
2.3.0
@@ -1,17 +1,17 @@
From 30483be2c93f9ebd8f1322c2fd4ff4c765e10f59 Mon Sep 17 00:00:00 2001
From 5372227d27491a4b468867bd235c83859ff64475 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/10] std/thread_local: workaround for NULL __dso_handle
Subject: [PATCH 10/11] std/thread_local: workaround for NULL __dso_handle
---
src/libstd/thread_local/mod.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 242dceb..45ce980 100644
index 9de5fd1..273f45c 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -323,7 +323,7 @@ mod imp {
@@ -393,7 +393,7 @@ mod imp {
#[linkage = "extern_weak"]
static __cxa_thread_atexit_impl: *const ();
}
@@ -21,5 +21,5 @@ index 242dceb..45ce980 100644
arg: *mut u8,
dso_handle: *mut u8) -> libc::c_int;
--
2.2.1
2.3.0
@@ -0,0 +1,96 @@
From 937d33a68d367bd67060b8a57082324ef7589878 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Thu, 12 Feb 2015 10:29:21 -0500
Subject: [PATCH 11/11] librustc_back/target: rename json field from
target-word-size to target-pointer-width to match rust struct field
Completes #20421 (which renamed the struct field but not the json field)
If you're using the json target specificating interface, this is
potentially a:
[breaking-change]
---
src/librustc/session/config.rs | 2 +-
src/librustc_back/target/mod.rs | 4 ++--
src/test/run-make/target-specs/my-awesome-platform.json | 2 +-
src/test/run-make/target-specs/my-incomplete-platform.json | 2 +-
src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 54d995c..b6d901c 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -645,7 +645,7 @@ pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &SpanHandler) ->
"32" => (ast::TyI32, ast::TyU32),
"64" => (ast::TyI64, ast::TyU64),
w => sp.handler().fatal(&format!("target specification was invalid: unrecognized \
- target-word-size {}", w)[])
+ target-pointer-width {}", w)[])
};
Config {
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index c27afcb..0fad037 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -40,7 +40,7 @@
//! this module defines the format the JSON file should take, though each
//! underscore in the field names should be replaced with a hyphen (`-`) in the
//! JSON file. Some fields are required in every target specification, such as
-//! `data-layout`, `llvm-target`, `target-endian`, `target-word-size`, and
+//! `data-layout`, `llvm-target`, `target-endian`, `target-pointer-width`, and
//! `arch`. In general, options passed to rustc with `-C` override the target's
//! settings, though `target-feature` and `link-args` will *add* to the list
//! specified by the target, rather than replace.
@@ -241,7 +241,7 @@ impl Target {
data_layout: get_req_field("data-layout"),
llvm_target: get_req_field("llvm-target"),
target_endian: get_req_field("target-endian"),
- target_pointer_width: get_req_field("target-word-size"),
+ target_pointer_width: get_req_field("target-pointer-width"),
arch: get_req_field("arch"),
target_os: get_req_field("os"),
options: Default::default(),
diff --git a/src/test/run-make/target-specs/my-awesome-platform.json b/src/test/run-make/target-specs/my-awesome-platform.json
index f5f622b..d7cf713 100644
--- a/src/test/run-make/target-specs/my-awesome-platform.json
+++ b/src/test/run-make/target-specs/my-awesome-platform.json
@@ -2,7 +2,7 @@
"data-layout": "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32",
"llvm-target": "i686-unknown-linux-gnu",
"target-endian": "little",
- "target-word-size": "32",
+ "target-pointer-width": "32",
"arch": "x86",
"os": "linux",
"morestack": false
diff --git a/src/test/run-make/target-specs/my-incomplete-platform.json b/src/test/run-make/target-specs/my-incomplete-platform.json
index 5005a9f..053f2dd 100644
--- a/src/test/run-make/target-specs/my-incomplete-platform.json
+++ b/src/test/run-make/target-specs/my-incomplete-platform.json
@@ -1,7 +1,7 @@
{
"data-layout": "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32",
"target-endian": "little",
- "target-word-size": "32",
+ "target-pointer-width": "32",
"arch": "x86",
"os": "foo",
"morestack": false
diff --git a/src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json b/src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json
index 5e0f0f4..688bbe4 100644
--- a/src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json
+++ b/src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json
@@ -3,7 +3,7 @@
"data-layout": "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128",
"llvm-target": "x86_64-unknown-linux-gnu",
"target-endian": "little",
- "target-word-size": "64",
+ "target-pointer-width": "64",
"arch": "x86_64",
"os": "linux",
"morestack": false
--
2.3.0
@@ -1,25 +0,0 @@
Remove ldconfig(1) execution to prevent the installation script from accessing
outside of a sandbox.
diff --git a/src/rust-installer/install-template.sh b/src/rust-installer/install-template.sh
index 545de67..242d6f4 100644
--- a/src/rust-installer/install-template.sh
+++ b/src/rust-installer/install-template.sh
@@ -508,17 +508,6 @@ done < "${CFG_SRC_DIR}/lib/${TEMPLATE_REL_MANIFEST_DIR}/manifest.in"
msg
-# Run ldconfig to make dynamic libraries available to the linker
-if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
- then
- ldconfig
- if [ $? -ne 0 ]
- then
- warn "failed to run ldconfig."
- warn "this may happen when not installing as root and may be fine"
- fi
-fi
-
# Sanity check: can we run the installed binaries?
#
# As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent
@@ -1,11 +1,10 @@
SRCREV = "71123902e17ad339649f33423995eac78da40e3c"
# pre-ascii reform
#SRCREV = "0201334439393bed205c1148bed425b80aab8c22"
# 2014-02-10
SRCREV = "88d8ba5ab3b1d22288b021708c3d87464e43b880"
require rust-git.inc
SRC_URI_append = "\
file://0001-libstd-io-process-Command-fully-quote-and-escape-the.patch \
file://0002-std-io-process-add-Show-tests.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 \
@@ -14,6 +13,5 @@ SRC_URI_append = "\
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://rust-0.13.0-no-ldconfig.patch \
file://0011-librustc_back-target-rename-json-field-from-target-w.patch \
"