From 5689154fdd44223ab5f8b39e5271c6d7f8b470a2 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 5 Nov 2015 10:59:33 -0500 Subject: [PATCH 01/47] rust: add version 1.4.0 --- ...01-platform.mk-avoid-choking-on-i586.patch | 27 ++ ...lt-target.json-path-libdir-rust-targ.patch | 109 ++++++ ...e-RUSTFLAGS-to-override-target-libs-.patch | 67 ++++ ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 ++ ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ++++++++++++++++++ ...cal-workaround-for-NULL-__dso_handle.patch | 25 ++ ...mk-install-use-disable-rewrite-paths.patch | 43 +++ .../0008-install-disable-ldconfig.patch | 40 ++ ...e-crate-metadata-from-symbol-hashing.patch | 28 ++ recipes/rust/rust-1.4.0.inc | 17 + recipes/rust/rust-llvm_1.4.0.bb | 5 + recipes/rust/rust_1.4.0.bb | 19 + 12 files changed, 769 insertions(+) create mode 100644 recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch create mode 100644 recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch create mode 100644 recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch create mode 100644 recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch create mode 100644 recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch create mode 100644 recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch create mode 100644 recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch create mode 100644 recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch create mode 100644 recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch create mode 100644 recipes/rust/rust-1.4.0.inc create mode 100644 recipes/rust/rust-llvm_1.4.0.bb create mode 100644 recipes/rust/rust_1.4.0.bb diff --git a/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch new file mode 100644 index 0000000..1d52764 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch @@ -0,0 +1,27 @@ +From cc1513e3f9c65c0ff97f92b0f2d0452b23a1f712 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Sat, 15 Nov 2014 20:12:48 -0500 +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 fcb6a5b..96f6d91 100644 +--- a/mk/platform.mk ++++ b/mk/platform.mk +@@ -14,7 +14,9 @@ + # would create a variable HOST_i686-darwin-macos with the value + # i386. + define DEF_HOST_VAR +- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) ++ HOST_$(1) = $(subst i686,i386,\ ++ $(subst i586,i386,\ ++ $(word 1,$(subst -, ,$(1))))) + endef + $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) + $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch new file mode 100644 index 0000000..9fcef0d --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch @@ -0,0 +1,109 @@ +From 8dcca17fe0c639bddf380d4dbed93c6c05fbd8d3 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 01:40:21 -0500 +Subject: [PATCH 2/9] 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 | 14 +++++++++++--- + 3 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs +index b56283e..cfef75a 100644 +--- a/src/librustc/session/config.rs ++++ b/src/librustc/session/config.rs +@@ -39,7 +39,7 @@ use getopts; + use std::collections::HashMap; + use std::env; + use std::fmt; +-use std::path::PathBuf; ++use std::path::{Path, PathBuf}; + + use llvm; + +@@ -660,8 +660,8 @@ 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[..]) { + Ok(t) => t, + Err(e) => { + sp.handler().fatal(&format!("Error loading target specification: {}", e)); +diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs +index ff732ee..bf81605 100644 +--- a/src/librustc/session/mod.rs ++++ b/src/librustc/session/mod.rs +@@ -405,14 +405,18 @@ pub fn build_session_(sopts: config::Options, + local_crate_source_file: Option, + span_diagnostic: diagnostic::SpanHandler) + -> Session { +- let host = match Target::search(config::host_triple()) { ++ let sysroot = match sopts.maybe_sysroot { ++ Some(ref x) => PathBuf::from(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::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 56562c8..c3a47dc 100644 +--- a/src/librustc_back/target/mod.rs ++++ b/src/librustc_back/target/mod.rs +@@ -49,6 +49,8 @@ use serialize::json::Json; + use std::default::Default; + use std::io::prelude::*; + use syntax::{diagnostic, abi}; ++use std::borrow::ToOwned; ++use std::path::Path; + + mod android_base; + mod apple_base; +@@ -333,12 +335,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 { ++ pub fn search(sysroot: &Path, target: &str) -> Result { + use std::env; + use std::ffi::OsString; + use std::fs::File; + use std::path::{Path, PathBuf}; + use serialize::json; ++ use std::iter::IntoIterator; + + fn load_file(path: &Path) -> Result { + let mut f = try!(File::open(path).map_err(|e| e.to_string())); +@@ -431,9 +434,14 @@ impl Target { + let target_path = env::var_os("RUST_TARGET_PATH") + .unwrap_or(OsString::new()); + +- // FIXME 16351: add a sane default search path? ++ 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() { + return load_file(&p); +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch new file mode 100644 index 0000000..36a52d7 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch @@ -0,0 +1,67 @@ +From 7be198aa05895e739805fcb74c81ef4379d15c2d Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 14:52:56 -0500 +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 +the place requested by configure, use '-L' and '--sysroot' to point +stage0-rustc at the appropriate location. +--- + mk/main.mk | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/mk/main.mk b/mk/main.mk +index f133555..64c3834 100644 +--- a/mk/main.mk ++++ b/mk/main.mk +@@ -381,21 +381,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 +-ifeq ($$(CFG_WINDOWSY_$(3)),1) +-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +-else +-ifeq ($(1),0) +-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib +-else + HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +-endif +-endif + + # Destinations of artifacts for target architectures + TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) + TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin + TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib + ++# Don't trust stage0, be explicit about libraries ++# TODO: rather than specifying sysroot, we really want to tell which libdir to ++# use (ie: the dir containing 'rustlib'). This would allow us to avoid ++# passing the '-L' options. ++ifeq ($(1),0) ++RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ ++ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" ++endif ++ + # Preqrequisites for using the stageN compiler + ifeq ($(1),0) + HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) +@@ -507,6 +508,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)) \ ++ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ + $$(RUSTC_FLAGS_$(2)) + + PERF_STAGE$(1)_T_$(2)_H_$(3) := \ +@@ -515,6 +517,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)) \ ++ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ + $$(RUSTC_FLAGS_$(2)) + + endef +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch new file mode 100644 index 0000000..032d577 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch @@ -0,0 +1,27 @@ +From 6e767a11bea08a4e0affb06b0c3ef943ef900f0f Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 13:48:14 -0500 +Subject: [PATCH 4/9] 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 d9c66e2..585206d 100644 +--- a/mk/grammar.mk ++++ b/mk/grammar.mk +@@ -11,8 +11,8 @@ + BG = $(CFG_BUILD_DIR)/grammar/ + SG = $(S)src/grammar/ + B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ +-L = $(B)lib/rustlib/$(CFG_BUILD)/lib +-LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ ++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)) + ifeq ($(CFG_OSTYPE),apple-darwin) + FLEX_LDFLAGS=-ll +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch new file mode 100644 index 0000000..403b97f --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch @@ -0,0 +1,362 @@ +From b55b786f7d0887700f38d57b9f5d90f990745510 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Mon, 24 Nov 2014 13:10:15 -0500 +Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to + non-blessed dirs + +Adds --bindir, and: + +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 assumes absolute paths start with '/', which may break +windows platforms +--- + configure | 49 ++++++++++++++++------ + mk/host.mk | 6 ++- + mk/main.mk | 11 +++++ + mk/perf.mk | 4 +- + mk/prepare.mk | 4 +- + src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- + src/librustc_trans/back/link.rs | 3 +- + 7 files changed, 90 insertions(+), 71 deletions(-) + +diff --git a/configure b/configure +index 2d03b5f..3bc3178 100755 +--- a/configure ++++ b/configure +@@ -334,6 +334,31 @@ enable_if_not_disabled() { + fi + } + ++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 ;; +@@ -631,6 +656,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. +@@ -638,24 +665,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 +- CFG_LIBDIR_RELATIVE=lib + fi + +-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_BINDIR_RELATIVE=bin ++valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" + +-CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` ++# 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}") + + 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 ] +@@ -1742,6 +1766,7 @@ putvar CFG_PREFIX + putvar CFG_HOST + putvar CFG_TARGET + putvar CFG_LIBDIR_RELATIVE ++putvar CFG_BINDIR_RELATIVE + putvar CFG_DISABLE_MANAGE_SUBMODULES + putvar CFG_AARCH64_LINUX_ANDROID_NDK + putvar CFG_ARM_LINUX_ANDROIDEABI_NDK +diff --git a/mk/host.mk b/mk/host.mk +index 59a0095..b8e8345 100644 +--- a/mk/host.mk ++++ b/mk/host.mk +@@ -59,9 +59,13 @@ endef + # $(4) - the host triple (same as $(3)) + define CP_HOST_STAGE_N + +-ifneq ($(CFG_LIBDIR_RELATIVE),bin) + $$(HLIB$(2)_H_$(4))/: + @mkdir -p $$@ ++ ++# Avoid redefinition warnings if libdir==bindir ++ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) ++$$(HBIN$(2)_H_$(4))/: ++ @mkdir -p $$@ + endif + + endef +diff --git a/mk/main.mk b/mk/main.mk +index 64c3834..c8f6b90 100644 +--- a/mk/main.mk ++++ b/mk/main.mk +@@ -350,7 +350,9 @@ export CFG_RELEASE_CHANNEL + export CFG_LLVM_ROOT + export CFG_PREFIX + export CFG_LIBDIR ++export CFG_BINDIR + export CFG_LIBDIR_RELATIVE ++export CFG_BINDIR_RELATIVE + export CFG_DISABLE_INJECT_STD_VERSION + ifdef CFG_DISABLE_UNSTABLE_FEATURES + CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) +@@ -380,7 +382,16 @@ define SREQ + + # Destinations of artifacts for the host compiler + HROOT$(1)_H_$(3) = $(3)/stage$(1) ++ ++ifeq ($(1)-$(3),0-$$(CFG_BUILD)) ++# stage0 relative paths are fixed so we can bootstrap from snapshots ++# (downloaded snapshots drop their rustc in HROOT/bin) ++# libdir discrepancy is worked around with RUSTFLAGS below. + HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin ++else ++HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) ++endif ++ + HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) + + # Destinations of artifacts for target architectures +diff --git a/mk/perf.mk b/mk/perf.mk +index 16cbaab..f8a354c 100644 +--- a/mk/perf.mk ++++ b/mk/perf.mk +@@ -10,13 +10,13 @@ + + + ifdef CFG_PERF_TOOL +-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) ++rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) + @$(call E, perf compile: $@) + $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ + -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 + $(Q)rm -f $(LIBRUSTC_GLOB) + else +-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) ++rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) + $(Q)touch $@ + endif + +diff --git a/mk/prepare.mk b/mk/prepare.mk +index fe619cc..b8aa0cb 100644 +--- a/mk/prepare.mk ++++ b/mk/prepare.mk +@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ + define DEF_PREPARE + + prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) +-prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin ++prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) + prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) + prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man +-prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin ++prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) + prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) + 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 311ab1c..1b03b1a 100644 +--- a/src/librustc/metadata/filesearch.rs ++++ b/src/librustc/metadata/filesearch.rs +@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { + if !found { + let rustpath = rust_path(); + 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)); + +@@ -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 { + let mut p = PathBuf::from(self.sysroot); +- p.push(&find_libdir(self.sysroot)); ++ p.push(libdir_str()); + p.push(&rustlibdir()); + p.push(&self.triple); + p.push("bin"); +@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { + } + } + +-pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { +- let mut p = PathBuf::from(&find_libdir(sysroot)); ++pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { ++ let mut p = PathBuf::from(&libdir_str()); + assert!(p.is_relative()); + p.push(&rustlibdir()); + p.push(target_triple); +@@ -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 { +- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) ++ sysroot.join(&relative_target_lib_path(target_triple)) + } + +-fn make_rustpkg_lib_path(sysroot: &Path, +- dir: &Path, ++fn make_rustpkg_lib_path(dir: &Path, + triple: &str) -> PathBuf { +- let mut p = dir.join(&find_libdir(sysroot)); ++ let mut p = dir.join(libdir_str()); + p.push(triple); + p + } + ++pub fn bindir_relative_str() -> &'static str { ++ env!("CFG_BINDIR_RELATIVE") ++} ++ ++pub fn bindir_relative_path() -> PathBuf { ++ 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) -> Option { +@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { + } + + match canonicalize(env::current_exe().ok()) { +- Some(mut p) => { p.pop(); p.pop(); p } ++ Some(mut p) => { ++ // 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() { ++ p.pop(); ++ } ++ p ++ } + None => panic!("can't determine value for sysroot") + } + } +@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { + env_rust_path + } + +-// The name of the directory rustc expects libraries to be located. +-// On Unix should be "lib", on windows "bin" +-#[cfg(unix)] +-fn find_libdir(sysroot: &Path) -> String { +- // FIXME: This is a quick hack to make the rustc binary able to locate +- // Rust libraries in Linux environments where libraries might be installed +- // to lib64/lib32. This would be more foolproof by basing the sysroot off +- // of the directory where librustc is located, rather than where the rustc +- // binary is. +- //If --libdir is set during configuration to the value other than +- // "lib" (i.e. non-default), this value is used (see issue #16552). +- +- match option_env!("CFG_LIBDIR_RELATIVE") { +- Some(libdir) if libdir != "lib" => return libdir.to_string(), +- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { +- return primary_libdir_name(); +- } else { +- return secondary_libdir_name(); +- } +- } +- +- #[cfg(target_pointer_width = "64")] +- fn primary_libdir_name() -> String { +- "lib64".to_string() +- } +- +- #[cfg(target_pointer_width = "32")] +- fn primary_libdir_name() -> String { +- "lib32".to_string() +- } +- +- fn secondary_libdir_name() -> String { +- "lib".to_string() +- } +-} +- +-#[cfg(windows)] +-fn find_libdir(_sysroot: &Path) -> String { +- "bin".to_string() +-} +- + // 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 d5486e8..af943ca 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -1016,11 +1016,10 @@ fn link_args(cmd: &mut Linker, + // 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 mut 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); + let mut path = PathBuf::from(install_prefix); + path.push(&tlib); + +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch new file mode 100644 index 0000000..35a2804 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch @@ -0,0 +1,25 @@ +From 07386b867dfe059430f3145c3d2c8d5da84c4c69 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Wed, 3 Dec 2014 19:15:19 -0500 +Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle + +--- + src/libstd/thread/local.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs +index c204f79..b2f6f1d 100644 +--- a/src/libstd/thread/local.rs ++++ b/src/libstd/thread/local.rs +@@ -338,7 +338,7 @@ mod imp { + #[linkage = "extern_weak"] + static __cxa_thread_atexit_impl: *const libc::c_void; + } +- if !__cxa_thread_atexit_impl.is_null() { ++ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { + type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), + arg: *mut u8, + dso_handle: *mut u8) -> libc::c_int; +-- +2.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch new file mode 100644 index 0000000..1dee032 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch @@ -0,0 +1,43 @@ +From 82fa132a53257b9a787a5035ddaf9dc2adcd7a3e Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Mon, 2 Mar 2015 13:34:59 -0500 +Subject: [PATCH 7/9] mk/install: use disable-rewrite-paths + +This stops the install scripts from doing work we've already handled. + +Path rewriting is only useful for prepackaged binary installers. +--- + mk/install.mk | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mk/install.mk b/mk/install.mk +index cabc97a..273bb0e 100644 +--- a/mk/install.mk ++++ b/mk/install.mk +@@ -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)" ++ $(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)" ++ $(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 + +@@ -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)" --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)" ++ $(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.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch new file mode 100644 index 0000000..0a2b5e6 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch @@ -0,0 +1,40 @@ +From b13d17f8a095174f34b17f8194e631209da2e17e Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 26 May 2015 12:09:36 -0400 +Subject: [PATCH 8/9] install: disable ldconfig + +--- + mk/install.mk | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/mk/install.mk b/mk/install.mk +index 273bb0e..58cfc99 100644 +--- a/mk/install.mk ++++ b/mk/install.mk +@@ -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)" --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)" --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 + +@@ -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)" --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)" --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.6.2 + diff --git a/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch new file mode 100644 index 0000000..cf5d6b4 --- /dev/null +++ b/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch @@ -0,0 +1,28 @@ +From 22be794babc407227500d54e14638efe96b1eaf6 Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Tue, 7 Jul 2015 14:57:42 -0400 +Subject: [PATCH 9/9] Remove crate metadata from symbol hashing + +--- + src/librustc_trans/back/link.rs | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index af943ca..84a275c 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -210,11 +210,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, + symbol_hasher.reset(); + symbol_hasher.input_str(&link_meta.crate_name); + symbol_hasher.input_str("-"); +- symbol_hasher.input_str(link_meta.crate_hash.as_str()); +- for meta in tcx.sess.crate_metadata.borrow().iter() { +- symbol_hasher.input_str(&meta[..]); +- } +- symbol_hasher.input_str("-"); + symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); + // Prefix with 'h' so that it never blends into adjacent digits + let mut hash = String::from("h"); +-- +2.6.2 + diff --git a/recipes/rust/rust-1.4.0.inc b/recipes/rust/rust-1.4.0.inc new file mode 100644 index 0000000..b351e80 --- /dev/null +++ b/recipes/rust/rust-1.4.0.inc @@ -0,0 +1,17 @@ +SRC_URI[rust.md5sum] = "53907e4b819872bd256df8edc0d9f064" +SRC_URI[rust.sha256sum] = "1c0dfdce5c85d8098fcebb9adf1493847ab40c1dfaa8cc997af09b2ef0aa8211" + +## snapshot info taken from rust/src/snapshots.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_DATE = "2015-08-11" +RS_SRCHASH = "1af31d4" +# linux-x86_64 +RS_ARCH = "linux-x86_64" +RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f" + +RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" + +SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283" +SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3" + diff --git a/recipes/rust/rust-llvm_1.4.0.bb b/recipes/rust/rust-llvm_1.4.0.bb new file mode 100644 index 0000000..f6a9869 --- /dev/null +++ b/recipes/rust/rust-llvm_1.4.0.bb @@ -0,0 +1,5 @@ +require rust-release.inc +require rust-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" diff --git a/recipes/rust/rust_1.4.0.bb b/recipes/rust/rust_1.4.0.bb new file mode 100644 index 0000000..2a2fdca --- /dev/null +++ b/recipes/rust/rust_1.4.0.bb @@ -0,0 +1,19 @@ +require rust-release.inc +require rust.inc +require rust-${PV}.inc + +# "patch-prefix" +PP = "rust-${PV}" +SRC_URI_append = "\ + file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ + file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ + file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ + file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ + file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ + file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ + file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ + file://${PP}/0008-install-disable-ldconfig.patch \ + file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ +\ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ +" From 5691bbfc1faa4c4a5f2f9161302d02a703270f86 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 5 Nov 2015 11:32:36 -0500 Subject: [PATCH 02/47] rust-llvm: add more config options from rust-1.4.0 --- recipes/rust/rust-llvm.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/rust/rust-llvm.inc b/recipes/rust/rust-llvm.inc index bc7ec71..388b991 100644 --- a/recipes/rust/rust-llvm.inc +++ b/recipes/rust/rust-llvm.inc @@ -11,6 +11,10 @@ EXTRA_OECONF += "--enable-optimized" EXTRA_OECONF += "--disable-assertions" EXTRA_OECONF += "--disable-docs" EXTRA_OECONF += "--enable-bindings=none" +EXTRA_OECONF += "--disable-terminfo" +EXTRA_OECONF += "--disable-zlib" +EXTRA_OECONF += "--disable-libffi" + EXTRA_OECONF += "--enable-keep-symbols" do_install_append () { From 8752eef1dc0217b17ec95ee7ea0854a757bd7c85 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 6 Nov 2015 09:35:07 -0600 Subject: [PATCH 03/47] fix LICENSE_PATH location The path in LICENSE_PATH was not the correct path to where the licenses are located in this repo. Signed-off-by: Doug Goldstein --- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/layer.conf b/conf/layer.conf index 6c6d52e..8df32c8 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -8,4 +8,4 @@ BBFILE_COLLECTIONS += "rust-layer" BBFILE_PATTERN_rust-layer := "^${LAYERDIR}/" BBFILE_PRIORITY_rust-layer = "7" -LICENSE_PATH += "${LAYERDIR}/files/licenses" +LICENSE_PATH += "${LAYERDIR}/files/common-licenses" From 934450e2b0d718131aafa5de86437f475ce23386 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Tue, 8 Dec 2015 16:13:09 -0500 Subject: [PATCH 04/47] rust: inhibit stripping for cross compiler to avoid errors --- recipes/rust/rust.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 3974d41..2e2efc7 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -412,6 +412,13 @@ do_install_class-cross () { rust_do_install } +# using host-strip on target .so files generated by this recipie causes build errors. +# for now, disable stripping. +# A better (but more complex) approach would be to mimic gcc-runtime and build +# the target.so files in a seperate .bb file. +INHIBIT_PACKAGE_STRIP_class-cross = "1" +INHIBIT_SYSROOT_STRIP_class-cross = "1" + ## }}} BBCLASSEXTEND = "cross native" From 5d8b5d28621eebfea450a8e4767d6c997f259d67 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sat, 12 Dec 2015 21:35:48 -0500 Subject: [PATCH 05/47] rust-1.4.0: compiler works, but cannot build the old version of cargo we ship --- recipes/rust/rust-1.2.0.inc | 2 ++ recipes/rust/rust-1.3.0.inc | 2 ++ recipes/rust/rust-1.4.0.inc | 2 ++ recipes/rust/rust-llvm_1.4.0.bb | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/recipes/rust/rust-1.2.0.inc b/recipes/rust/rust-1.2.0.inc index a689ace..26b79b0 100644 --- a/recipes/rust/rust-1.2.0.inc +++ b/recipes/rust/rust-1.2.0.inc @@ -13,3 +13,5 @@ RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar. SRC_URI[rust-snapshot.md5sum] = "04deb393c39d43a2abc68ebac6a0bad2" SRC_URI[rust-snapshot.sha256sum] = "11f7f56320bd0dff5b47bae3f80377d9514a3ad4bc983d674eb33074c95d66a0" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3" diff --git a/recipes/rust/rust-1.3.0.inc b/recipes/rust/rust-1.3.0.inc index 69a0633..3dc0142 100644 --- a/recipes/rust/rust-1.3.0.inc +++ b/recipes/rust/rust-1.3.0.inc @@ -13,3 +13,5 @@ RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar. SRC_URI[rust-snapshot.md5sum] = "8f804ec5cebf370c59563a2b35a808cb" SRC_URI[rust-snapshot.sha256sum] = "779943595dd63d6869c747e2a31c13095f9c5354d4530327d6f9310cc580c2ff" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3" diff --git a/recipes/rust/rust-1.4.0.inc b/recipes/rust/rust-1.4.0.inc index b351e80..0a56879 100644 --- a/recipes/rust/rust-1.4.0.inc +++ b/recipes/rust/rust-1.4.0.inc @@ -15,3 +15,5 @@ RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar. SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283" SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" diff --git a/recipes/rust/rust-llvm_1.4.0.bb b/recipes/rust/rust-llvm_1.4.0.bb index f6a9869..f1e2660 100644 --- a/recipes/rust/rust-llvm_1.4.0.bb +++ b/recipes/rust/rust-llvm_1.4.0.bb @@ -3,3 +3,9 @@ require rust-${PV}.inc require rust-llvm.inc LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" + +do_install_append () { + cd "${B}" + install -d "${D}${bindir}" + install -m755 "Release/bin/FileCheck" "${D}${bindir}" +} From 3371589498d04f3ad5e2650e9fd92669d4965e4d Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sat, 12 Dec 2015 23:18:55 -0500 Subject: [PATCH 06/47] cargo: update to 0.7.0 --- recipes/cargo/cargo-snapshot-2015-04-02.inc | 4 + recipes/cargo/cargo.inc | 14 +- recipes/cargo/cargo_0.7.0.bb | 56 ++ recipes/cargo/cargo_git.bb | 51 - recipes/cargo/files/0001-update-Rust.patch | 906 ------------------ .../files/0001-update-pkg-versions.patch | 138 --- ...xplicitly-linking-in-openssl.-If-it-.patch | 55 -- ...-avoid-explicitly-linking-in-openssl.patch | 62 ++ ...emove-per-triple-deps-on-openssl-sys.patch | 48 +- .../0001-Add-generic-openssl-sys-dep.patch | 59 -- ...01-libgit2-sys-avoid-blessed-triples.patch | 50 + ...id-the-build-script-it-is-a-disaster.patch | 26 - ...mp-libssh2-to-fix-build-with-nightly.patch | 25 - ...nconditionally-depend-on-openssl-sys.patch | 45 - ...-avoid-explicitly-linking-in-openssl.patch | 62 ++ 15 files changed, 264 insertions(+), 1337 deletions(-) create mode 100644 recipes/cargo/cargo-snapshot-2015-04-02.inc create mode 100644 recipes/cargo/cargo_0.7.0.bb delete mode 100644 recipes/cargo/cargo_git.bb delete mode 100644 recipes/cargo/files/0001-update-Rust.patch delete mode 100644 recipes/cargo/files/0001-update-pkg-versions.patch delete mode 100644 recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch create mode 100644 recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch delete mode 100644 recipes/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch create mode 100644 recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch delete mode 100644 recipes/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch delete mode 100644 recipes/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch delete mode 100644 recipes/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch create mode 100644 recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch diff --git a/recipes/cargo/cargo-snapshot-2015-04-02.inc b/recipes/cargo/cargo-snapshot-2015-04-02.inc new file mode 100644 index 0000000..c81fa79 --- /dev/null +++ b/recipes/cargo/cargo-snapshot-2015-04-02.inc @@ -0,0 +1,4 @@ + +CARGO_SNAPSHOT = "2015-04-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" +SRC_URI[md5sum] = "3d62194d02a9088cd8aae379e9498134" +SRC_URI[sha256sum] = "16b6338ba2942989693984ba4dbd057c2801e8805e6da8fa7b781b00e722d117" diff --git a/recipes/cargo/cargo.inc b/recipes/cargo/cargo.inc index 237fb8f..bc38345 100644 --- a/recipes/cargo/cargo.inc +++ b/recipes/cargo/cargo.inc @@ -12,20 +12,9 @@ LICENSE = "MIT | Apache-2.0" DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2" SRC_URI = "\ - git://github.com/rust-lang/cargo.git;protocol=https;name=cargo \ - git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=git/src/rust-installer \ http://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${CARGO_SNAPSHOT} \ " -LIC_FILES_CHKSUM ="\ - file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ - file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ - file://LICENSE-THIRD-PARTY;md5=afbb7ae0aa70c8e437a007314eae5f3b \ -" -SRCREV_FORMAT = "cargo_rust-installer" -PV .= "+git${SRCPV}" - -S = "${WORKDIR}/git" B = "${S}" PACKAGECONFIG ??= "" @@ -34,6 +23,9 @@ PACKAGECONFIG ??= "" # & rust's use of cooked triples PACKAGECONFIG[rust-snapshot] = "--local-rust-root=${B}/rustc" +# Used in libgit2-sys's build.rs, needed for pkg-config to be used +export LIBGIT2_SYS_USE_PKG_CONFIG = "1" + do_configure () { ${@bb.utils.contains('PACKAGECONFIG', 'rust-snapshot', '${S}/.travis.install.deps.sh', ':', d)} diff --git a/recipes/cargo/cargo_0.7.0.bb b/recipes/cargo/cargo_0.7.0.bb new file mode 100644 index 0000000..1fccc96 --- /dev/null +++ b/recipes/cargo/cargo_0.7.0.bb @@ -0,0 +1,56 @@ +require cargo-snapshot-2015-04-02.inc +require cargo.inc + +SRC_URI += " \ + https://github.com/rust-lang/cargo/archive/${PV}.tar.gz;name=cargo \ + git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${BP}/src/rust-installer \ +" +SRC_URI[cargo.md5sum] = "2089790a4a48de7f8f3cb1afcfa9ec74" +SRC_URI[cargo.sha256sum] = "b1067d710e64b66a197294df2fa3dd4fb1d645171eaa517b93d42678bb687338" + +SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499" + +S = "${WORKDIR}/${BP}" + +LIC_FILES_CHKSUM ="\ + file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ + file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \ +" + +## curl-rust +SRC_URI += "\ + git://github.com/carllerche/curl-rust.git;protocol=https;destsuffix=curl-rust;name=curl-rust \ + file://curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../curl-rust \ + file://curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch;patchdir=../curl-rust \ +" + +# 0.2.14 / -sys 0.1.29 +SRCREV_curl-rust = "76172b3ebf958fcf0b10d400f19ee02486a80ee7" + +SRCREV_FORMAT .= "_curl-rust" +EXTRA_OECARGO_PATHS += "${WORKDIR}/curl-rust" + +## ssh2-rs +SRC_URI += "\ + git://github.com/alexcrichton/ssh2-rs.git;protocol=https;name=ssh2-rs;destsuffix=ssh2-rs \ + file://ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch;patchdir=../ssh2-rs \ +" + +# 0.2.10 / -sys 0.1.34 +SRCREV_ssh2-rs = "00af6ead0c3d4b82e05bee4d9963ef3823bcf524" + +SRCREV_FORMAT .= "_ssh2-rs" +EXTRA_OECARGO_PATHS += "${WORKDIR}/ssh2-rs" + +## git2-rs +SRC_URI += "\ + git://github.com/alexcrichton/git2-rs.git;protocol=https;name=git2-rs;destsuffix=git2-rs \ + file://git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch;patchdir=../git2-rs \ +" + +# 0.3.3 / -sys 0.3.8 +SRCREV_git2-rs = "19b6873c1fad7dc93c9c2dac4cba339dacf16efa" + +SRCREV_FORMAT .= "_git2-rs" +EXTRA_OECARGO_PATHS += "${WORKDIR}/git2-rs" diff --git a/recipes/cargo/cargo_git.bb b/recipes/cargo/cargo_git.bb deleted file mode 100644 index 70fa809..0000000 --- a/recipes/cargo/cargo_git.bb +++ /dev/null @@ -1,51 +0,0 @@ -# 2015-06-29 -SRCREV_cargo = "339a103fa71701541229316a568fca12cf07fc8d" -SRCREV_rust-installer = "8e4f8ea581502a2edc8177a040300e05ff7f91e3" - -require cargo.inc - -SRC_URI += " \ - git://github.com/carllerche/curl-rust.git;protocol=https;destsuffix=curl-rust;name=curl-rust \ - file://curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch;patchdir=../curl-rust \ - file://curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch;patchdir=../curl-rust \ -\ - git://github.com/alexcrichton/ssh2-rs.git;protocol=https;name=ssh2-rs;destsuffix=ssh2-rs \ - file://ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch;patchdir=../ssh2-rs \ -\ - git://github.com/alexcrichton/git2-rs.git;protocol=https;name=git2-rs;destsuffix=git2-rs \ - file://git2-rs/0001-Add-generic-openssl-sys-dep.patch;patchdir=../git2-rs \ -" - -# 0.2.10 / -sys 0.1.24 -SRCREV_curl-rust = "9fbf39fa8765e777d110ad18a2a2a3ea42dcb717" - -# 0.2.8 / -sys 0.1.25 -SRCREV_ssh2-rs = "afc39c6e7236b87d7ebde21ee4d4743d9437b85f" - -# 0.2.11 / -sys 0.2.14 -SRCREV_git2-rs = "3a7a990607a766fa65a40b920d70c8289691d2f8" - -SRCREV_FORMAT .= "_curl-rust_curl_ssh2-rs_git2-rs" -EXTRA_OECARGO_PATHS = "\ - ${WORKDIR}/curl-rust \ - ${WORKDIR}/ssh2-rs \ - ${WORKDIR}/git2-rs \ -" - -CARGO_SNAPSHOT = "2015-04-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" -SRC_URI[md5sum] = "3d62194d02a9088cd8aae379e9498134" -SRC_URI[sha256sum] = "16b6338ba2942989693984ba4dbd057c2801e8805e6da8fa7b781b00e722d117" - -# Used in libgit2-sys's build.rs, needed for pkg-config to be used -export LIBGIT2_SYS_USE_PKG_CONFIG = "1" - -# FIXME: we don't actually use these, and shouldn't need to fetch it, but not having it results in: -## target/snapshot/bin/cargo build --target x86_64-linux --verbose -## Failed to resolve path '/home/cody/obj/y/tmp/work/x86_64-linux/cargo-native/git+gitAUTOINC+0b84923203_9181ea8f4e_8baa8ccb39-r0/curl-rust/curl-sys/curl/.git': No such file or directory - -SRC_URI += "\ - git://github.com/alexcrichton/curl.git;protocol=https;destsuffix=curl-rust/curl-sys/curl;name=curl;branch=configure \ - git://github.com/libgit2/libgit2.git;protocol=https;destsuffix=git2-rs/libgit2-sys/libgit2;name=libgit2 \ -" -SRCREV_curl = "9a300aa13e5035a795396e429aa861229424c9dc" -SRCREV_libgit2 = "47f37400253210f483d84fb9c2ecf44fb5986849" diff --git a/recipes/cargo/files/0001-update-Rust.patch b/recipes/cargo/files/0001-update-Rust.patch deleted file mode 100644 index 6f963a5..0000000 --- a/recipes/cargo/files/0001-update-Rust.patch +++ /dev/null @@ -1,906 +0,0 @@ -From d122d57536df9fbfcdfda08b2918dc6e0c6209c0 Mon Sep 17 00:00:00 2001 -From: Andrew Paseltiner -Date: Thu, 12 Feb 2015 23:10:07 -0500 -Subject: [PATCH] update Rust - ---- - Cargo.lock | 32 ++++++++++++------------ - src/bin/build.rs | 4 +-- - src/bin/cargo.rs | 2 +- - src/bin/clean.rs | 4 +-- - src/bin/generate_lockfile.rs | 4 +-- - src/bin/new.rs | 4 +-- - src/bin/update.rs | 4 +-- - src/bin/verify_project.rs | 4 +-- - src/bin/version.rs | 4 +-- - src/cargo/lib.rs | 2 +- - src/cargo/ops/cargo_new.rs | 4 +-- - src/cargo/ops/cargo_rustc/engine.rs | 2 +- - src/cargo/ops/registry.rs | 4 +-- - src/cargo/sources/git/utils.rs | 3 ++- - src/cargo/util/config.rs | 2 +- - src/cargo/util/hex.rs | 5 ++-- - src/cargo/util/profile.rs | 2 +- - src/rustversion.txt | 2 +- - tests/support/mod.rs | 2 +- - tests/test_cargo.rs | 2 +- - tests/test_cargo_compile.rs | 10 ++++---- - tests/test_cargo_compile_custom_build.rs | 42 ++++++++++++++++---------------- - tests/test_cargo_compile_git_deps.rs | 24 +++++++++--------- - tests/test_cargo_compile_plugins.rs | 6 ++--- - tests/test_cargo_cross_compile.rs | 28 ++++++++++----------- - tests/test_cargo_profiles.rs | 6 ++--- - 26 files changed, 103 insertions(+), 105 deletions(-) - -diff --git a/Cargo.lock b/Cargo.lock -index 14dd876..629585c 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -4,7 +4,7 @@ version = "0.1.0" - dependencies = [ - "advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -- "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)", -+ "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -18,8 +18,8 @@ dependencies = [ - "semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -- "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", -- "toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", -+ "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -+ "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -55,13 +55,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] - name = "docopt" --version = "0.6.36" -+version = "0.6.37" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -97,7 +97,7 @@ version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -+ "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -136,13 +136,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "libgit2-sys" --version = "0.1.12" -+version = "0.1.13" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] -@@ -159,7 +159,7 @@ version = "0.1.5" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -192,12 +192,12 @@ dependencies = [ - - [[package]] - name = "openssl-sys" --version = "0.3.3" -+version = "0.3.6" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -- "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] -@@ -207,7 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "pkg-config" --version = "0.2.0" -+version = "0.2.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -@@ -255,7 +255,7 @@ dependencies = [ - - [[package]] - name = "time" --version = "0.1.16" -+version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -264,7 +264,7 @@ dependencies = [ - - [[package]] - name = "toml" --version = "0.1.16" -+version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", -diff --git a/src/bin/build.rs b/src/bin/build.rs -index a617f64..0784c04 100644 ---- a/src/bin/build.rs -+++ b/src/bin/build.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo::ops::CompileOptions; - use cargo::ops; -@@ -47,7 +47,7 @@ the --release flag will use the `release` profile instead. - "; - - pub fn execute(options: Options, config: &Config) -> CliResult> { -- debug!("executing; cmd=cargo-build; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-build; args={:?}", env::args().collect::>()); - config.shell().set_verbose(options.flag_verbose); - - let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path)); -diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs -index 7bf0a11..53c904d 100644 ---- a/src/bin/cargo.rs -+++ b/src/bin/cargo.rs -@@ -245,7 +245,7 @@ fn list_command_directory() -> Vec { - dirs.push(path.join("../lib/cargo")); - dirs.push(path); - } -- if let Some(val) = env::var("PATH") { -+ if let Some(val) = env::var_os("PATH") { - dirs.extend(env::split_paths(&val)); - } - dirs -diff --git a/src/bin/clean.rs b/src/bin/clean.rs -index dcc013e..a530b9b 100644 ---- a/src/bin/clean.rs -+++ b/src/bin/clean.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo::ops; - use cargo::util::{CliResult, CliError, Config}; -@@ -33,7 +33,7 @@ and its format, see the `cargo help pkgid` command. - - pub fn execute(options: Options, config: &Config) -> CliResult> { - config.shell().set_verbose(options.flag_verbose); -- debug!("executing; cmd=cargo-clean; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-clean; args={:?}", env::args().collect::>()); - - let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path)); - let opts = ops::CleanOptions { -diff --git a/src/bin/generate_lockfile.rs b/src/bin/generate_lockfile.rs -index a350ab6..d9777ef 100644 ---- a/src/bin/generate_lockfile.rs -+++ b/src/bin/generate_lockfile.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo::ops; - use cargo::util::{CliResult, CliError, Config}; -@@ -23,7 +23,7 @@ Options: - "; - - pub fn execute(options: Options, config: &Config) -> CliResult> { -- debug!("executing; cmd=cargo-generate-lockfile; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-generate-lockfile; args={:?}", env::args().collect::>()); - config.shell().set_verbose(options.flag_verbose); - let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path)); - -diff --git a/src/bin/new.rs b/src/bin/new.rs -index 4126e38..0abff6a 100644 ---- a/src/bin/new.rs -+++ b/src/bin/new.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo::ops; - use cargo::util::{CliResult, CliError, Config}; -@@ -28,7 +28,7 @@ Options: - "; - - pub fn execute(options: Options, config: &Config) -> CliResult> { -- debug!("executing; cmd=cargo-new; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-new; args={:?}", env::args().collect::>()); - config.shell().set_verbose(options.flag_verbose); - - let Options { flag_bin, arg_path, flag_vcs, .. } = options; -diff --git a/src/bin/update.rs b/src/bin/update.rs -index fa75506..4fdeebf 100644 ---- a/src/bin/update.rs -+++ b/src/bin/update.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo::ops; - use cargo::util::{CliResult, CliError, Config}; -@@ -49,7 +49,7 @@ For more information about package id specifications, see `cargo help pkgid`. - "; - - pub fn execute(options: Options, config: &Config) -> CliResult> { -- debug!("executing; cmd=cargo-update; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-update; args={:?}", env::args().collect::>()); - config.shell().set_verbose(options.flag_verbose); - let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path)); - -diff --git a/src/bin/verify_project.rs b/src/bin/verify_project.rs -index 54f8d6e..816c5e9 100644 ---- a/src/bin/verify_project.rs -+++ b/src/bin/verify_project.rs -@@ -1,8 +1,8 @@ - extern crate toml; - - use std::collections::HashMap; -+use std::env; - use std::old_io::File; --use std::os; - - use cargo::util::{CliResult, Config}; - -@@ -47,6 +47,6 @@ pub fn execute(args: Flags, config: &Config) -> CliResult> { - fn fail(reason: &str, value: &str) -> CliResult>{ - let mut h = HashMap::new(); - h.insert(reason.to_string(), value.to_string()); -- os::set_exit_status(1); -+ env::set_exit_status(1); - Ok(Some(h)) - } -diff --git a/src/bin/version.rs b/src/bin/version.rs -index e1bc011..b5622f2 100644 ---- a/src/bin/version.rs -+++ b/src/bin/version.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - - use cargo; - use cargo::util::{CliResult, Config}; -@@ -16,7 +16,7 @@ Options: - "; - - pub fn execute(_: Options, _: &Config) -> CliResult> { -- debug!("executing; cmd=cargo-version; args={:?}", os::args()); -+ debug!("executing; cmd=cargo-version; args={:?}", env::args().collect::>()); - - println!("{}", cargo::version()); - -diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs -index 609e1bd..d5737ef 100644 ---- a/src/cargo/lib.rs -+++ b/src/cargo/lib.rs -@@ -95,7 +95,7 @@ fn process(mut callback: F) - let mut shell = shell(true); - process_executed((|| { - let config = try!(Config::new(&mut shell)); -- let args: Vec<_> = try!(env::args().map(|s| { -+ let args: Vec<_> = try!(env::args_os().map(|s| { - s.into_string().map_err(|s| { - human(format!("invalid unicode in argument: {:?}", s)) - }) -diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs -index 09d8318..ae9d5e5 100644 ---- a/src/cargo/ops/cargo_new.rs -+++ b/src/cargo/ops/cargo_new.rs -@@ -134,8 +134,8 @@ fn discover_author() -> CargoResult<(String, Option)> { - let git_config = git_config.as_ref(); - let name = git_config.and_then(|g| g.get_str("user.name").ok()) - .map(|s| s.to_string()) -- .or_else(|| env::var_string("USER").ok()) // unix -- .or_else(|| env::var_string("USERNAME").ok()); // windows -+ .or_else(|| env::var("USER").ok()) // unix -+ .or_else(|| env::var("USERNAME").ok()); // windows - let name = match name { - Some(name) => name, - None => { -diff --git a/src/cargo/ops/cargo_rustc/engine.rs b/src/cargo/ops/cargo_rustc/engine.rs -index 5c6a0ef..9d234f8 100644 ---- a/src/cargo/ops/cargo_rustc/engine.rs -+++ b/src/cargo/ops/cargo_rustc/engine.rs -@@ -85,7 +85,7 @@ impl CommandPrototype { - - pub fn get_env(&self, var: &str) -> Option { - self.env.get(var).cloned().or_else(|| { -- Some(env::var_string(var).ok().map(|s| CString::from_vec(s.into_bytes()))) -+ Some(env::var(var).ok().map(|s| CString::from_vec(s.into_bytes()))) - }).and_then(|val| val) - } - -diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs -index 2461981..59754f2 100644 ---- a/src/cargo/ops/registry.rs -+++ b/src/cargo/ops/registry.rs -@@ -191,7 +191,7 @@ pub fn http_proxy(config: &Config) -> CargoResult> { - } - Err(..) => {} - } -- Ok(env::var_string("HTTP_PROXY").ok()) -+ Ok(env::var("HTTP_PROXY").ok()) - } - - pub fn http_timeout(config: &Config) -> CargoResult> { -@@ -199,7 +199,7 @@ pub fn http_timeout(config: &Config) -> CargoResult> { - Some((s, _)) => return Ok(Some(s)), - None => {} - } -- Ok(env::var_string("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok())) -+ Ok(env::var("HTTP_TIMEOUT").ok().and_then(|s| s.parse().ok())) - } - - pub fn registry_login(config: &Config, token: String) -> CargoResult<()> { -diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs -index 898f082..9861ed6 100644 ---- a/src/cargo/sources/git/utils.rs -+++ b/src/cargo/sources/git/utils.rs -@@ -308,7 +308,8 @@ impl<'a> GitCheckout<'a> { - // as the submodule's head, then we can bail out and go to the - // next submodule. - let head_and_repo = child.open().and_then(|repo| { -- Ok((try!(repo.head()).target(), repo)) -+ let target = try!(repo.head()).target(); -+ Ok((target, repo)) - }); - let repo = match head_and_repo { - Ok((head, repo)) => { -diff --git a/src/cargo/util/config.rs b/src/cargo/util/config.rs -index 217d028..076e68d 100644 ---- a/src/cargo/util/config.rs -+++ b/src/cargo/util/config.rs -@@ -380,7 +380,7 @@ impl ConfigValue { - } - - fn homedir() -> Option { -- let cargo_home = env::var_string("CARGO_HOME").map(|p| Path::new(p)).ok(); -+ let cargo_home = env::var("CARGO_HOME").map(|p| Path::new(p)).ok(); - let user_home = env::home_dir().map(|p| p.join(".cargo")); - return cargo_home.or(user_home); - } -diff --git a/src/cargo/util/hex.rs b/src/cargo/util/hex.rs -index 2bce7ea..3e8d962 100644 ---- a/src/cargo/util/hex.rs -+++ b/src/cargo/util/hex.rs -@@ -1,12 +1,11 @@ --use std::old_io::MemWriter; - use std::hash::{Hasher, Hash, SipHasher}; - - use rustc_serialize::hex::ToHex; - - pub fn to_hex(num: u64) -> String { -- let mut writer = MemWriter::with_capacity(8); -+ let mut writer = Vec::with_capacity(8); - writer.write_le_u64(num).unwrap(); // this should never fail -- writer.get_ref().to_hex() -+ writer.to_hex() - } - - pub fn short_hash>(hashable: &H) -> String { -diff --git a/src/cargo/util/profile.rs b/src/cargo/util/profile.rs -index 9d19c36..100fd2c 100644 ---- a/src/cargo/util/profile.rs -+++ b/src/cargo/util/profile.rs -@@ -14,7 +14,7 @@ pub struct Profiler { - desc: String, - } - --fn enabled() -> bool { env::var("CARGO_PROFILE").is_some() } -+fn enabled() -> bool { env::var_os("CARGO_PROFILE").is_some() } - - pub fn start(desc: T) -> Profiler { - if !enabled() { return Profiler { desc: String::new() } } -diff --git a/src/rustversion.txt b/src/rustversion.txt -index e2a057d..17cae77 100644 ---- a/src/rustversion.txt -+++ b/src/rustversion.txt -@@ -1 +1 @@ --2015-02-09 -+2015-02-12 -diff --git a/tests/support/mod.rs b/tests/support/mod.rs -index 83be295..7c10756 100644 ---- a/tests/support/mod.rs -+++ b/tests/support/mod.rs -@@ -227,7 +227,7 @@ impl ErrMsg for Result { - - // Path to cargo executables - pub fn cargo_dir() -> Path { -- env::var_string("CARGO_BIN_PATH").map(Path::new).ok() -+ env::var("CARGO_BIN_PATH").map(Path::new).ok() - .or_else(|| env::current_exe().ok().map(|s| s.dir_path())) - .unwrap_or_else(|| { - panic!("CARGO_BIN_PATH wasn't set. Cannot continue running test") -diff --git a/tests/test_cargo.rs b/tests/test_cargo.rs -index b4b1abd..64e4c75 100644 ---- a/tests/test_cargo.rs -+++ b/tests/test_cargo.rs -@@ -25,7 +25,7 @@ fn fake_executable(proj: ProjectBuilder, dir: &Path, name: &str) -> ProjectBuild - } - - fn path() -> Vec { -- env::split_paths(&env::var("PATH").unwrap_or(OsString::new())).collect() -+ env::split_paths(&env::var_os("PATH").unwrap_or(OsString::new())).collect() - } - - test!(list_commands_looks_at_path { -diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs -index 20fcab8..9c5b934 100644 ---- a/tests/test_cargo_compile.rs -+++ b/tests/test_cargo_compile.rs -@@ -1259,7 +1259,7 @@ test!(freshness_ignores_excluded { - exclude = ["src/b*.rs"] - "#) - .file("build.rs", "fn main() {}") -- .file("src/lib.rs", "pub fn bar() -> int { 1 }"); -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }"); - foo.build(); - foo.root().move_into_the_past().unwrap(); - -@@ -1297,15 +1297,15 @@ test!(rebuild_preserves_out_dir { - use std::old_io::File; - - fn main() { -- let path = Path::new(env::var_string("OUT_DIR").unwrap()).join("foo"); -- if env::var("FIRST").is_some() { -+ let path = Path::new(env::var("OUT_DIR").unwrap()).join("foo"); -+ if env::var_os("FIRST").is_some() { - File::create(&path).unwrap(); - } else { - File::create(&path).unwrap(); - } - } - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }"); -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }"); - foo.build(); - foo.root().move_into_the_past().unwrap(); - -@@ -1335,7 +1335,7 @@ test!(dep_no_libs { - [dependencies.bar] - path = "bar" - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - .file("bar/Cargo.toml", r#" - [package] - name = "bar" -diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs -index b110b86..4ef727b 100644 ---- a/tests/test_cargo_compile_custom_build.rs -+++ b/tests/test_cargo_compile_custom_build.rs -@@ -79,32 +79,32 @@ test!(custom_build_env_vars { - use std::env; - use std::old_io::fs::PathExtensions; - fn main() {{ -- let _target = env::var_string("TARGET").unwrap(); -+ let _target = env::var("TARGET").unwrap(); - -- let _ncpus = env::var_string("NUM_JOBS").unwrap(); -+ let _ncpus = env::var("NUM_JOBS").unwrap(); - -- let out = env::var_string("CARGO_MANIFEST_DIR").unwrap(); -+ let out = env::var("CARGO_MANIFEST_DIR").unwrap(); - let p1 = Path::new(out); - let cwd = env::current_dir().unwrap(); - let p2 = cwd.join(Path::new(file!()).dir_path().dir_path()); - assert!(p1 == p2, "{{}} != {{}}", p1.display(), p2.display()); - -- let opt = env::var_string("OPT_LEVEL").unwrap(); -+ let opt = env::var("OPT_LEVEL").unwrap(); - assert_eq!(opt.as_slice(), "0"); - -- let opt = env::var_string("PROFILE").unwrap(); -+ let opt = env::var("PROFILE").unwrap(); - assert_eq!(opt.as_slice(), "compile"); - -- let debug = env::var_string("DEBUG").unwrap(); -+ let debug = env::var("DEBUG").unwrap(); - assert_eq!(debug.as_slice(), "true"); - -- let out = env::var_string("OUT_DIR").unwrap(); -+ let out = env::var("OUT_DIR").unwrap(); - assert!(out.as_slice().starts_with(r"{0}")); - assert!(Path::new(out).is_dir()); - -- let _host = env::var_string("HOST").unwrap(); -+ let _host = env::var("HOST").unwrap(); - -- let _feat = env::var_string("CARGO_FEATURE_FOO").unwrap(); -+ let _feat = env::var("CARGO_FEATURE_FOO").unwrap(); - }} - "#, - p.root().join("target").join("build").display()); -@@ -269,8 +269,8 @@ test!(overrides_and_links { - .file("build.rs", r#" - use std::env; - fn main() { -- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz"); -+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz"); - } - "#) - .file(".cargo/config", format!(r#" -@@ -342,8 +342,8 @@ test!(links_passes_env_vars { - .file("build.rs", r#" - use std::env; - fn main() { -- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz"); -+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz"); - } - "#) - .file("a/Cargo.toml", r#" -@@ -441,8 +441,8 @@ test!(rebuild_continues_to_pass_env_vars { - .file("build.rs", r#" - use std::env; - fn main() { -- assert_eq!(env::var_string("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -- assert_eq!(env::var_string("DEP_FOO_BAR").unwrap().as_slice(), "baz"); -+ assert_eq!(env::var("DEP_FOO_FOO").unwrap().as_slice(), "bar"); -+ assert_eq!(env::var("DEP_FOO_BAR").unwrap().as_slice(), "baz"); - } - "#); - -@@ -727,7 +727,7 @@ test!(out_dir_is_preserved { - use std::env; - use std::old_io::File; - fn main() { -- let out = env::var_string("OUT_DIR").unwrap(); -+ let out = env::var("OUT_DIR").unwrap(); - File::create(&Path::new(out).join("foo")).unwrap(); - } - "#); -@@ -742,7 +742,7 @@ test!(out_dir_is_preserved { - use std::env; - use std::old_io::File; - fn main() { -- let out = env::var_string("OUT_DIR").unwrap(); -+ let out = env::var("OUT_DIR").unwrap(); - File::open(&Path::new(out).join("foo")).unwrap(); - } - "#).unwrap(); -@@ -808,7 +808,7 @@ test!(code_generation { - use std::old_io::File; - - fn main() { -- let dst = Path::new(env::var_string("OUT_DIR").unwrap()); -+ let dst = Path::new(env::var("OUT_DIR").unwrap()); - let mut f = File::create(&dst.join("hello.rs")).unwrap(); - f.write_str(" - pub fn message() -> &'static str { -@@ -972,9 +972,9 @@ test!(test_a_lib_with_a_build_command { - use std::old_io::File; - - fn main() { -- let out = Path::new(env::var_string("OUT_DIR").unwrap()); -+ let out = Path::new(env::var("OUT_DIR").unwrap()); - File::create(&out.join("foo.rs")).write_str(" -- fn foo() -> int { 1 } -+ fn foo() -> i32 { 1 } - ").unwrap(); - } - "#); -@@ -1062,7 +1062,7 @@ test!(build_script_with_dynamic_native_dependency { - use std::env; - - fn main() { -- let src = Path::new(env::var_string("SRC").unwrap()); -+ let src = Path::new(env::var("SRC").unwrap()); - println!("cargo:rustc-flags=-L {}", src.dir_path().display()); - } - "#) -diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs -index 5777e1a..11a152f 100644 ---- a/tests/test_cargo_compile_git_deps.rs -+++ b/tests/test_cargo_compile_git_deps.rs -@@ -461,7 +461,7 @@ test!(two_revs_same_deps { - version = "0.0.0" - authors = [] - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - }).unwrap(); - - let repo = git2::Repository::open(&bar.root()).unwrap(); -@@ -469,7 +469,7 @@ test!(two_revs_same_deps { - - // Commit the changes and make sure we trigger a recompile - File::create(&bar.root().join("src/lib.rs")).write_str(r#" -- pub fn bar() -> int { 2 } -+ pub fn bar() -> i32 { 2 } - "#).unwrap(); - add(&repo); - let rev2 = commit(&repo); -@@ -511,7 +511,7 @@ test!(two_revs_same_deps { - "#, bar.url(), rev2).as_slice()) - .file("src/lib.rs", r#" - extern crate bar; -- pub fn baz() -> int { bar::bar() } -+ pub fn baz() -> i32 { bar::bar() } - "#); - - baz.build(); -@@ -860,7 +860,7 @@ test!(stale_cached_version { - version = "0.0.0" - authors = [] - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - }).unwrap(); - - // Update the git database in the cache with the current state of the git -@@ -887,7 +887,7 @@ test!(stale_cached_version { - // Update the repo, and simulate someone else updating the lockfile and then - // us pulling it down. - File::create(&bar.root().join("src/lib.rs")).write_str(r#" -- pub fn bar() -> int { 1 + 0 } -+ pub fn bar() -> i32 { 1 + 0 } - "#).unwrap(); - let repo = git2::Repository::open(&bar.root()).unwrap(); - add(&repo); -@@ -1090,7 +1090,7 @@ test!(git_build_cmd_freshness { - build = "build.rs" - "#) - .file("build.rs", "fn main() {}") -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - .file(".gitignore", " - src/bar.rs - ") -@@ -1166,7 +1166,7 @@ test!(git_repo_changing_no_rebuild { - version = "0.5.0" - authors = ["wycats@example.com"] - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - }).unwrap(); - - // Lock p1 to the first rev in the git repo -@@ -1193,7 +1193,7 @@ test!(git_repo_changing_no_rebuild { - - // Make a commit to lock p2 to a different rev - File::create(&bar.root().join("src/lib.rs")).write_str(r#" -- pub fn bar() -> int { 2 } -+ pub fn bar() -> i32 { 2 } - "#).unwrap(); - let repo = git2::Repository::open(&bar.root()).unwrap(); - add(&repo); -@@ -1256,7 +1256,7 @@ test!(git_dep_build_cmd { - name = "bar" - "#) - .file("bar/src/bar.rs.in", r#" -- pub fn gimme() -> int { 0 } -+ pub fn gimme() -> i32 { 0 } - "#) - .file("bar/build.rs", r#" - use std::old_io::fs; -@@ -1278,7 +1278,7 @@ test!(git_dep_build_cmd { - - // Touching bar.rs.in should cause the `build` command to run again. - let mut file = fs::File::create(&p.root().join("bar/src/bar.rs.in")).unwrap(); -- file.write_str(r#"pub fn gimme() -> int { 1 }"#).unwrap(); -+ file.write_str(r#"pub fn gimme() -> i32 { 1 }"#).unwrap(); - drop(file); - - assert_that(p.process(cargo_dir().join("cargo")).arg("build"), -@@ -1297,7 +1297,7 @@ test!(fetch_downloads { - version = "0.5.0" - authors = ["wycats@example.com"] - "#) -- .file("src/lib.rs", "pub fn bar() -> int { 1 }") -+ .file("src/lib.rs", "pub fn bar() -> i32 { 1 }") - }).unwrap(); - - let p = project("p1") -@@ -1569,7 +1569,7 @@ test!(update_one_source_updates_all_packages_in_that_git_source { - - // Just be sure to change a file - File::create(&dep.root().join("src/lib.rs")).write_str(r#" -- pub fn bar() -> int { 2 } -+ pub fn bar() -> i32 { 2 } - "#).unwrap(); - add(&repo); - commit(&repo); -diff --git a/tests/test_cargo_compile_plugins.rs b/tests/test_cargo_compile_plugins.rs -index 853038f..ca44a4d 100644 ---- a/tests/test_cargo_compile_plugins.rs -+++ b/tests/test_cargo_compile_plugins.rs -@@ -23,14 +23,14 @@ test!(plugin_to_the_max { - "#) - .file("src/main.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] extern crate bar; -+ #![plugin(bar)] - extern crate foo_lib; - - fn main() { foo_lib::foo(); } - "#) - .file("src/foo_lib.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] extern crate bar; -+ #![plugin(bar)] - - pub fn foo() {} - "#); -@@ -122,7 +122,7 @@ test!(plugin_with_dynamic_native_dependency { - "#) - .file("src/main.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] extern crate bar; -+ #![plugin(bar)] - - fn main() {} - "#) -diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs -index a2d53e0..cf6b9a5 100644 ---- a/tests/test_cargo_cross_compile.rs -+++ b/tests/test_cargo_cross_compile.rs -@@ -12,7 +12,7 @@ fn setup() { - - fn disabled() -> bool { - // First, disable if ./configure requested so -- match env::var_string("CFG_DISABLE_CROSS_TESTS") { -+ match env::var("CFG_DISABLE_CROSS_TESTS") { - Ok(ref s) if s.as_slice() == "1" => return true, - _ => {} - } -@@ -44,7 +44,7 @@ test!(simple_cross { - "#) - .file("build.rs", format!(r#" - fn main() {{ -- assert_eq!(std::env::var_string("TARGET").unwrap().as_slice(), "{}"); -+ assert_eq!(std::env::var("TARGET").unwrap().as_slice(), "{}"); - }} - "#, alternate()).as_slice()) - .file("src/main.rs", r#" -@@ -119,8 +119,7 @@ test!(plugin_deps { - "#) - .file("src/main.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] -- extern crate bar; -+ #![plugin(bar)] - extern crate baz; - fn main() { - assert_eq!(bar!(), baz::baz()); -@@ -155,7 +154,7 @@ test!(plugin_deps { - - fn expand_bar(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) - -> Box { -- MacExpr::new(quote_expr!(cx, 1i)) -+ MacExpr::new(quote_expr!(cx, 1)) - } - "#); - let baz = project("baz") -@@ -165,7 +164,7 @@ test!(plugin_deps { - version = "0.0.1" - authors = [] - "#) -- .file("src/lib.rs", "pub fn baz() -> int { 1 }"); -+ .file("src/lib.rs", "pub fn baz() -> i32 { 1 }"); - bar.build(); - baz.build(); - -@@ -197,8 +196,7 @@ test!(plugin_to_the_max { - "#) - .file("src/main.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] -- extern crate bar; -+ #![plugin(bar)] - extern crate baz; - fn main() { - assert_eq!(bar!(), baz::baz()); -@@ -320,7 +318,7 @@ test!(plugin_with_extra_dylib_dep { - "#) - .file("src/main.rs", r#" - #![feature(plugin)] -- #[plugin] #[no_link] extern crate bar; -+ #![plugin(bar)] - - fn main() {} - "#); -@@ -362,7 +360,7 @@ test!(plugin_with_extra_dylib_dep { - name = "baz" - crate_type = ["dylib"] - "#) -- .file("src/lib.rs", "pub fn baz() -> int { 1 }"); -+ .file("src/lib.rs", "pub fn baz() -> i32 { 1 }"); - bar.build(); - baz.build(); - -@@ -464,8 +462,8 @@ test!(cross_with_a_build_script { - .file("build.rs", format!(r#" - use std::env; - fn main() {{ -- assert_eq!(env::var_string("TARGET").unwrap().as_slice(), "{0}"); -- let mut path = Path::new(env::var_string("OUT_DIR").unwrap()); -+ assert_eq!(env::var("TARGET").unwrap().as_slice(), "{0}"); -+ let mut path = Path::new(env::var("OUT_DIR").unwrap()); - assert_eq!(path.filename().unwrap(), b"out"); - path.pop(); - assert!(path.filename().unwrap().starts_with(b"foo-")); -@@ -530,7 +528,7 @@ test!(build_script_needed_for_host_and_target { - .file("d1/build.rs", r#" - use std::env; - fn main() { -- let target = env::var_string("TARGET").unwrap(); -+ let target = env::var("TARGET").unwrap(); - println!("cargo:rustc-flags=-L /path/to/{}", target); - } - "#) -@@ -643,9 +641,9 @@ test!(build_script_only_host { - use std::env; - - fn main() { -- assert!(env::var_string("OUT_DIR").unwrap() -+ assert!(env::var("OUT_DIR").unwrap() - .contains("target/build/d1-"), -- "bad: {:?}", env::var_string("OUT_DIR")); -+ "bad: {:?}", env::var("OUT_DIR")); - } - "#); - -diff --git a/tests/test_cargo_profiles.rs b/tests/test_cargo_profiles.rs -index b71eadb..827393f 100644 ---- a/tests/test_cargo_profiles.rs -+++ b/tests/test_cargo_profiles.rs -@@ -1,4 +1,4 @@ --use std::os; -+use std::env; - use std::old_path; - - use support::{project, execs}; -@@ -110,6 +110,6 @@ test!(top_level_overrides_deps { - dir = p.root().display(), - url = p.url(), - sep = old_path::SEP, -- prefix = os::consts::DLL_PREFIX, -- suffix = os::consts::DLL_SUFFIX).as_slice())); -+ prefix = env::consts::DLL_PREFIX, -+ suffix = env::consts::DLL_SUFFIX).as_slice())); - }); --- -2.3.0 - diff --git a/recipes/cargo/files/0001-update-pkg-versions.patch b/recipes/cargo/files/0001-update-pkg-versions.patch deleted file mode 100644 index d667e97..0000000 --- a/recipes/cargo/files/0001-update-pkg-versions.patch +++ /dev/null @@ -1,138 +0,0 @@ -From f32fa685610399739a2584ae02653753a372d6ed Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Fri, 13 Feb 2015 15:24:16 -0500 -Subject: [PATCH] update pkg versions - ---- - Cargo.lock | 32 ++++++++++++++++---------------- - 1 file changed, 16 insertions(+), 16 deletions(-) - -diff --git a/Cargo.lock b/Cargo.lock -index 14dd876..629585c 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -4,7 +4,7 @@ version = "0.1.0" - dependencies = [ - "advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -- "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)", -+ "docopt 0.6.37 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -18,8 +18,8 @@ dependencies = [ - "semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -- "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", -- "toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", -+ "time 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", -+ "toml 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -44,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -55,13 +55,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] - name = "docopt" --version = "0.6.36" -+version = "0.6.37" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -97,7 +97,7 @@ version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -- "libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -+ "libgit2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -136,13 +136,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "libgit2-sys" --version = "0.1.12" -+version = "0.1.13" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libssh2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -- "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] -@@ -159,7 +159,7 @@ version = "0.1.5" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -- "openssl-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -+ "openssl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - ] - -@@ -192,12 +192,12 @@ dependencies = [ - - [[package]] - name = "openssl-sys" --version = "0.3.3" -+version = "0.3.6" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -- "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pkg-config 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] -@@ -207,7 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "pkg-config" --version = "0.2.0" -+version = "0.2.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -@@ -255,7 +255,7 @@ dependencies = [ - - [[package]] - name = "time" --version = "0.1.16" -+version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -@@ -264,7 +264,7 @@ dependencies = [ - - [[package]] - name = "toml" --version = "0.1.16" -+version = "0.1.17" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", --- -2.3.0 - diff --git a/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch b/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch deleted file mode 100644 index 5a6a262..0000000 --- a/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 797df37f3a9b377db475f3d2eae09fcbb90d2e4f Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 25 Nov 2014 11:50:28 -0500 -Subject: [PATCH 1/2] curl-sys: avoid explicitly linking in openssl. If it is - needed, pkgconfig will pull it in - ---- - curl-sys/Cargo.toml | 19 ------------------- - curl-sys/lib.rs | 2 -- - 2 files changed, 21 deletions(-) - -diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml -index 6e99e16..50d1101 100644 ---- a/curl-sys/Cargo.toml -+++ b/curl-sys/Cargo.toml -@@ -18,23 +18,4 @@ path = "lib.rs" - [dependencies] - libz-sys = "0.1.0" - libc = "0.1" -- --# Unix platforms use OpenSSL for now to provide SSL functionality --[target.i686-apple-darwin.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-apple-darwin.dependencies] --openssl-sys = "0.6.0" --[target.i686-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.arm-unknown-linux-gnueabihf.dependencies] --openssl-sys = "0.6.0" --[target.aarch64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.i686-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-bitrig.dependencies] - openssl-sys = "0.6.0" -diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs -index 7cae355..a2d58ea 100644 ---- a/curl-sys/lib.rs -+++ b/curl-sys/lib.rs -@@ -1,8 +1,6 @@ - #![allow(non_camel_case_types, raw_pointer_derive)] - - extern crate libc; --#[cfg(not(target_env = "msvc"))] extern crate libz_sys; --#[cfg(unix)] extern crate openssl_sys; - - use libc::{c_void, c_int, c_char, c_uint, c_long}; - --- -2.4.3 - diff --git a/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch b/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch new file mode 100644 index 0000000..2e60687 --- /dev/null +++ b/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch @@ -0,0 +1,62 @@ +From 6d74b6af6a23e195fc54c81a9bbdb21e7d5b6414 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Sat, 12 Dec 2015 22:36:26 -0500 +Subject: [PATCH 1/2] curl-sys: avoid explicitly linking in openssl + +linking libcurl with libssl is handled by pkg-config, not us +This also allows non-blessed triples to work. +--- + curl-sys/Cargo.toml | 26 -------------------------- + curl-sys/lib.rs | 2 -- + 2 files changed, 28 deletions(-) + +diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml +index bf994bf..f153039 100644 +--- a/curl-sys/Cargo.toml ++++ b/curl-sys/Cargo.toml +@@ -19,29 +19,3 @@ path = "lib.rs" + [dependencies] + libz-sys = ">= 0" + libc = "0.2" +- +-# Unix platforms use OpenSSL for now to provide SSL functionality +-[target.i686-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.i686-linux-android.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-linux-musl.dependencies] +-openssl-sys = ">= 0" +-[target.arm-unknown-linux-gnueabihf.dependencies] +-openssl-sys = ">= 0" +-[target.arm-linux-androideabi.dependencies] +-openssl-sys = ">= 0" +-[target.aarch64-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.i686-unknown-freebsd.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-freebsd.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-bitrig.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-openbsd.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-dragonfly.dependencies] +-openssl-sys = ">= 0" +diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs +index be80469..b53b445 100644 +--- a/curl-sys/lib.rs ++++ b/curl-sys/lib.rs +@@ -3,8 +3,6 @@ + extern crate libc; + #[cfg(not(target_env = "msvc"))] + extern crate libz_sys; +-#[cfg(all(unix, not(target_os = "macos")))] +-extern crate openssl_sys; + + use libc::{c_void, c_int, c_char, c_uint, c_long}; + +-- +2.4.10 + diff --git a/recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch b/recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch index dcaa1aa..2b2b865 100644 --- a/recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch +++ b/recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch @@ -1,48 +1,54 @@ -From 625b2491eca17e78fdec374f8e83ec00fcca5fc8 Mon Sep 17 00:00:00 2001 +From 445289f4eacc5c048e4a455bb6d6a6a2b9995e88 Mon Sep 17 00:00:00 2001 From: Cody P Schafer -Date: Tue, 25 Nov 2014 12:26:48 -0500 -Subject: [PATCH 2/2] remove per-triple deps on openssl-sys +Date: Sat, 12 Dec 2015 22:40:33 -0500 +Subject: [PATCH 2/2] remove per triple deps on openssl-sys --- - Cargo.toml | 21 +-------------------- - 1 file changed, 1 insertion(+), 20 deletions(-) + Cargo.toml | 27 +-------------------------- + 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index 16b72c3..68235ae 100644 +index 74f63c8..28aa1fa 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -12,30 +12,11 @@ url = "0.2.0" +@@ -12,36 +12,11 @@ url = "0.2.0" log = "0.3.0" - libc = "0.1" + libc = "0.2" curl-sys = { path = "curl-sys", version = "0.1.0" } -+openssl-sys = "0.6.0" ++openssl-sys = "0.7.0" [dev-dependencies] env_logger = "0.3.0" -# Unix platforms use OpenSSL for now to provide SSL functionality --[target.i686-apple-darwin.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-apple-darwin.dependencies] --openssl-sys = "0.6.0" -[target.i686-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" +-[target.i686-linux-android.dependencies] +-openssl-sys = "0.7.0" -[target.x86_64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-linux-musl.dependencies] +-openssl-sys = "0.7.0" -[target.arm-unknown-linux-gnueabihf.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" +-[target.arm-linux-androideabi.dependencies] +-openssl-sys = "0.7.0" -[target.aarch64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" -[target.i686-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" -[target.x86_64-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" -[target.x86_64-unknown-bitrig.dependencies] --openssl-sys = "0.6.0" +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-openbsd.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-dragonfly.dependencies] +-openssl-sys = "0.7.0" - [[test]] name = "test" -- -2.4.3 +2.4.10 diff --git a/recipes/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch b/recipes/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch deleted file mode 100644 index 6243a28..0000000 --- a/recipes/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch +++ /dev/null @@ -1,59 +0,0 @@ -From aa1bea8387b6108ca2cd60ad71e8d354d8790d62 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 10 Nov 2014 15:06:29 -0500 -Subject: [PATCH] Add generic openssl-sys dep - ---- - libgit2-sys/Cargo.toml | 36 ++---------------------------------- - 1 file changed, 2 insertions(+), 34 deletions(-) - -diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml -index 9c0aa6c..d95d07e 100644 ---- a/libgit2-sys/Cargo.toml -+++ b/libgit2-sys/Cargo.toml -@@ -16,40 +16,8 @@ description = "Native bindings to the libgit2 library" - [dependencies] - libssh2-sys = "0.1.0" - libc = "0.1" -+openssl-sys = "0.6.0" -+libz-sys = "0.1.0" - - [build-dependencies] - pkg-config = "0.3" -- --[target.i686-apple-darwin.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-apple-darwin.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.i686-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.aarch64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.arm-unknown-linux-gnueabihf.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.i686-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-unknown-bitrig.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-unknown-openbsd.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --[target.x86_64-unknown-dragonfly.dependencies] --openssl-sys = "0.6.0" --libz-sys = "0.1.0" --- -2.4.3 - diff --git a/recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch b/recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch new file mode 100644 index 0000000..a525607 --- /dev/null +++ b/recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch @@ -0,0 +1,50 @@ +From 95709b3f5b1495a57043975d7100461feed46b2f Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Sat, 12 Dec 2015 22:53:37 -0500 +Subject: [PATCH] libgit2-sys: avoid blessed triples + +--- + libgit2-sys/Cargo.toml | 22 +--------------------- + 1 file changed, 1 insertion(+), 21 deletions(-) + +diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml +index 15b28d8..3590878 100644 +--- a/libgit2-sys/Cargo.toml ++++ b/libgit2-sys/Cargo.toml +@@ -17,32 +17,12 @@ path = "lib.rs" + libssh2-sys = { version = ">= 0", optional = true } + libc = "0.2" + libz-sys = ">= 0" ++openssl-sys = "0.7.0" + + [build-dependencies] + pkg-config = "0.3" + cmake = "0.1.2" + +-[target.i686-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-linux-musl.dependencies] +-openssl-sys = "0.7.0" +-[target.aarch64-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.arm-unknown-linux-gnueabihf.dependencies] +-openssl-sys = "0.7.0" +-[target.i686-unknown-freebsd.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-freebsd.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-bitrig.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-openbsd.dependencies] +-openssl-sys = "0.7.0" +-[target.x86_64-unknown-dragonfly.dependencies] +-openssl-sys = "0.7.0" +- + [features] + ssh = ["libssh2-sys"] + https = [] +-- +2.4.10 + diff --git a/recipes/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch b/recipes/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch deleted file mode 100644 index 4b5f42d..0000000 --- a/recipes/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a1ba6ce6f54e3b2b0c3e05043a015bc845d24025 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 22:10:18 -0400 -Subject: [PATCH 2/3] libgit2-sys: avoid the build script, it is a disaster - ---- - libgit2-sys/build.rs | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/libgit2-sys/build.rs b/libgit2-sys/build.rs -index d624a63..9b8b98c 100644 ---- a/libgit2-sys/build.rs -+++ b/libgit2-sys/build.rs -@@ -15,6 +15,9 @@ macro_rules! t { - } - - fn main() { -+ pkg_config::find_library("libgit2").unwrap(); -+ return; -+ - register_dep("SSH2"); - register_dep("OPENSSL"); - --- -2.4.3 - diff --git a/recipes/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch b/recipes/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch deleted file mode 100644 index 883a739..0000000 --- a/recipes/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ce3e8e83be261ed7cf0a62dc8e66361588329ba2 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 22:06:57 -0400 -Subject: [PATCH 3/3] bump libssh2 to fix build with nightly - ---- - libgit2-sys/Cargo.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml -index d95d07e..992ea7a 100644 ---- a/libgit2-sys/Cargo.toml -+++ b/libgit2-sys/Cargo.toml -@@ -14,7 +14,7 @@ description = "Native bindings to the libgit2 library" - path = "lib.rs" - - [dependencies] --libssh2-sys = "0.1.0" -+libssh2-sys = "0.1.23" - libc = "0.1" - openssl-sys = "0.6.0" - libz-sys = "0.1.0" --- -2.4.3 - diff --git a/recipes/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch b/recipes/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch deleted file mode 100644 index 42e91c9..0000000 --- a/recipes/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch +++ /dev/null @@ -1,45 +0,0 @@ -From b45c6ed5524690603a1888dff21556b7f42db474 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 1 Dec 2014 10:51:31 -0500 -Subject: [PATCH] Unconditionally depend on openssl-sys - ---- - libssh2-sys/Cargo.toml | 22 ---------------------- - 1 file changed, 22 deletions(-) - -diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml -index 501bba5..db8d21a 100644 ---- a/libssh2-sys/Cargo.toml -+++ b/libssh2-sys/Cargo.toml -@@ -15,28 +15,6 @@ path = "lib.rs" - [dependencies] - libz-sys = "0.1.0" - libc = "0.1" -- --[target.i686-apple-darwin.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-apple-darwin.dependencies] --openssl-sys = "0.6.0" --[target.i686-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.aarch64-unknown-linux-gnu.dependencies] --openssl-sys = "0.6.0" --[target.arm-unknown-linux-gnueabihf.dependencies] --openssl-sys = "0.6.0" --[target.i686-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-freebsd.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-dragonfly.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-bitrig.dependencies] --openssl-sys = "0.6.0" --[target.x86_64-unknown-openbsd.dependencies] - openssl-sys = "0.6.0" - - [build-dependencies] --- -2.4.3 - diff --git a/recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch b/recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch new file mode 100644 index 0000000..18465b7 --- /dev/null +++ b/recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch @@ -0,0 +1,62 @@ +From be07c11b438550829d82dc844e38806570232cd7 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Sat, 12 Dec 2015 22:44:14 -0500 +Subject: [PATCH] libssh2-sys: avoid explicitly linking in openssl + +--- + libssh2-sys/Cargo.toml | 25 ------------------------- + libssh2-sys/lib.rs | 2 -- + 2 files changed, 27 deletions(-) + +diff --git a/libssh2-sys/Cargo.toml b/libssh2-sys/Cargo.toml +index b9ecec2..78f92ac 100644 +--- a/libssh2-sys/Cargo.toml ++++ b/libssh2-sys/Cargo.toml +@@ -18,31 +18,6 @@ libc = "0.2" + ws2_32-sys = ">= 0" + winapi = "0.2" + +-[target.i686-apple-darwin.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-apple-darwin.dependencies] +-openssl-sys = ">= 0" +-[target.i686-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.aarch64-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-linux-musl.dependencies] +-openssl-sys = ">= 0" +-[target.arm-unknown-linux-gnueabihf.dependencies] +-openssl-sys = ">= 0" +-[target.i686-unknown-freebsd.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-freebsd.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-dragonfly.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-bitrig.dependencies] +-openssl-sys = ">= 0" +-[target.x86_64-unknown-openbsd.dependencies] +-openssl-sys = ">= 0" +- + [build-dependencies] + pkg-config = "0.3" + cmake = "0.1.2" +diff --git a/libssh2-sys/lib.rs b/libssh2-sys/lib.rs +index bb6c46f..40af82f 100644 +--- a/libssh2-sys/lib.rs ++++ b/libssh2-sys/lib.rs +@@ -6,8 +6,6 @@ extern crate ws2_32; + extern crate winapi; + + extern crate libz_sys; +-#[cfg(unix)] +-extern crate openssl_sys; + + use libc::{c_int, size_t, c_void, c_char, c_long, c_uchar, c_uint, c_ulong}; + use libc::ssize_t; +-- +2.4.10 + From 8c74d4ce6fbee7b20ae0f748912ced839979b85e Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 13 Dec 2015 01:08:00 -0500 Subject: [PATCH 07/47] rust: update to 1.5.0 --- ...01-platform.mk-avoid-choking-on-i586.patch | 27 ++ ...lt-target.json-path-libdir-rust-targ.patch | 109 ++++++ ...e-RUSTFLAGS-to-override-target-libs-.patch | 67 ++++ ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 ++ ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ++++++++++++++++++ ...cal-workaround-for-NULL-__dso_handle.patch | 25 ++ ...mk-install-use-disable-rewrite-paths.patch | 30 ++ .../0008-install-disable-ldconfig.patch | 28 ++ ...e-crate-metadata-from-symbol-hashing.patch | 28 ++ recipes/rust/rust-1.5.0.inc | 5 + recipes/rust/rust-llvm_1.5.0.bb | 11 + recipes/rust/rust-snapshot-2015-08-11.inc | 14 + recipes/rust/rust_1.5.0.bb | 19 + 13 files changed, 752 insertions(+) create mode 100644 recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch create mode 100644 recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch create mode 100644 recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch create mode 100644 recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch create mode 100644 recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch create mode 100644 recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch create mode 100644 recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch create mode 100644 recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch create mode 100644 recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch create mode 100644 recipes/rust/rust-1.5.0.inc create mode 100644 recipes/rust/rust-llvm_1.5.0.bb create mode 100644 recipes/rust/rust-snapshot-2015-08-11.inc create mode 100644 recipes/rust/rust_1.5.0.bb diff --git a/recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch new file mode 100644 index 0000000..bc4f61b --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch @@ -0,0 +1,27 @@ +From af2eaed835d3b717552ea83e75f4c5e86e614979 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Sat, 15 Nov 2014 20:12:48 -0500 +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 856a22d..0c90632 100644 +--- a/mk/platform.mk ++++ b/mk/platform.mk +@@ -14,7 +14,9 @@ + # would create a variable HOST_i686-darwin-macos with the value + # i386. + define DEF_HOST_VAR +- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) ++ HOST_$(1) = $(subst i686,i386,\ ++ $(subst i586,i386,\ ++ $(word 1,$(subst -, ,$(1))))) + endef + $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) + $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch new file mode 100644 index 0000000..199fe94 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch @@ -0,0 +1,109 @@ +From 632d71477fdecb18852812d86b8e2ee1e33c521b Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 01:40:21 -0500 +Subject: [PATCH 2/9] 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 | 14 +++++++++++--- + 3 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs +index 7e8104d..ecb38d4 100644 +--- a/src/librustc/session/config.rs ++++ b/src/librustc/session/config.rs +@@ -36,7 +36,7 @@ use getopts; + use std::collections::HashMap; + use std::env; + use std::fmt; +-use std::path::PathBuf; ++use std::path::{Path, PathBuf}; + + use llvm; + +@@ -653,8 +653,8 @@ 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[..]) { + Ok(t) => t, + Err(e) => { + sp.handler().fatal(&format!("Error loading target specification: {}", e)); +diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs +index 0a1df25..ad223d5 100644 +--- a/src/librustc/session/mod.rs ++++ b/src/librustc/session/mod.rs +@@ -412,14 +412,18 @@ pub fn build_session_(sopts: config::Options, + local_crate_source_file: Option, + span_diagnostic: diagnostic::SpanHandler) + -> Session { +- let host = match Target::search(config::host_triple()) { ++ let sysroot = match sopts.maybe_sysroot { ++ Some(ref x) => PathBuf::from(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::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 6ae7435..3ffa484 100644 +--- a/src/librustc_back/target/mod.rs ++++ b/src/librustc_back/target/mod.rs +@@ -49,6 +49,8 @@ use serialize::json::Json; + use std::default::Default; + use std::io::prelude::*; + use syntax::{diagnostic, abi}; ++use std::borrow::ToOwned; ++use std::path::Path; + + mod android_base; + mod apple_base; +@@ -346,12 +348,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 { ++ pub fn search(sysroot: &Path, target: &str) -> Result { + use std::env; + use std::ffi::OsString; + use std::fs::File; + use std::path::{Path, PathBuf}; + use serialize::json; ++ use std::iter::IntoIterator; + + fn load_file(path: &Path) -> Result { + let mut f = try!(File::open(path).map_err(|e| e.to_string())); +@@ -447,9 +450,14 @@ impl Target { + let target_path = env::var_os("RUST_TARGET_PATH") + .unwrap_or(OsString::new()); + +- // FIXME 16351: add a sane default search path? ++ 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() { + return load_file(&p); +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch new file mode 100644 index 0000000..a1a4b36 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch @@ -0,0 +1,67 @@ +From b544f5bfa38d5932db23214e168988d05cbc5620 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 14:52:56 -0500 +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 +the place requested by configure, use '-L' and '--sysroot' to point +stage0-rustc at the appropriate location. +--- + mk/main.mk | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/mk/main.mk b/mk/main.mk +index 34f8247..896c1df 100644 +--- a/mk/main.mk ++++ b/mk/main.mk +@@ -376,21 +376,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 +-ifeq ($$(CFG_WINDOWSY_$(3)),1) +-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +-else +-ifeq ($(1),0) +-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib +-else + HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +-endif +-endif + + # Destinations of artifacts for target architectures + TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) + TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin + TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib + ++# Don't trust stage0, be explicit about libraries ++# TODO: rather than specifying sysroot, we really want to tell which libdir to ++# use (ie: the dir containing 'rustlib'). This would allow us to avoid ++# passing the '-L' options. ++ifeq ($(1),0) ++RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ ++ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" ++endif ++ + # Preqrequisites for using the stageN compiler + ifeq ($(1),0) + HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) +@@ -502,6 +503,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)) \ ++ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ + $$(RUSTC_FLAGS_$(2)) + + PERF_STAGE$(1)_T_$(2)_H_$(3) := \ +@@ -510,6 +512,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)) \ ++ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ + $$(RUSTC_FLAGS_$(2)) + + endef +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch new file mode 100644 index 0000000..8985bd1 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch @@ -0,0 +1,27 @@ +From 004ddead436887fe99bfa9d0d25f6cdaf9f6148b Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 18 Nov 2014 13:48:14 -0500 +Subject: [PATCH 4/9] 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 0d527bd..926f247 100644 +--- a/mk/grammar.mk ++++ b/mk/grammar.mk +@@ -11,8 +11,8 @@ + BG = $(CFG_BUILD_DIR)/grammar/ + SG = $(S)src/grammar/ + B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ +-L = $(B)lib/rustlib/$(CFG_BUILD)/lib +-LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ ++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)) + ifeq ($(CFG_OSTYPE),apple-darwin) + FLEX_LDFLAGS=-ll +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch new file mode 100644 index 0000000..5e771f6 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch @@ -0,0 +1,362 @@ +From 1197d6ec82df147e8bbe0d42017fe1ee75804369 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Mon, 24 Nov 2014 13:10:15 -0500 +Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to + non-blessed dirs + +Adds --bindir, and: + +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 assumes absolute paths start with '/', which may break +windows platforms +--- + configure | 49 ++++++++++++++++------ + mk/host.mk | 6 ++- + mk/main.mk | 11 +++++ + mk/perf.mk | 4 +- + mk/prepare.mk | 4 +- + src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- + src/librustc_trans/back/link.rs | 3 +- + 7 files changed, 90 insertions(+), 71 deletions(-) + +diff --git a/configure b/configure +index 60d3661..01c447b 100755 +--- a/configure ++++ b/configure +@@ -334,6 +334,31 @@ enable_if_not_disabled() { + fi + } + ++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 ;; +@@ -632,6 +657,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. +@@ -639,24 +666,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 +- CFG_LIBDIR_RELATIVE=lib + fi + +-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_BINDIR_RELATIVE=bin ++valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" + +-CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` ++# 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}") + + 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 ] +@@ -1733,6 +1757,7 @@ putvar CFG_PREFIX + putvar CFG_HOST + putvar CFG_TARGET + putvar CFG_LIBDIR_RELATIVE ++putvar CFG_BINDIR_RELATIVE + putvar CFG_DISABLE_MANAGE_SUBMODULES + putvar CFG_AARCH64_LINUX_ANDROID_NDK + putvar CFG_ARM_LINUX_ANDROIDEABI_NDK +diff --git a/mk/host.mk b/mk/host.mk +index 59a0095..b8e8345 100644 +--- a/mk/host.mk ++++ b/mk/host.mk +@@ -59,9 +59,13 @@ endef + # $(4) - the host triple (same as $(3)) + define CP_HOST_STAGE_N + +-ifneq ($(CFG_LIBDIR_RELATIVE),bin) + $$(HLIB$(2)_H_$(4))/: + @mkdir -p $$@ ++ ++# Avoid redefinition warnings if libdir==bindir ++ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) ++$$(HBIN$(2)_H_$(4))/: ++ @mkdir -p $$@ + endif + + endef +diff --git a/mk/main.mk b/mk/main.mk +index 896c1df..ab12166 100644 +--- a/mk/main.mk ++++ b/mk/main.mk +@@ -345,7 +345,9 @@ export CFG_RELEASE_CHANNEL + export CFG_LLVM_ROOT + export CFG_PREFIX + export CFG_LIBDIR ++export CFG_BINDIR + export CFG_LIBDIR_RELATIVE ++export CFG_BINDIR_RELATIVE + export CFG_DISABLE_INJECT_STD_VERSION + ifdef CFG_DISABLE_UNSTABLE_FEATURES + CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) +@@ -375,7 +377,16 @@ define SREQ + + # Destinations of artifacts for the host compiler + HROOT$(1)_H_$(3) = $(3)/stage$(1) ++ ++ifeq ($(1)-$(3),0-$$(CFG_BUILD)) ++# stage0 relative paths are fixed so we can bootstrap from snapshots ++# (downloaded snapshots drop their rustc in HROOT/bin) ++# libdir discrepancy is worked around with RUSTFLAGS below. + HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin ++else ++HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) ++endif ++ + HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) + + # Destinations of artifacts for target architectures +diff --git a/mk/perf.mk b/mk/perf.mk +index 16cbaab..f8a354c 100644 +--- a/mk/perf.mk ++++ b/mk/perf.mk +@@ -10,13 +10,13 @@ + + + ifdef CFG_PERF_TOOL +-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) ++rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) + @$(call E, perf compile: $@) + $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ + -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 + $(Q)rm -f $(LIBRUSTC_GLOB) + else +-rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) ++rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) + $(Q)touch $@ + endif + +diff --git a/mk/prepare.mk b/mk/prepare.mk +index e263a6d..45590ab 100644 +--- a/mk/prepare.mk ++++ b/mk/prepare.mk +@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ + define DEF_PREPARE + + prepare-base-$(1)-%: PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) +-prepare-base-$(1)-%: PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin ++prepare-base-$(1)-%: PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) + prepare-base-$(1)-%: PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) + prepare-base-$(1)-%: PREPARE_SOURCE_MAN_DIR=$$(S)/man +-prepare-base-$(1)-%: PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin ++prepare-base-$(1)-%: PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) + prepare-base-$(1)-%: PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) + prepare-base-$(1)-%: PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1 + +diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs +index 311ab1c..1b03b1a 100644 +--- a/src/librustc/metadata/filesearch.rs ++++ b/src/librustc/metadata/filesearch.rs +@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { + if !found { + let rustpath = rust_path(); + 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)); + +@@ -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 { + let mut p = PathBuf::from(self.sysroot); +- p.push(&find_libdir(self.sysroot)); ++ p.push(libdir_str()); + p.push(&rustlibdir()); + p.push(&self.triple); + p.push("bin"); +@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { + } + } + +-pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { +- let mut p = PathBuf::from(&find_libdir(sysroot)); ++pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { ++ let mut p = PathBuf::from(&libdir_str()); + assert!(p.is_relative()); + p.push(&rustlibdir()); + p.push(target_triple); +@@ -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 { +- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) ++ sysroot.join(&relative_target_lib_path(target_triple)) + } + +-fn make_rustpkg_lib_path(sysroot: &Path, +- dir: &Path, ++fn make_rustpkg_lib_path(dir: &Path, + triple: &str) -> PathBuf { +- let mut p = dir.join(&find_libdir(sysroot)); ++ let mut p = dir.join(libdir_str()); + p.push(triple); + p + } + ++pub fn bindir_relative_str() -> &'static str { ++ env!("CFG_BINDIR_RELATIVE") ++} ++ ++pub fn bindir_relative_path() -> PathBuf { ++ 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) -> Option { +@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { + } + + match canonicalize(env::current_exe().ok()) { +- Some(mut p) => { p.pop(); p.pop(); p } ++ Some(mut p) => { ++ // 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() { ++ p.pop(); ++ } ++ p ++ } + None => panic!("can't determine value for sysroot") + } + } +@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { + env_rust_path + } + +-// The name of the directory rustc expects libraries to be located. +-// On Unix should be "lib", on windows "bin" +-#[cfg(unix)] +-fn find_libdir(sysroot: &Path) -> String { +- // FIXME: This is a quick hack to make the rustc binary able to locate +- // Rust libraries in Linux environments where libraries might be installed +- // to lib64/lib32. This would be more foolproof by basing the sysroot off +- // of the directory where librustc is located, rather than where the rustc +- // binary is. +- //If --libdir is set during configuration to the value other than +- // "lib" (i.e. non-default), this value is used (see issue #16552). +- +- match option_env!("CFG_LIBDIR_RELATIVE") { +- Some(libdir) if libdir != "lib" => return libdir.to_string(), +- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { +- return primary_libdir_name(); +- } else { +- return secondary_libdir_name(); +- } +- } +- +- #[cfg(target_pointer_width = "64")] +- fn primary_libdir_name() -> String { +- "lib64".to_string() +- } +- +- #[cfg(target_pointer_width = "32")] +- fn primary_libdir_name() -> String { +- "lib32".to_string() +- } +- +- fn secondary_libdir_name() -> String { +- "lib".to_string() +- } +-} +- +-#[cfg(windows)] +-fn find_libdir(_sysroot: &Path) -> String { +- "bin".to_string() +-} +- + // 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 6171ff1..32f41ff 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -1033,11 +1033,10 @@ fn link_args(cmd: &mut Linker, + // 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 mut 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); + let mut path = PathBuf::from(install_prefix); + path.push(&tlib); + +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch new file mode 100644 index 0000000..86112e5 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch @@ -0,0 +1,25 @@ +From 68662f758244a476b64b0772d93c7a1731e9d1ad Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Wed, 3 Dec 2014 19:15:19 -0500 +Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle + +--- + src/libstd/thread/local.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs +index c204f79..b2f6f1d 100644 +--- a/src/libstd/thread/local.rs ++++ b/src/libstd/thread/local.rs +@@ -338,7 +338,7 @@ mod imp { + #[linkage = "extern_weak"] + static __cxa_thread_atexit_impl: *const libc::c_void; + } +- if !__cxa_thread_atexit_impl.is_null() { ++ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { + type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), + arg: *mut u8, + dso_handle: *mut u8) -> libc::c_int; +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch new file mode 100644 index 0000000..94cf932 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch @@ -0,0 +1,30 @@ +From be3663fcd9ae11a207b3c1649917bfff3c69b1c4 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Mon, 2 Mar 2015 13:34:59 -0500 +Subject: [PATCH 7/9] mk/install: use disable-rewrite-paths + +This stops the install scripts from doing work we've already handled. + +Path rewriting is only useful for prepackaged binary installers. +--- + mk/install.mk | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/mk/install.mk b/mk/install.mk +index 8b81702..4fed072 100644 +--- a/mk/install.mk ++++ b/mk/install.mk +@@ -12,7 +12,9 @@ RUN_INSALLER = cd tmp/empty_dir && \ + sh ../../tmp/dist/$(1)/install.sh \ + --prefix="$(DESTDIR)$(CFG_PREFIX)" \ + --libdir="$(DESTDIR)$(CFG_LIBDIR)" \ +- --mandir="$(DESTDIR)$(CFG_MANDIR)" ++ --mandir="$(DESTDIR)$(CFG_MANDIR)" \ ++ "$(MAYBE_DISABLE_VERIFY)" ++ --disable-rewrite-paths + + install: + ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER))) +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch new file mode 100644 index 0000000..e5cb052 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch @@ -0,0 +1,28 @@ +From d7aa5e6824e8658c01f702259eebac02553fb7b8 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Tue, 26 May 2015 12:09:36 -0400 +Subject: [PATCH 8/9] install: disable ldconfig + +--- + mk/install.mk | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/mk/install.mk b/mk/install.mk +index 4fed072..92e66cd 100644 +--- a/mk/install.mk ++++ b/mk/install.mk +@@ -13,8 +13,9 @@ RUN_INSALLER = cd tmp/empty_dir && \ + --prefix="$(DESTDIR)$(CFG_PREFIX)" \ + --libdir="$(DESTDIR)$(CFG_LIBDIR)" \ + --mandir="$(DESTDIR)$(CFG_MANDIR)" \ +- "$(MAYBE_DISABLE_VERIFY)" +- --disable-rewrite-paths ++ "$(MAYBE_DISABLE_VERIFY)" \ ++ --disable-rewrite-paths \ ++ --disable-ldconfig + + install: + ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER))) +-- +2.4.10 + diff --git a/recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch new file mode 100644 index 0000000..d1d798b --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch @@ -0,0 +1,28 @@ +From e6888f9b888911bdbd52e2ee7c37914ee4cee0e2 Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Tue, 7 Jul 2015 14:57:42 -0400 +Subject: [PATCH 9/9] Remove crate metadata from symbol hashing + +--- + src/librustc_trans/back/link.rs | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index 32f41ff..2a87cd7 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -212,11 +212,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, + symbol_hasher.reset(); + symbol_hasher.input_str(&link_meta.crate_name); + symbol_hasher.input_str("-"); +- symbol_hasher.input_str(link_meta.crate_hash.as_str()); +- for meta in tcx.sess.crate_metadata.borrow().iter() { +- symbol_hasher.input_str(&meta[..]); +- } +- symbol_hasher.input_str("-"); + symbol_hasher.input(&encoder::encoded_ty(tcx, t)); + // Prefix with 'h' so that it never blends into adjacent digits + let mut hash = String::from("h"); +-- +2.4.10 + diff --git a/recipes/rust/rust-1.5.0.inc b/recipes/rust/rust-1.5.0.inc new file mode 100644 index 0000000..117b8b8 --- /dev/null +++ b/recipes/rust/rust-1.5.0.inc @@ -0,0 +1,5 @@ +SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485" +SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" + +require rust-snapshot-2015-08-11.inc diff --git a/recipes/rust/rust-llvm_1.5.0.bb b/recipes/rust/rust-llvm_1.5.0.bb new file mode 100644 index 0000000..f1e2660 --- /dev/null +++ b/recipes/rust/rust-llvm_1.5.0.bb @@ -0,0 +1,11 @@ +require rust-release.inc +require rust-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" + +do_install_append () { + cd "${B}" + install -d "${D}${bindir}" + install -m755 "Release/bin/FileCheck" "${D}${bindir}" +} diff --git a/recipes/rust/rust-snapshot-2015-08-11.inc b/recipes/rust/rust-snapshot-2015-08-11.inc new file mode 100644 index 0000000..ff1c466 --- /dev/null +++ b/recipes/rust/rust-snapshot-2015-08-11.inc @@ -0,0 +1,14 @@ +## snapshot info taken from rust/src/snapshots.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_DATE = "2015-08-11" +RS_SRCHASH = "1af31d4" +# linux-x86_64 +RS_ARCH = "linux-x86_64" +RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f" + +RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" + +SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283" +SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3" + diff --git a/recipes/rust/rust_1.5.0.bb b/recipes/rust/rust_1.5.0.bb new file mode 100644 index 0000000..2a2fdca --- /dev/null +++ b/recipes/rust/rust_1.5.0.bb @@ -0,0 +1,19 @@ +require rust-release.inc +require rust.inc +require rust-${PV}.inc + +# "patch-prefix" +PP = "rust-${PV}" +SRC_URI_append = "\ + file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ + file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ + file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ + file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ + file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ + file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ + file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ + file://${PP}/0008-install-disable-ldconfig.patch \ + file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ +\ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ +" From bb5c2042a9eacf10a67f149bf42706b9eee15a71 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 13 Dec 2015 01:22:10 -0500 Subject: [PATCH 08/47] update libgit2 to 0.23.4 --- recipes-deps/libgit2/{libgit2_0.23.2.bb => libgit2_0.23.4.bb} | 3 --- 1 file changed, 3 deletions(-) rename recipes-deps/libgit2/{libgit2_0.23.2.bb => libgit2_0.23.4.bb} (75%) diff --git a/recipes-deps/libgit2/libgit2_0.23.2.bb b/recipes-deps/libgit2/libgit2_0.23.4.bb similarity index 75% rename from recipes-deps/libgit2/libgit2_0.23.2.bb rename to recipes-deps/libgit2/libgit2_0.23.4.bb index c0b5be7..1da7f59 100644 --- a/recipes-deps/libgit2/libgit2_0.23.2.bb +++ b/recipes-deps/libgit2/libgit2_0.23.4.bb @@ -5,6 +5,3 @@ SRC_URI[md5sum] = "ade3b85d759866c03b6188e397b652fa" SRC_URI[sha256sum] = "20c0a6ee92c0e19207dac6ddc336b4ae4a1c4ddf91be0891e4b6e6ccba16df0b" require libgit2-release.inc - -# Broken due to too old cargo using too old git2-rs -DEFAULT_PREFERENCE = "-1" From 82238846e4b98ce7f63e47a13f877620468e3459 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 13 Dec 2015 01:23:30 -0500 Subject: [PATCH 09/47] rust 1.4.0: use snapshot include --- recipes/rust/rust-1.4.0.inc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/recipes/rust/rust-1.4.0.inc b/recipes/rust/rust-1.4.0.inc index 0a56879..cb7b053 100644 --- a/recipes/rust/rust-1.4.0.inc +++ b/recipes/rust/rust-1.4.0.inc @@ -1,19 +1,5 @@ SRC_URI[rust.md5sum] = "53907e4b819872bd256df8edc0d9f064" SRC_URI[rust.sha256sum] = "1c0dfdce5c85d8098fcebb9adf1493847ab40c1dfaa8cc997af09b2ef0aa8211" - -## snapshot info taken from rust/src/snapshots.txt -## TODO: find a way to add additional SRC_URIs based on the contents of an -## earlier SRC_URI. -RS_DATE = "2015-08-11" -RS_SRCHASH = "1af31d4" -# linux-x86_64 -RS_ARCH = "linux-x86_64" -RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f" - -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "53b2e1f553eaeb88e8d60d5380670283" -SRC_URI[rust-snapshot.sha256sum] = "5936f5ec4327d41f3aa9f98cbedebb6fd3d72715f8df578e0c9a669154c80bc3" - - LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" + +require rust-snapshot-2015-08-11.inc From 6f9559d152347e1a7911893c8c6dce4259798149 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sun, 13 Dec 2015 21:44:55 -0500 Subject: [PATCH 10/47] deps/libgit2: actually update, and disable libgit2_git --- recipes-deps/libgit2/libgit2_0.23.4.bb | 7 ++----- recipes-deps/libgit2/libgit2_git.bb | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/recipes-deps/libgit2/libgit2_0.23.4.bb b/recipes-deps/libgit2/libgit2_0.23.4.bb index 1da7f59..2a4d156 100644 --- a/recipes-deps/libgit2/libgit2_0.23.4.bb +++ b/recipes-deps/libgit2/libgit2_0.23.4.bb @@ -1,7 +1,4 @@ - LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2" - -SRC_URI[md5sum] = "ade3b85d759866c03b6188e397b652fa" -SRC_URI[sha256sum] = "20c0a6ee92c0e19207dac6ddc336b4ae4a1c4ddf91be0891e4b6e6ccba16df0b" - +SRC_URI[md5sum] = "b7db3ab71dfa19fe1dc7fef76d6af216" +SRC_URI[sha256sum] = "c7f5e2d7381dbc4d7e878013d14f9993ae8a41bd23f032718e39ffba57894029" require libgit2-release.inc diff --git a/recipes-deps/libgit2/libgit2_git.bb b/recipes-deps/libgit2/libgit2_git.bb index efb5610..d8c4c5d 100644 --- a/recipes-deps/libgit2/libgit2_git.bb +++ b/recipes-deps/libgit2/libgit2_git.bb @@ -1,3 +1,4 @@ require libgit2-git.inc SRCREV ?= "47f37400253210f483d84fb9c2ecf44fb5986849" LIC_FILES_CHKSUM = "file://COPYING;md5=5ddd5fb64b24982b32a490dccccdabc5" +DEFAULT_PREFERENCE = "-1" From 0ed55291b65d84c68c270b397c1e7815f4d13629 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Tue, 26 Jan 2016 17:11:25 -0500 Subject: [PATCH 11/47] cargo: relocate config files to avoid clobber --- classes/cargo.bbclass | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 598bdea..254e5b3 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -31,19 +31,19 @@ export PKG_CONFIG_ALLOW_CROSS = "1" EXTRA_OECARGO_PATHS ??= "" cargo_do_configure () { - mkdir -p .cargo - # FIXME: we currently blow away the entire config because duplicate - # sections are treated as a parse error by cargo (causing the entire - # config to be silently ignored. + # FIXME: we currently make a mess in the directory above us + # (${WORKDIR}), which may not be ideal. Look into whether this is + # allowed + mkdir -p ../.cargo # NOTE: we cannot pass more flags via this interface, the 'linker' is # assumed to be a path to a binary. If flags are needed, a wrapper must # be used. - echo "paths = [" >.cargo/config + echo "paths = [" >../.cargo/config for p in ${EXTRA_OECARGO_PATHS}; do printf "\"%s\"\n" "$p" - done | sed -e 's/$/,/' >>.cargo/config - echo "]" >>.cargo/config + done | sed -e 's/$/,/' >>../.cargo/config + echo "]" >>../.cargo/config } rust_cargo_patch () { From b5058823f220ecdf5cb1b0b1e73a9d12b306b3fe Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 29 Jan 2016 14:58:26 +0000 Subject: [PATCH 12/47] rust.inc: add missing dependency on file-native --- recipes/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 2e2efc7..288e2f5 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -8,6 +8,7 @@ LICENSE = "MIT | Apache-2.0" B = "${WORKDIR}/build" +DEPENDS += "file-native" DEPENDS += "rust-llvm" # Avoid having the default bitbake.conf disable sub-make parallelization From 9c571225f2632ec8c284caa9b4589749d93c21d4 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 29 Jan 2016 15:09:00 +0000 Subject: [PATCH 13/47] libudev: add recipes for latest releases of libudev-{rs,sys} --- recipes-core/udev/libudev-rs_0.1.2.bb | 22 ++++++++++++++++++++++ recipes-core/udev/libudev-sys-rs_0.1.3.bb | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 recipes-core/udev/libudev-rs_0.1.2.bb create mode 100644 recipes-core/udev/libudev-sys-rs_0.1.3.bb diff --git a/recipes-core/udev/libudev-rs_0.1.2.bb b/recipes-core/udev/libudev-rs_0.1.2.bb new file mode 100644 index 0000000..c59346e --- /dev/null +++ b/recipes-core/udev/libudev-rs_0.1.2.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "FFI bindings to libudev" +HOMEPAGE = "https://github.com/dcuddeback/libudev-sys" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3" + +DEPENDS += "libudev-sys-rs" +DEPENDS += "libc-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/dcuddeback/libudev-rs.git;protocol=https" +SRCREV = "3da791245f206d0cf5a856531c574b8646b0f059" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} diff --git a/recipes-core/udev/libudev-sys-rs_0.1.3.bb b/recipes-core/udev/libudev-sys-rs_0.1.3.bb new file mode 100644 index 0000000..d61fd82 --- /dev/null +++ b/recipes-core/udev/libudev-sys-rs_0.1.3.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "FFI bindings to libudev" +HOMEPAGE = "https://github.com/dcuddeback/libudev-sys" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3" +DEPENDS = "libc-rs udev" + +inherit rust-bin + +SRC_URI = "git://github.com/dcuddeback/libudev-sys.git;protocol=https" +SRCREV = "c49163f87d4d109ec21bcf8f8c51db560ed31b22" + +S = "${WORKDIR}/git" + +RUSTC_FLAGS += "-ludev" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 1c1819971e3b0c6ca21852611e7b3b8cde87e21b Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:49:49 -0400 Subject: [PATCH 14/47] Add rustc-serialize crate --- .../rustc-serialize-rs_0.3.15.bb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb diff --git a/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb new file mode 100644 index 0000000..87835dc --- /dev/null +++ b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Generic serialization/deserialization support" +HOMEPAGE = "https://github.com/rust-lang/rustc-serialize" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ +" + +inherit rust-bin + +SRC_URI = "git://github.com/rust-lang/rustc-serialize.git;protocol=https" +SRCREV = "376f43a4b94dbe411bd9534ab83f02fbcb5a3b04" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From fa0d333237be1ebfbc7257f5c588800b3cc450b1 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:58:20 -0400 Subject: [PATCH 15/47] Add debug-builders crate --- .../debug-builders/debug-builders-rs_0.1.0.bb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 recipes-core/debug-builders/debug-builders-rs_0.1.0.bb diff --git a/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb b/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb new file mode 100644 index 0000000..7c82bc5 --- /dev/null +++ b/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb @@ -0,0 +1,19 @@ +DESCRIPTION = "A copy of libstd's debug builders for use before they stabilize" +HOMEPAGE = "https://github.com/sfackler/rust-debug-builders" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "file://Cargo.toml;md5=97a131dc4ae910d242387f2c9d1a2ce8" + +inherit rust-bin + +SRC_URI = "git://github.com/sfackler/rust-debug-builders.git;protocol=https" +SRCREV = "c6943b72c7808ddaa151d08b824525cc7420cb9b" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From b516012a462b9c3b371ecf0f5c89c333367fe3c7 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:59:44 -0400 Subject: [PATCH 16/47] Add unix-socket crate --- .../unix-socket/unix-socket-rs_0.4.3.bb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 recipes-core/unix-socket/unix-socket-rs_0.4.3.bb diff --git a/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb b/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb new file mode 100644 index 0000000..3485c3f --- /dev/null +++ b/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Unix domain socket bindings for Rust" +HOMEPAGE = "https://github.com/sfackler/rust-unix-socket" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bde86283c1fd74e84ebc3cf6dd7011d0" +DEPENDS = "libc-rs debug-builders-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/sfackler/rust-unix-socket.git;protocol=https" +SRCREV = "d0f47ae888267a718072c3be5eed42ba1f637097" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 232d100c091596828c4edb2da1f4568e4189bb2b Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 16:44:02 -0400 Subject: [PATCH 17/47] Add rand crate --- classes/rust-bin.bbclass | 1 + recipes-core/rand/rand-rs_0.3.8.bb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 recipes-core/rand/rand-rs_0.3.8.bb diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index a9195bf..c663100 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -19,6 +19,7 @@ OVERLAP_LIBS = "\ libc \ log \ getopts \ + rand \ " def get_overlap_deps(d): deps = d.getVar("DEPENDS").split() diff --git a/recipes-core/rand/rand-rs_0.3.8.bb b/recipes-core/rand/rand-rs_0.3.8.bb new file mode 100644 index 0000000..566cac9 --- /dev/null +++ b/recipes-core/rand/rand-rs_0.3.8.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "Random number generators and other randomness functionality." +HOMEPAGE = "https://github.com/rust-lang/rand" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ +" +DEPENDS = "libc-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/rust-lang/rand.git;protocol=https" +SRCREV = "164659b01e6fdb4d9a8e52b7a7451e8174e91821" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 9fac435f1c0cc5f920799f4f3c01af9547daf539 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 16:44:56 -0400 Subject: [PATCH 18/47] Add crypto crate --- recipes-core/crypto/crypto-rs_0.2.31.bb | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 recipes-core/crypto/crypto-rs_0.2.31.bb diff --git a/recipes-core/crypto/crypto-rs_0.2.31.bb b/recipes-core/crypto/crypto-rs_0.2.31.bb new file mode 100644 index 0000000..76c7a6d --- /dev/null +++ b/recipes-core/crypto/crypto-rs_0.2.31.bb @@ -0,0 +1,28 @@ +DESCRIPTION = "A (mostly) pure-Rust implementation of various common cryptographic algorithms." +HOMEPAGE = "https://github.com/DaGenix/rust-crypto/" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=4311034aa04489226c1fc3f816dbfb5a \ + file://LICENSE-APACHE;md5=a02fef6dccf840318474c108a8281b77 \ +" +DEPENDS = "\ + libc-rs \ + time-rs \ + rand-rs \ + rustc-serialize-rs \ +" + +inherit rust-bin + +SRC_URI = "git://github.com/DaGenix/rust-crypto.git;protocol=https" +SRCREV = "5571cb41690b9cee12025192393ea7df0eddc21b" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From fc0e2f74b348080afb4169be4bdb061f04eaf5ed Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 18:48:28 -0400 Subject: [PATCH 19/47] libc: use common build functions and create dylib Working around "error: cannot satisfy dependencies so `libc` only shows up once." --- recipes-core/libc/libc-rs_0.1.8.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes-core/libc/libc-rs_0.1.8.bb b/recipes-core/libc/libc-rs_0.1.8.bb index b9c808f..a1ee5b5 100644 --- a/recipes-core/libc/libc-rs_0.1.8.bb +++ b/recipes-core/libc/libc-rs_0.1.8.bb @@ -15,10 +15,12 @@ SRCREV = "8b7c17db2235a2a3f2c71242b11fc429a8d05a90" S = "${WORKDIR}/git" +LIB_SRC = "${S}/src/liblibc/lib.rs" + do_compile () { - oe_runrustc ${S}/src/liblibc/lib.rs --cfg feature='"cargo-build"' + oe_compile_rust_lib --cfg feature='"cargo-build"' } do_install () { - install -D -m 644 liblibc.rlib ${D}/${rustlibdir}/liblibc.rlib + oe_install_rust_lib } From 84bacaaf21efc6bd681a401feb6206e4c6b7fbbf Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Thu, 25 Jun 2015 17:59:21 -0400 Subject: [PATCH 20/47] time-rs: compile native helper C code --- recipes-core/time/time-rs_0.1.26.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes-core/time/time-rs_0.1.26.bb b/recipes-core/time/time-rs_0.1.26.bb index 40c9a64..76ca2f5 100644 --- a/recipes-core/time/time-rs_0.1.26.bb +++ b/recipes-core/time/time-rs_0.1.26.bb @@ -15,7 +15,10 @@ SRCREV = "32b212b877b836dbfdc97af5674d91672e70ecbd" S = "${WORKDIR}/git" do_compile () { - oe_compile_rust_lib + rm -rf time_helpers.o libtimehelpers.a + ${CC} ${S}/src/time_helpers.c -fPIC -c -o time_helpers.o + ${AR} rcs libtime_helpers.a time_helpers.o + oe_compile_rust_lib -L native=$PWD -l static=time_helpers } do_install () { From 34c36492db6f29429d5ded3c5001de611f6e65ef Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 7 Aug 2015 13:39:49 -0400 Subject: [PATCH 21/47] Don't build any rlibs I've seen this error from the compiler: found possibly newer version of crate `regex_syntax` which `env_logger` depends on This is probably because the rlib hashes are not deterministic, but I can't reproduce non-deterministic hashes locally. There have been lots of other types of errors caused by mixing rlibs and dylibs in the same dependency chain, so let's try using only dylibs until that's stable. --- recipes-core/memchr/memchr-rs_0.1.3.bb | 3 --- recipes-core/regex/regex-syntax-rs.bb | 2 -- recipes-core/udev/libudev-sys-rs_0.1.1.bb | 1 - 3 files changed, 6 deletions(-) diff --git a/recipes-core/memchr/memchr-rs_0.1.3.bb b/recipes-core/memchr/memchr-rs_0.1.3.bb index e0e61f0..b216cfd 100644 --- a/recipes-core/memchr/memchr-rs_0.1.3.bb +++ b/recipes-core/memchr/memchr-rs_0.1.3.bb @@ -11,9 +11,6 @@ SRCREV = "a91e63378bf6f4bba5c7d88f4fe98efdcb432c99" S = "${WORKDIR}/git" -# This module is tiny. One wrapper function only. -CRATE_TYPE = "rlib" - do_compile () { oe_compile_rust_lib } diff --git a/recipes-core/regex/regex-syntax-rs.bb b/recipes-core/regex/regex-syntax-rs.bb index 56ed2a3..9d440ba 100644 --- a/recipes-core/regex/regex-syntax-rs.bb +++ b/recipes-core/regex/regex-syntax-rs.bb @@ -2,6 +2,4 @@ DESCRIPTION = "A regular expression parser" require regex.inc -# Should only be used directly by regex -CRATE_TYPE = "rlib" LIB_SRC = "${S}/regex-syntax/src/lib.rs" diff --git a/recipes-core/udev/libudev-sys-rs_0.1.1.bb b/recipes-core/udev/libudev-sys-rs_0.1.1.bb index b2e0faa..e87a219 100644 --- a/recipes-core/udev/libudev-sys-rs_0.1.1.bb +++ b/recipes-core/udev/libudev-sys-rs_0.1.1.bb @@ -12,7 +12,6 @@ SRCREV = "14c24afc61e3315dffddab2c7f36999a16a002d8" S = "${WORKDIR}/git" RUSTC_FLAGS += "-ludev" -CRATE_TYPE = "rlib" do_compile () { oe_compile_rust_lib From 302cca7529be776a07f3ad0ed00e2e0e5603a082 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Tue, 28 Jul 2015 09:20:10 -0400 Subject: [PATCH 22/47] rust-bin.bbclass: suffix rust libraries with -rs Rust library names may have sonames that overlap with C/C++ libraries. This causes bitbake to not be able to create the correct automatic RDEPENDS between packages. The result is that dependencies may not get automatically installed. Add -rs to the file name and soname. The crate name remains the same, and rust is not dependent on the file name to look up the crate inside the library. --- classes/rust-bin.bbclass | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index c663100..e062fc5 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -38,7 +38,7 @@ RUSTC_FLAGS += "-C prefer-dynamic" rustlib="${libdir}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}" BINNAME ?= "${BPN}" -LIBNAME ?= "lib${CRATE_NAME}" +LIBNAME ?= "lib${CRATE_NAME}-rs" CRATE_TYPE ?= "dylib" BIN_SRC ?= "${S}/src/main.rs" LIB_SRC ?= "${S}/src/lib.rs" @@ -46,7 +46,7 @@ LIB_SRC ?= "${S}/src/lib.rs" get_overlap_externs () { externs= for dep in ${OVERLAP_DEPS}; do - extern=$(ls ${STAGING_DIR_HOST}/${rustlibdir}/lib$dep.{so,rlib} 2>/dev/null \ + extern=$(ls ${STAGING_DIR_HOST}/${rustlibdir}/lib$dep-rs.{so,rlib} 2>/dev/null \ | awk '{print $1}'); if [ -n "$extern" ]; then externs="$externs --extern $dep=$extern" @@ -59,15 +59,17 @@ get_overlap_externs () { } oe_compile_rust_lib () { + [ "${CRATE_TYPE}" == "dylib" ] && suffix=so || suffix=rlib rm -rf ${LIBNAME}.{rlib,so} local -a link_args if [ "${CRATE_TYPE}" == "dylib" ]; then link_args[0]="-C" - link_args[1]="link-args=-Wl,-soname -Wl,${LIBNAME}.so" + link_args[1]="link-args=-Wl,-soname -Wl,${LIBNAME}.$suffix" fi oe_runrustc $(get_overlap_externs) \ "${link_args[@]}" \ ${LIB_SRC} \ + -o ${LIBNAME}.$suffix \ --crate-name=${CRATE_NAME} --crate-type=${CRATE_TYPE} \ "$@" } From 63cf611e65c2db61be692d57ec1c8b1501b574c1 Mon Sep 17 00:00:00 2001 From: Dan Dedrick Date: Tue, 28 Jul 2015 15:32:33 -0400 Subject: [PATCH 23/47] rust-bin.bbclass: update path to cross output poky 1.7 changes where it publishes cross output to so this recipe needs to follow that. Unfortunately this path is defined in cross.bbclass and we can't inherit that since we aren't cross. --- classes/rust-bin.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index e062fc5..88071d5 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -35,7 +35,7 @@ OVERLAP_DEPS = "${@get_overlap_deps(d)}" # See https://github.com/rust-lang/rust/issues/19680 RUSTC_FLAGS += "-C prefer-dynamic" -rustlib="${libdir}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +rustlib="${libdir}/${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}" BINNAME ?= "${BPN}" LIBNAME ?= "lib${CRATE_NAME}-rs" From ebe7fb0d8fd532726b59510a9996a69ffb76b93e Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Thu, 27 Aug 2015 13:33:37 -0400 Subject: [PATCH 24/47] rust-bin.bbclass: look for RUNPATH instead of RPATH Poky 1.7 uses RPATH is now RUNPATH, so update our grep string appropriately. Additionally, bitbake is having trouble with the automatic RDEPENDS on rustlib. Make it explicit for now. --- classes/rust-bin.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index 88071d5..de8fbad 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -2,6 +2,7 @@ inherit rust RUSTLIB_DEP ?= " rustlib" DEPENDS .= "${RUSTLIB_DEP}" +RDEPENDS_${PN} .= "${RUSTLIB_DEP}" DEPENDS += "patchelf-native" export rustlibdir = "${libdir}/rust" @@ -101,7 +102,7 @@ do_rust_bin_fixups() { for f in `find ${PKGD}`; do file "$f" | grep -q ELF || continue - readelf -d "$f" | grep RPATH | grep -q rustlib || continue + readelf -d "$f" | grep RUNPATH | grep -q rustlib || continue echo "Set rpath:" "$f" patchelf --set-rpath '$ORIGIN:'${rustlibdir}:${rustlib} "$f" done From 45d77b849f8c51dbebf43f87aff217a7b5219666 Mon Sep 17 00:00:00 2001 From: Wes Lindauer Date: Mon, 2 Nov 2015 10:25:52 -0500 Subject: [PATCH 25/47] rust-bin.bbclass: Add empty do_configure This prevents rust recipes that are missing clean rules from failing when they are rebuilt. --- classes/rust-bin.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index de8fbad..8a0f7af 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -59,6 +59,9 @@ get_overlap_externs () { echo "$externs" } +do_configure () { +} + oe_compile_rust_lib () { [ "${CRATE_TYPE}" == "dylib" ] && suffix=so || suffix=rlib rm -rf ${LIBNAME}.{rlib,so} From aaaeaeed3f99ee2e9267da2f2db145fad0642c88 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 8 Jan 2016 16:16:26 -0500 Subject: [PATCH 26/47] rustlib: libdir may be different between build and host With multilib, we may want to install under lib64 but the rust libraries get published in the build sysroot under the libdir for the build machine which is usually just lib. Support these being different. --- classes/rust-bin.bbclass | 6 +++++- recipes/rust/rustlib.bb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index 8a0f7af..4221fed 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -36,7 +36,11 @@ OVERLAP_DEPS = "${@get_overlap_deps(d)}" # See https://github.com/rust-lang/rust/issues/19680 RUSTC_FLAGS += "-C prefer-dynamic" -rustlib="${libdir}/${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +# Native sysroot standard library path +rustlib_src="${prefix}/lib/${rustlib_suffix}" +# Host sysroot standard library path +rustlib="${libdir}/${rustlib_suffix}" CRATE_NAME ?= "${@d.getVar('BPN', True).replace('-rs', '').replace('-', '_')}" BINNAME ?= "${BPN}" LIBNAME ?= "lib${CRATE_NAME}-rs" diff --git a/recipes/rust/rustlib.bb b/recipes/rust/rustlib.bb index ae05dfd..9c8beda 100644 --- a/recipes/rust/rustlib.bb +++ b/recipes/rust/rustlib.bb @@ -9,7 +9,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}rust" RUSTLIB_DEP = "" do_install () { - for f in ${STAGING_DIR_NATIVE}/${rustlib}/*.so; do + for f in ${STAGING_DIR_NATIVE}/${rustlib_src}/*.so; do echo Installing $f install -D -m 755 $f ${D}/${rustlib}/$(basename $f) done From 483334f02b3b231854719048a6bd26ebc99e970e Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 8 Jan 2016 16:17:46 -0500 Subject: [PATCH 27/47] rust: aarch64 support --- classes/rust.bbclass | 2 ++ recipes/rust/rust.inc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/classes/rust.bbclass b/classes/rust.bbclass index 6535131..7b71197 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -33,6 +33,8 @@ def rust_base_triple(d, thing): if arch.startswith("arm"): if os.endswith("gnueabi"): os += bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hf', '', d) + elif arch.startswith("aarch64"): + os = "linux-gnu" elif arch.startswith("x86_64"): os = "linux-gnu" elif arch.startswith("i586"): diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 288e2f5..1919136 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -37,6 +37,12 @@ TARGET_POINTER_WIDTH[arm] = "32" FEATURES[arm] = "+v6,+vfp2" PRE_LINK_ARGS[arm] = "-Wl,--as-needed" +DATA_LAYOUT[aarch64] = "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-n32:64-S128" +LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" +TARGET_ENDIAN[aarch64] = "little" +TARGET_POINTER_WIDTH[aarch64] = "64" +PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" + ## x86_64-unknown-linux-gnu DATA_LAYOUT[x86_64] = "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] = "x86_64-unknown-linux-gnu" From 0ade0cc790ac12fa2096ec36848b86ba070657ca Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Sun, 28 Jun 2015 19:30:39 -0400 Subject: [PATCH 28/47] Fix prelink issue breaking .bss The reason prelink seemed to break relocations in .bss is because the .note.rustc section happened to be placed in front of .bss. Using objcopy to strip the note renumbered the sections and the symbols in the .dynsym section were pointing to the wrong section index, but only for .bss. Prelink would skip updating these dyn entries because it thought they were pointing to a section that didn't get relocated, like .comment. In some cases the GOT was actually prelinked correctly, but the dynamic linker at run time would modify it to point at the non-prelinked address. Removing the SHF_ALLOC flag from the section causes it to be placed at the end of the executable where it can be safely removed. This is still a hack to the compiler because I couldn't find any way to get the section attributes to be correct using the high-level LLVM interface. --- ...-.note.rustc-look-more-like-debug-in.patch | 158 ++++++++++++++++++ recipes/rust/rust.inc | 6 + recipes/rust/rust_1.5.0.bb | 1 + 3 files changed, 165 insertions(+) create mode 100644 recipes/rust/files/rust-1.5.0/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch diff --git a/recipes/rust/files/rust-1.5.0/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch b/recipes/rust/files/rust-1.5.0/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch new file mode 100644 index 0000000..4182b34 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch @@ -0,0 +1,158 @@ +From 1bd3ab55ce24b2a54e021ba471a5f934b3b9ad6b Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Tue, 7 Jul 2015 16:49:44 -0400 +Subject: [PATCH 10/12] rustc_trans: make .note.rustc look more like debug info + +Mark the global variable as const and private so the resulting section +is not flagged as writable and to avoid putting an unnecessary symbol in +the dynamic table of shared objects. + +Unfortunately there doesn't seem to be a way to avoid the section being +marked SHF_ALLOC when declared as a variable in LLVM. Hack around that +by using objcopy to clear the flags on the section before the final +link. + +This places the section at the end of the executable so it can be +stripped later without rearranging important code/data sections. +--- + mk/platform.mk | 1 + + src/librustc/session/config.rs | 2 ++ + src/librustc_back/target/mod.rs | 4 ++++ + src/librustc_trans/back/link.rs | 38 ++++++++++++++++++++++++++++++++++++++ + src/librustc_trans/trans/base.rs | 3 +++ + 5 files changed, 48 insertions(+) + +diff --git a/mk/platform.mk b/mk/platform.mk +index 0c90632..4681783 100644 +--- a/mk/platform.mk ++++ b/mk/platform.mk +@@ -181,6 +181,7 @@ define CFG_MAKE_TOOLCHAIN + AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1)) + LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1)) + RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \ ++ -C objcopy=$$(call FIND_COMPILER,$$(OBJCOPY_$(1))) \ + -C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1)) + + RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1)) +diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs +index ecb38d4..b74b3c4 100644 +--- a/src/librustc/session/config.rs ++++ b/src/librustc/session/config.rs +@@ -460,6 +460,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, + CG_OPTIONS, cg_type_desc, cgsetters, + ar: Option = (None, parse_opt_string, + "tool to assemble archives with"), ++ objcopy: Option = (None, parse_opt_string, ++ "system objcopy for manipulating objects"), + linker: Option = (None, parse_opt_string, + "system linker to link outputs with"), + link_args: Option> = (None, parse_opt_list, +diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs +index 3ffa484..d52e67c 100644 +--- a/src/librustc_back/target/mod.rs ++++ b/src/librustc_back/target/mod.rs +@@ -110,6 +110,8 @@ pub struct TargetOptions { + /// sysroot folder. + pub pre_link_objects: Vec, + pub post_link_objects: Vec, ++ /// Path to objcopy. Defaults to "objcopy". ++ pub objcopy: String, + /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults + /// to "default". + pub cpu: String, +@@ -198,6 +200,7 @@ impl Default for TargetOptions { + ar: option_env!("CFG_DEFAULT_AR").unwrap_or("ar").to_string(), + pre_link_args: Vec::new(), + post_link_args: Vec::new(), ++ objcopy: "objcopy".to_string(), + cpu: "generic".to_string(), + features: "".to_string(), + dynamic_linking: false, +@@ -314,6 +317,7 @@ impl Target { + key!(cpu); + key!(ar); + key!(linker); ++ key!(objcopy); + key!(relocation_model); + key!(code_model); + key!(dll_prefix); +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index 2a87cd7..53fa913 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -393,6 +393,13 @@ fn command_path(sess: &Session) -> OsString { + env::join_paths(new_path).unwrap() + } + ++pub fn get_objcopy_prog(sess: &Session) -> String { ++ match sess.opts.cg.objcopy { ++ Some(ref objcopy) => return objcopy.to_string(), ++ None => sess.target.target.options.objcopy.clone(), ++ } ++} ++ + pub fn remove(sess: &Session, path: &Path) { + match fs::remove_file(path) { + Ok(..) => {} +@@ -919,6 +926,34 @@ fn link_natively(sess: &Session, dylib: bool, + } + } + ++fn fix_meta_section_attributes(sess: &Session, meta_name: &PathBuf) { ++ // First, fix up the note section attributes. We want the SHF_ALLOC and ++ // SHF_WRITE flags to be unset so the section will get placed near the ++ // end along with the debug info. This allows the section to be ++ // stripped later without renumbering important sections that ++ // contain code and data. ++ let objcopy = get_objcopy_prog(sess); ++ let mut o_cmd = Command::new(&objcopy); ++ o_cmd.arg("--rename-section") ++ .arg(".note.rustc=.note.rustc,contents,noload,readonly") ++ .arg(&meta_name); ++ // Invoke objcopy ++ info!("{:?}", o_cmd); ++ match o_cmd.status() { ++ Ok(exitstatus) => { ++ if !exitstatus.success() { ++ sess.err(&format!("objcopy failed with exit code {:?}", exitstatus.code())); ++ sess.note(&format!("{:?}", &o_cmd)); ++ } ++ }, ++ Err(exitstatus) => { ++ sess.err(&format!("objcopy failed: {}", exitstatus)); ++ sess.note(&format!("{:?}", &o_cmd)); ++ } ++ } ++ sess.abort_if_errors(); ++} ++ + fn link_args(cmd: &mut Linker, + sess: &Session, + dylib: bool, +@@ -951,6 +986,9 @@ fn link_args(cmd: &mut Linker, + // executable. This metadata is in a separate object file from the main + // object file, so we link that in here. + if dylib { ++ let meta_name = outputs.with_extension("metadata.o"); ++ ++ fix_meta_section_attributes(sess, &meta_name); + cmd.add_object(&outputs.with_extension("metadata.o")); + } + +diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs +index 14fea61..df019f7 100644 +--- a/src/librustc_trans/trans/base.rs ++++ b/src/librustc_trans/trans/base.rs +@@ -2560,6 +2560,9 @@ pub fn write_metadata(cx: &SharedCrateContext, krate: &hir::Crate, + }; + unsafe { + llvm::LLVMSetInitializer(llglobal, llconst); ++ llvm::LLVMSetGlobalConstant(llglobal, llvm::True); ++ llvm::LLVMSetUnnamedAddr(llglobal, llvm::True); ++ llvm::SetLinkage(llglobal, llvm::Linkage::PrivateLinkage); + let name = loader::meta_section_name(&cx.sess().target.target); + let name = CString::new(name).unwrap(); + llvm::LLVMSetSection(llglobal, name.as_ptr()) +-- +1.9.1 + diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 1919136..8cdb726 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -152,6 +152,7 @@ def rust_gen_target(d, thing, wd): prefix = d.getVar('{}_PREFIX'.format(thing), True) ccache = d.getVar('CCACHE', True) linker = "{}{}gcc".format(ccache, prefix) + objcopy = "{}objcopy".format(prefix) features = d.getVarFlag('FEATURES', arch, True) or "" pre_link_args = pre_link_args_for(d, thing, arch) @@ -166,6 +167,7 @@ def rust_gen_target(d, thing, wd): "arch": "{}", "os": "linux", "linker": "{}", + "objcopy": "{}", "features": "{}", "dynamic-linking": true, "executables": true, @@ -183,6 +185,7 @@ def rust_gen_target(d, thing, wd): target_pointer_width, arch_to_rust_target_arch(arch), linker, + objcopy, features, as_json(pre_link_args), as_json(post_link_args), @@ -258,6 +261,9 @@ def rust_gen_mk_cfg(d, thing): ], stdout=o, stdin=i) if r: raise Exception + o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix)) + o.close() + i.close() python do_rust_arch_fixup () { for thing in ['BUILD', 'HOST', 'TARGET']: diff --git a/recipes/rust/rust_1.5.0.bb b/recipes/rust/rust_1.5.0.bb index 2a2fdca..dbe0641 100644 --- a/recipes/rust/rust_1.5.0.bb +++ b/recipes/rust/rust_1.5.0.bb @@ -14,6 +14,7 @@ SRC_URI_append = "\ file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ file://${PP}/0008-install-disable-ldconfig.patch \ file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ + file://${PP}/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \ \ file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ " From b7200e623c836ea7843f5565c91acd2ea1023aed Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 3 Feb 2016 10:37:32 -0500 Subject: [PATCH 29/47] remove old versions of rust --- ...01-platform.mk-avoid-choking-on-i586.patch | 27 -- ...lt-target.json-path-libdir-rust-targ.patch | 109 ------ ...e-RUSTFLAGS-to-override-target-libs-.patch | 67 ---- ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 -- ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ------------------ ...cal-workaround-for-NULL-__dso_handle.patch | 25 -- ...mk-install-use-disable-rewrite-paths.patch | 43 --- .../0008-install-disable-ldconfig.patch | 40 -- ...-morestack.S-call-rust_stack_exhaust.patch | 47 --- .../0010-disable-symbol-version-hashing.patch | 26 -- ...01-platform.mk-avoid-choking-on-i586.patch | 27 -- ...lt-target.json-path-libdir-rust-targ.patch | 109 ------ ...e-RUSTFLAGS-to-override-target-libs-.patch | 68 ---- ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 -- ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ------------------ ...cal-workaround-for-NULL-__dso_handle.patch | 25 -- ...mk-install-use-disable-rewrite-paths.patch | 43 --- .../0008-install-disable-ldconfig.patch | 40 -- ...e-crate-metadata-from-symbol-hashing.patch | 28 -- ...at-we-re-only-looking-for-native-lib.patch | 36 -- ...01-platform.mk-avoid-choking-on-i586.patch | 27 -- ...lt-target.json-path-libdir-rust-targ.patch | 109 ------ ...e-RUSTFLAGS-to-override-target-libs-.patch | 68 ---- ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 -- ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ------------------ ...cal-workaround-for-NULL-__dso_handle.patch | 25 -- ...mk-install-use-disable-rewrite-paths.patch | 43 --- .../0008-install-disable-ldconfig.patch | 40 -- ...e-crate-metadata-from-symbol-hashing.patch | 28 -- ...at-we-re-only-looking-for-native-lib.patch | 36 -- ...01-platform.mk-avoid-choking-on-i586.patch | 27 -- ...lt-target.json-path-libdir-rust-targ.patch | 109 ------ ...e-RUSTFLAGS-to-override-target-libs-.patch | 67 ---- ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 -- ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ------------------ ...cal-workaround-for-NULL-__dso_handle.patch | 25 -- ...mk-install-use-disable-rewrite-paths.patch | 43 --- .../0008-install-disable-ldconfig.patch | 40 -- ...e-crate-metadata-from-symbol-hashing.patch | 28 -- ...01-platform.mk-avoid-choking-on-i586.patch | 27 -- ...lt-target.json-path-libdir-rust-targ.patch | 109 ------ ...e-RUSTFLAGS-to-override-target-libs-.patch | 67 ---- ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 27 -- ...t-bindir-and-extend-libdir-to-non-bl.patch | 362 ------------------ ...cal-workaround-for-NULL-__dso_handle.patch | 25 -- ...mk-install-use-disable-rewrite-paths.patch | 43 --- .../0008-install-disable-ldconfig.patch | 40 -- recipes/rust/rust-1.2.0.inc | 17 - recipes/rust/rust-1.3.0.inc | 17 - recipes/rust/rust-1.4.0.inc | 5 - recipes/rust/rust-llvm_1.1.0.bb | 8 - recipes/rust/rust-llvm_1.2.0.bb | 5 - recipes/rust/rust-llvm_1.3.0.bb | 5 - recipes/rust/rust-llvm_1.4.0.bb | 11 - recipes/rust/rust_1.1.0.bb | 34 -- recipes/rust/rust_1.2.0.bb | 20 - recipes/rust/rust_1.3.0.bb | 20 - recipes/rust/rust_1.4.0.bb | 19 - recipes/rust/rust_git.bb | 29 -- 59 files changed, 3921 deletions(-) delete mode 100644 recipes/rust/files/rust-1.1.0/0001-platform.mk-avoid-choking-on-i586.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0007-mk-install-use-disable-rewrite-paths.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0008-install-disable-ldconfig.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0009-src-rt-arch-i386-morestack.S-call-rust_stack_exhaust.patch delete mode 100644 recipes/rust/files/rust-1.1.0/0010-disable-symbol-version-hashing.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0001-platform.mk-avoid-choking-on-i586.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0007-mk-install-use-disable-rewrite-paths.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0008-install-disable-ldconfig.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0009-Remove-crate-metadata-from-symbol-hashing.patch delete mode 100644 recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch delete mode 100644 recipes/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch delete mode 100644 recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch delete mode 100644 recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch delete mode 100644 recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch delete mode 100644 recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch delete mode 100644 recipes/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch delete mode 100644 recipes/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch delete mode 100644 recipes/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch delete mode 100644 recipes/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch delete mode 100644 recipes/rust/files/rust-git/0008-install-disable-ldconfig.patch delete mode 100644 recipes/rust/rust-1.2.0.inc delete mode 100644 recipes/rust/rust-1.3.0.inc delete mode 100644 recipes/rust/rust-1.4.0.inc delete mode 100644 recipes/rust/rust-llvm_1.1.0.bb delete mode 100644 recipes/rust/rust-llvm_1.2.0.bb delete mode 100644 recipes/rust/rust-llvm_1.3.0.bb delete mode 100644 recipes/rust/rust-llvm_1.4.0.bb delete mode 100644 recipes/rust/rust_1.1.0.bb delete mode 100644 recipes/rust/rust_1.2.0.bb delete mode 100644 recipes/rust/rust_1.3.0.bb delete mode 100644 recipes/rust/rust_1.4.0.bb delete mode 100644 recipes/rust/rust_git.bb diff --git a/recipes/rust/files/rust-1.1.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.1.0/0001-platform.mk-avoid-choking-on-i586.patch deleted file mode 100644 index ba8fc82..0000000 --- a/recipes/rust/files/rust-1.1.0/0001-platform.mk-avoid-choking-on-i586.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 89bd1de30bad2e6bee062f287c454e4a87e11056 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Sat, 15 Nov 2014 20:12:48 -0500 -Subject: [PATCH 1/8] 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 9545a1f..80fb0bb 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -14,7 +14,9 @@ - # would create a variable HOST_i686-darwin-macos with the value - # i386. - define DEF_HOST_VAR -- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) -+ HOST_$(1) = $(subst i686,i386,\ -+ $(subst i586,i386,\ -+ $(word 1,$(subst -, ,$(1))))) - endef - $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) - $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.1.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch deleted file mode 100644 index 85bb45e..0000000 --- a/recipes/rust/files/rust-1.1.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 6ed2ad4e243f31e5d9e9fb49e2ce16d2920884c5 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 01:40:21 -0500 -Subject: [PATCH 2/8] 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 | 14 +++++++++++--- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index b999929..3e9743e 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -37,7 +37,7 @@ use getopts; - use std::collections::HashMap; - use std::env; - use std::fmt; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - - use llvm; - -@@ -665,8 +665,8 @@ 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[..]) { - Ok(t) => t, - Err(e) => { - sp.handler().fatal(&format!("Error loading target specification: {}", e)); -diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index 7a8ce1b..cb85d2e 100644 ---- a/src/librustc/session/mod.rs -+++ b/src/librustc/session/mod.rs -@@ -370,14 +370,18 @@ pub fn build_session_(sopts: config::Options, - local_crate_source_file: Option, - span_diagnostic: diagnostic::SpanHandler) - -> Session { -- let host = match Target::search(config::host_triple()) { -+ let sysroot = match sopts.maybe_sysroot { -+ Some(ref x) => PathBuf::from(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 c5f1882..1888fbd 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; - use std::default::Default; - use std::io::prelude::*; - use syntax::{diagnostic, abi}; -+use std::borrow::ToOwned; -+use std::path::Path; - - mod android_base; - mod apple_base; -@@ -298,12 +300,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 { -+ pub fn search(sysroot: &Path, target: &str) -> Result { - use std::env; - use std::ffi::OsString; - use std::fs::File; - use std::path::{Path, PathBuf}; - use serialize::json; -+ use std::iter::IntoIterator; - - fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -390,9 +393,14 @@ impl Target { - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::new()); - -- // FIXME 16351: add a sane default search path? -+ 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() { - return load_file(&p); --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.1.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch deleted file mode 100644 index b033506..0000000 --- a/recipes/rust/files/rust-1.1.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0e78aab532c652b6ee8f8929d7d25de5d7c0d2e9 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 14:52:56 -0500 -Subject: [PATCH 3/8] 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 -the place requested by configure, use '-L' and '--sysroot' to point -stage0-rustc at the appropriate location. ---- - mk/main.mk | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 4aa8d7f..af2ddf0 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -370,21 +370,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 --ifeq ($$(CFG_WINDOWSY_$(3)),1) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --else --ifeq ($(1),0) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib --else - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --endif --endif - - # Destinations of artifacts for target architectures - TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) - TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin - TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib - -+# Don't trust stage0, be explicit about libraries -+# TODO: rather than specifying sysroot, we really want to tell which libdir to -+# use (ie: the dir containing 'rustlib'). This would allow us to avoid -+# passing the '-L' options. -+ifeq ($(1),0) -+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ -+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" -+endif -+ - # Preqrequisites for using the stageN compiler - ifeq ($(1),0) - HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -498,6 +499,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - PERF_STAGE$(1)_T_$(2)_H_$(3) := \ -@@ -506,6 +508,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - endef --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.1.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch deleted file mode 100644 index 3fe3d2b..0000000 --- a/recipes/rust/files/rust-1.1.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 54abdace19bc6a855ae122bd16a5eb82d2f223ee Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 13:48:14 -0500 -Subject: [PATCH 4/8] 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 d9c66e2..585206d 100644 ---- a/mk/grammar.mk -+++ b/mk/grammar.mk -@@ -11,8 +11,8 @@ - BG = $(CFG_BUILD_DIR)/grammar/ - SG = $(S)src/grammar/ - B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ --L = $(B)lib/rustlib/$(CFG_BUILD)/lib --LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ -+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)) - ifeq ($(CFG_OSTYPE),apple-darwin) - FLEX_LDFLAGS=-ll --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.1.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch deleted file mode 100644 index 92f28bf..0000000 --- a/recipes/rust/files/rust-1.1.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 2fa205f59bd2ab4f9a2356073b18b8a8f0ee6787 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 24 Nov 2014 13:10:15 -0500 -Subject: [PATCH 5/8] configure: support --bindir, and extend libdir to - non-blessed dirs - -Adds --bindir, and: - -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 assumes absolute paths start with '/', which may break -windows platforms ---- - configure | 50 ++++++++++++++++------ - mk/host.mk | 6 ++- - mk/main.mk | 11 +++++ - mk/perf.mk | 4 +- - mk/prepare.mk | 4 +- - src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- - src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 91 insertions(+), 71 deletions(-) - -diff --git a/configure b/configure -index 5e02d07..287d066 100755 ---- a/configure -+++ b/configure -@@ -323,6 +323,31 @@ envopt() { - fi - } - -+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 ;; -@@ -607,6 +632,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. -@@ -614,23 +641,21 @@ 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)" -+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_BINDIR_RELATIVE=bin -+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" - --CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -+# 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}") - --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 ] -@@ -1475,6 +1500,7 @@ putvar CFG_PREFIX - putvar CFG_HOST - putvar CFG_TARGET - putvar CFG_LIBDIR_RELATIVE -+putvar CFG_BINDIR_RELATIVE - putvar CFG_DISABLE_MANAGE_SUBMODULES - putvar CFG_ANDROID_CROSS_PATH - putvar CFG_MANDIR -diff --git a/mk/host.mk b/mk/host.mk -index 59a0095..b8e8345 100644 ---- a/mk/host.mk -+++ b/mk/host.mk -@@ -59,9 +59,13 @@ endef - # $(4) - the host triple (same as $(3)) - define CP_HOST_STAGE_N - --ifneq ($(CFG_LIBDIR_RELATIVE),bin) - $$(HLIB$(2)_H_$(4))/: - @mkdir -p $$@ -+ -+# Avoid redefinition warnings if libdir==bindir -+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) -+$$(HBIN$(2)_H_$(4))/: -+ @mkdir -p $$@ - endif - - endef -diff --git a/mk/main.mk b/mk/main.mk -index af2ddf0..15a59be 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -339,7 +339,9 @@ export CFG_RELEASE_CHANNEL - export CFG_LLVM_ROOT - export CFG_PREFIX - export CFG_LIBDIR -+export CFG_BINDIR - export CFG_LIBDIR_RELATIVE -+export CFG_BINDIR_RELATIVE - export CFG_DISABLE_INJECT_STD_VERSION - ifdef CFG_DISABLE_UNSTABLE_FEATURES - CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -369,7 +371,16 @@ define SREQ - - # Destinations of artifacts for the host compiler - HROOT$(1)_H_$(3) = $(3)/stage$(1) -+ -+ifeq ($(1)-$(3),0-$$(CFG_BUILD)) -+# stage0 relative paths are fixed so we can bootstrap from snapshots -+# (downloaded snapshots drop their rustc in HROOT/bin) -+# libdir discrepancy is worked around with RUSTFLAGS below. - HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin -+else -+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) -+endif -+ - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) - - # Destinations of artifacts for target architectures -diff --git a/mk/perf.mk b/mk/perf.mk -index 16cbaab..f8a354c 100644 ---- a/mk/perf.mk -+++ b/mk/perf.mk -@@ -10,13 +10,13 @@ - - - ifdef CFG_PERF_TOOL --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - @$(call E, perf compile: $@) - $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 - $(Q)rm -f $(LIBRUSTC_GLOB) - else --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - $(Q)touch $@ - endif - -diff --git a/mk/prepare.mk b/mk/prepare.mk -index 1ae6a61..e463727 100644 ---- a/mk/prepare.mk -+++ b/mk/prepare.mk -@@ -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) --prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man --prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) - 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 311ab1c..1b03b1a 100644 ---- a/src/librustc/metadata/filesearch.rs -+++ b/src/librustc/metadata/filesearch.rs -@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { - if !found { - let rustpath = rust_path(); - 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)); - -@@ -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 { - let mut p = PathBuf::from(self.sysroot); -- p.push(&find_libdir(self.sysroot)); -+ p.push(libdir_str()); - p.push(&rustlibdir()); - p.push(&self.triple); - p.push("bin"); -@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { - } - } - --pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { -- let mut p = PathBuf::from(&find_libdir(sysroot)); -+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { -+ let mut p = PathBuf::from(&libdir_str()); - assert!(p.is_relative()); - p.push(&rustlibdir()); - p.push(target_triple); -@@ -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 { -- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) -+ sysroot.join(&relative_target_lib_path(target_triple)) - } - --fn make_rustpkg_lib_path(sysroot: &Path, -- dir: &Path, -+fn make_rustpkg_lib_path(dir: &Path, - triple: &str) -> PathBuf { -- let mut p = dir.join(&find_libdir(sysroot)); -+ let mut p = dir.join(libdir_str()); - p.push(triple); - p - } - -+pub fn bindir_relative_str() -> &'static str { -+ env!("CFG_BINDIR_RELATIVE") -+} -+ -+pub fn bindir_relative_path() -> PathBuf { -+ 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) -> Option { -@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { - } - - match canonicalize(env::current_exe().ok()) { -- Some(mut p) => { p.pop(); p.pop(); p } -+ Some(mut p) => { -+ // 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() { -+ p.pop(); -+ } -+ p -+ } - None => panic!("can't determine value for sysroot") - } - } -@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { - env_rust_path - } - --// The name of the directory rustc expects libraries to be located. --// On Unix should be "lib", on windows "bin" --#[cfg(unix)] --fn find_libdir(sysroot: &Path) -> String { -- // FIXME: This is a quick hack to make the rustc binary able to locate -- // Rust libraries in Linux environments where libraries might be installed -- // to lib64/lib32. This would be more foolproof by basing the sysroot off -- // of the directory where librustc is located, rather than where the rustc -- // binary is. -- //If --libdir is set during configuration to the value other than -- // "lib" (i.e. non-default), this value is used (see issue #16552). -- -- match option_env!("CFG_LIBDIR_RELATIVE") { -- Some(libdir) if libdir != "lib" => return libdir.to_string(), -- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { -- return primary_libdir_name(); -- } else { -- return secondary_libdir_name(); -- } -- } -- -- #[cfg(target_pointer_width = "64")] -- fn primary_libdir_name() -> String { -- "lib64".to_string() -- } -- -- #[cfg(target_pointer_width = "32")] -- fn primary_libdir_name() -> String { -- "lib32".to_string() -- } -- -- fn secondary_libdir_name() -> String { -- "lib".to_string() -- } --} -- --#[cfg(windows)] --fn find_libdir(_sysroot: &Path) -> String { -- "bin".to_string() --} -- - // 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 38ad909..2f2ba16 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -1037,11 +1037,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 mut 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); - let mut path = PathBuf::from(install_prefix); - path.push(&tlib); - --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.1.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch deleted file mode 100644 index 8f5e3df..0000000 --- a/recipes/rust/files/rust-1.1.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5364ecd0cdf0bcc815d89180d525b4b60a47219e Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 3 Dec 2014 19:15:19 -0500 -Subject: [PATCH 6/8] std/thread_local: workaround for NULL __dso_handle - ---- - src/libstd/thread/local.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs -index f2435b6..4261387 100644 ---- a/src/libstd/thread/local.rs -+++ b/src/libstd/thread/local.rs -@@ -397,7 +397,7 @@ mod imp { - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const (); - } -- if !__cxa_thread_atexit_impl.is_null() { -+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; --- -2.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.1.0/0007-mk-install-use-disable-rewrite-paths.patch deleted file mode 100644 index 67393af..0000000 --- a/recipes/rust/files/rust-1.1.0/0007-mk-install-use-disable-rewrite-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 378cc683eb8012dc847dc581b57fd10c84a37ae2 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 2 Mar 2015 13:34:59 -0500 -Subject: [PATCH 7/8] mk/install: use disable-rewrite-paths - -This stops the install scripts from doing work we've already handled. - -Path rewriting is only useful for prepackaged binary installers. ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index cabc97a..273bb0e 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" -+ $(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)" -+ $(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 - -@@ -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)" --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)" -+ $(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.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.1.0/0008-install-disable-ldconfig.patch deleted file mode 100644 index 612236b..0000000 --- a/recipes/rust/files/rust-1.1.0/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 79db300ba81f7f8deccd1c2627cd5a25f11d4b82 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 8/8] install: disable ldconfig - ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 273bb0e..58cfc99 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" --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)" --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 - -@@ -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)" --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)" --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.4.3 - diff --git a/recipes/rust/files/rust-1.1.0/0009-src-rt-arch-i386-morestack.S-call-rust_stack_exhaust.patch b/recipes/rust/files/rust-1.1.0/0009-src-rt-arch-i386-morestack.S-call-rust_stack_exhaust.patch deleted file mode 100644 index 3e0c0f1..0000000 --- a/recipes/rust/files/rust-1.1.0/0009-src-rt-arch-i386-morestack.S-call-rust_stack_exhaust.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 02936deefb786a244c98ec2293e6b85ecfc85cdb Mon Sep 17 00:00:00 2001 -From: Steven Walter -Date: Mon, 15 Jun 2015 11:35:47 -0400 -Subject: [PATCH] src/rt/arch/i386/morestack.S: call rust_stack_exhausted via - plt - -This prevents a relocation in the text section. Text relocations are -incompatible with hardened kernels. - -https://github.com/rust-lang/rust/issues/5714 ---- - src/rt/arch/i386/morestack.S | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S -index 2f03251..98fdfdf 100644 ---- a/src/rt/arch/i386/morestack.S -+++ b/src/rt/arch/i386/morestack.S -@@ -75,7 +75,7 @@ - #else - #if defined(__linux__) || defined(__FreeBSD__) - #define MORESTACK __morestack --#define EXHAUSTED rust_stack_exhausted -+#define EXHAUSTED rust_stack_exhausted@plt - #else - #define MORESTACK ___morestack - #define EXHAUSTED _rust_stack_exhausted -@@ -83,7 +83,6 @@ - #endif - - .globl MORESTACK --.globl EXHAUSTED - - // FIXME: What about __WIN32__? - #if defined(__linux__) || defined(__FreeBSD__) -@@ -138,7 +137,7 @@ MORESTACK: - - // re-align the stack - subl $12,%esp -- calll EXHAUSTED -+ call EXHAUSTED - // the exhaustion function guarantees that it can't return - - .cfi_endproc --- -1.9.1 - diff --git a/recipes/rust/files/rust-1.1.0/0010-disable-symbol-version-hashing.patch b/recipes/rust/files/rust-1.1.0/0010-disable-symbol-version-hashing.patch deleted file mode 100644 index 54f311c..0000000 --- a/recipes/rust/files/rust-1.1.0/0010-disable-symbol-version-hashing.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9db9d253355cc0e9e885bb1e63b054e318f9395a Mon Sep 17 00:00:00 2001 -From: Steven Walter -Date: Tue, 7 Jul 2015 14:57:42 -0400 -Subject: [PATCH] Remove crate metadata from symbol hashing - ---- - src/librustc_trans/back/link.rs | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index 2f2ba16..ea3e897 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -205,9 +205,4 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, - symbol_hasher.input_str(&link_meta.crate_name); -- symbol_hasher.input_str("-"); -- symbol_hasher.input_str(link_meta.crate_hash.as_str()); -- for meta in &*tcx.sess.crate_metadata.borrow() { -- symbol_hasher.input_str(&meta[..]); -- } - symbol_hasher.input_str("-"); - symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); - // Prefix with 'h' so that it never blends into adjacent digits --- -1.9.1 - diff --git a/recipes/rust/files/rust-1.2.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.2.0/0001-platform.mk-avoid-choking-on-i586.patch deleted file mode 100644 index 23e18b4..0000000 --- a/recipes/rust/files/rust-1.2.0/0001-platform.mk-avoid-choking-on-i586.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 776929187d56bd9417532c47d856bf781b08e95f Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Sat, 15 Nov 2014 20:12:48 -0500 -Subject: [PATCH 01/10] 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 8a5e58c..e2c3d8f 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -14,7 +14,9 @@ - # would create a variable HOST_i686-darwin-macos with the value - # i386. - define DEF_HOST_VAR -- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) -+ HOST_$(1) = $(subst i686,i386,\ -+ $(subst i586,i386,\ -+ $(word 1,$(subst -, ,$(1))))) - endef - $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) - $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.2.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch deleted file mode 100644 index 023aa81..0000000 --- a/recipes/rust/files/rust-1.2.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch +++ /dev/null @@ -1,109 +0,0 @@ -From f3966aca0080e8718660137c697ff6856929087a Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 01:40:21 -0500 -Subject: [PATCH 02/10] 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 | 14 +++++++++++--- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index c6ce3a2..51152c7 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -38,7 +38,7 @@ use getopts; - use std::collections::HashMap; - use std::env; - use std::fmt; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - - use llvm; - -@@ -651,8 +651,8 @@ 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[..]) { - Ok(t) => t, - Err(e) => { - sp.handler().fatal(&format!("Error loading target specification: {}", e)); -diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index 6b5f587..4432440 100644 ---- a/src/librustc/session/mod.rs -+++ b/src/librustc/session/mod.rs -@@ -381,14 +381,18 @@ pub fn build_session_(sopts: config::Options, - local_crate_source_file: Option, - span_diagnostic: diagnostic::SpanHandler) - -> Session { -- let host = match Target::search(config::host_triple()) { -+ let sysroot = match sopts.maybe_sysroot { -+ Some(ref x) => PathBuf::from(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::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 402fbcd..a211b84 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; - use std::default::Default; - use std::io::prelude::*; - use syntax::{diagnostic, abi}; -+use std::borrow::ToOwned; -+use std::path::Path; - - mod android_base; - mod apple_base; -@@ -306,12 +308,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 { -+ pub fn search(sysroot: &Path, target: &str) -> Result { - use std::env; - use std::ffi::OsString; - use std::fs::File; - use std::path::{Path, PathBuf}; - use serialize::json; -+ use std::iter::IntoIterator; - - fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -400,9 +403,14 @@ impl Target { - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::new()); - -- // FIXME 16351: add a sane default search path? -+ 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() { - return load_file(&p); --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.2.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch deleted file mode 100644 index 6caa5b3..0000000 --- a/recipes/rust/files/rust-1.2.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 2bc2e872f7b97e67456dd9dd5563611fe0f15ada Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 14:52:56 -0500 -Subject: [PATCH 03/10] 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 -the place requested by configure, use '-L' and '--sysroot' to point -stage0-rustc at the appropriate location. ---- - mk/main.mk | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 8983a63..98024bf 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -370,21 +370,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 --ifeq ($$(CFG_WINDOWSY_$(3)),1) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --else --ifeq ($(1),0) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib --else - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --endif --endif - - # Destinations of artifacts for target architectures - TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) - TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin - TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib - -+# Don't trust stage0, be explicit about libraries -+# TODO: rather than specifying sysroot, we really want to tell which libdir to -+# use (ie: the dir containing 'rustlib'). This would allow us to avoid -+# passing the '-L' options. -+ifeq ($(1),0) -+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ -+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" -+endif -+ - # Preqrequisites for using the stageN compiler - ifeq ($(1),0) - HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -496,6 +497,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - PERF_STAGE$(1)_T_$(2)_H_$(3) := \ -@@ -504,6 +506,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - endef --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.2.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch deleted file mode 100644 index a79b8aa..0000000 --- a/recipes/rust/files/rust-1.2.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 3572e79ac46629bafcfd8d4a19b2904031ce113c Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 13:48:14 -0500 -Subject: [PATCH 04/10] 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 d9c66e2..585206d 100644 ---- a/mk/grammar.mk -+++ b/mk/grammar.mk -@@ -11,8 +11,8 @@ - BG = $(CFG_BUILD_DIR)/grammar/ - SG = $(S)src/grammar/ - B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ --L = $(B)lib/rustlib/$(CFG_BUILD)/lib --LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ -+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)) - ifeq ($(CFG_OSTYPE),apple-darwin) - FLEX_LDFLAGS=-ll --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.2.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch deleted file mode 100644 index 3237a0b..0000000 --- a/recipes/rust/files/rust-1.2.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From e5177f4dfdce566fb8e59211d2c2b530e3920203 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 24 Nov 2014 13:10:15 -0500 -Subject: [PATCH 05/10] configure: support --bindir, and extend libdir to - non-blessed dirs - -Adds --bindir, and: - -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 assumes absolute paths start with '/', which may break -windows platforms ---- - configure | 49 ++++++++++++++++------ - mk/host.mk | 6 ++- - mk/main.mk | 11 +++++ - mk/perf.mk | 4 +- - mk/prepare.mk | 4 +- - src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- - src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 90 insertions(+), 71 deletions(-) - -diff --git a/configure b/configure -index bfd2798..c07a517 100755 ---- a/configure -+++ b/configure -@@ -323,6 +323,31 @@ envopt() { - fi - } - -+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 ;; -@@ -609,6 +634,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. -@@ -616,24 +643,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 -- CFG_LIBDIR_RELATIVE=lib - fi - --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_BINDIR_RELATIVE=bin -+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" - --CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -+# 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}") - - 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 ] -@@ -1583,6 +1607,7 @@ putvar CFG_PREFIX - putvar CFG_HOST - putvar CFG_TARGET - putvar CFG_LIBDIR_RELATIVE -+putvar CFG_BINDIR_RELATIVE - putvar CFG_DISABLE_MANAGE_SUBMODULES - putvar CFG_ANDROID_CROSS_PATH - putvar CFG_MANDIR -diff --git a/mk/host.mk b/mk/host.mk -index 59a0095..b8e8345 100644 ---- a/mk/host.mk -+++ b/mk/host.mk -@@ -59,9 +59,13 @@ endef - # $(4) - the host triple (same as $(3)) - define CP_HOST_STAGE_N - --ifneq ($(CFG_LIBDIR_RELATIVE),bin) - $$(HLIB$(2)_H_$(4))/: - @mkdir -p $$@ -+ -+# Avoid redefinition warnings if libdir==bindir -+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) -+$$(HBIN$(2)_H_$(4))/: -+ @mkdir -p $$@ - endif - - endef -diff --git a/mk/main.mk b/mk/main.mk -index 98024bf..73fb58b 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -339,7 +339,9 @@ export CFG_RELEASE_CHANNEL - export CFG_LLVM_ROOT - export CFG_PREFIX - export CFG_LIBDIR -+export CFG_BINDIR - export CFG_LIBDIR_RELATIVE -+export CFG_BINDIR_RELATIVE - export CFG_DISABLE_INJECT_STD_VERSION - ifdef CFG_DISABLE_UNSTABLE_FEATURES - CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -369,7 +371,16 @@ define SREQ - - # Destinations of artifacts for the host compiler - HROOT$(1)_H_$(3) = $(3)/stage$(1) -+ -+ifeq ($(1)-$(3),0-$$(CFG_BUILD)) -+# stage0 relative paths are fixed so we can bootstrap from snapshots -+# (downloaded snapshots drop their rustc in HROOT/bin) -+# libdir discrepancy is worked around with RUSTFLAGS below. - HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin -+else -+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) -+endif -+ - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) - - # Destinations of artifacts for target architectures -diff --git a/mk/perf.mk b/mk/perf.mk -index 16cbaab..f8a354c 100644 ---- a/mk/perf.mk -+++ b/mk/perf.mk -@@ -10,13 +10,13 @@ - - - ifdef CFG_PERF_TOOL --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - @$(call E, perf compile: $@) - $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 - $(Q)rm -f $(LIBRUSTC_GLOB) - else --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - $(Q)touch $@ - endif - -diff --git a/mk/prepare.mk b/mk/prepare.mk -index fe619cc..b8aa0cb 100644 ---- a/mk/prepare.mk -+++ b/mk/prepare.mk -@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ - define DEF_PREPARE - - prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) --prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man --prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) - 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 311ab1c..1b03b1a 100644 ---- a/src/librustc/metadata/filesearch.rs -+++ b/src/librustc/metadata/filesearch.rs -@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { - if !found { - let rustpath = rust_path(); - 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)); - -@@ -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 { - let mut p = PathBuf::from(self.sysroot); -- p.push(&find_libdir(self.sysroot)); -+ p.push(libdir_str()); - p.push(&rustlibdir()); - p.push(&self.triple); - p.push("bin"); -@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { - } - } - --pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { -- let mut p = PathBuf::from(&find_libdir(sysroot)); -+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { -+ let mut p = PathBuf::from(&libdir_str()); - assert!(p.is_relative()); - p.push(&rustlibdir()); - p.push(target_triple); -@@ -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 { -- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) -+ sysroot.join(&relative_target_lib_path(target_triple)) - } - --fn make_rustpkg_lib_path(sysroot: &Path, -- dir: &Path, -+fn make_rustpkg_lib_path(dir: &Path, - triple: &str) -> PathBuf { -- let mut p = dir.join(&find_libdir(sysroot)); -+ let mut p = dir.join(libdir_str()); - p.push(triple); - p - } - -+pub fn bindir_relative_str() -> &'static str { -+ env!("CFG_BINDIR_RELATIVE") -+} -+ -+pub fn bindir_relative_path() -> PathBuf { -+ 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) -> Option { -@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { - } - - match canonicalize(env::current_exe().ok()) { -- Some(mut p) => { p.pop(); p.pop(); p } -+ Some(mut p) => { -+ // 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() { -+ p.pop(); -+ } -+ p -+ } - None => panic!("can't determine value for sysroot") - } - } -@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { - env_rust_path - } - --// The name of the directory rustc expects libraries to be located. --// On Unix should be "lib", on windows "bin" --#[cfg(unix)] --fn find_libdir(sysroot: &Path) -> String { -- // FIXME: This is a quick hack to make the rustc binary able to locate -- // Rust libraries in Linux environments where libraries might be installed -- // to lib64/lib32. This would be more foolproof by basing the sysroot off -- // of the directory where librustc is located, rather than where the rustc -- // binary is. -- //If --libdir is set during configuration to the value other than -- // "lib" (i.e. non-default), this value is used (see issue #16552). -- -- match option_env!("CFG_LIBDIR_RELATIVE") { -- Some(libdir) if libdir != "lib" => return libdir.to_string(), -- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { -- return primary_libdir_name(); -- } else { -- return secondary_libdir_name(); -- } -- } -- -- #[cfg(target_pointer_width = "64")] -- fn primary_libdir_name() -> String { -- "lib64".to_string() -- } -- -- #[cfg(target_pointer_width = "32")] -- fn primary_libdir_name() -> String { -- "lib32".to_string() -- } -- -- fn secondary_libdir_name() -> String { -- "lib".to_string() -- } --} -- --#[cfg(windows)] --fn find_libdir(_sysroot: &Path) -> String { -- "bin".to_string() --} -- - // 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 6b8b59d..6e03f3c 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -997,11 +997,10 @@ fn link_args(cmd: &mut Linker, - // 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 mut 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); - let mut path = PathBuf::from(install_prefix); - path.push(&tlib); - --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.2.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch deleted file mode 100644 index 26def76..0000000 --- a/recipes/rust/files/rust-1.2.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch +++ /dev/null @@ -1,25 +0,0 @@ -From df6d2377c215240cd27f9ed3da500a09ea9da370 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 3 Dec 2014 19:15:19 -0500 -Subject: [PATCH 06/10] std/thread_local: workaround for NULL __dso_handle - ---- - src/libstd/thread/local.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs -index 6056334..e79bd8b 100644 ---- a/src/libstd/thread/local.rs -+++ b/src/libstd/thread/local.rs -@@ -337,7 +337,7 @@ mod imp { - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const (); - } -- if !__cxa_thread_atexit_impl.is_null() { -+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.2.0/0007-mk-install-use-disable-rewrite-paths.patch deleted file mode 100644 index ad613f3..0000000 --- a/recipes/rust/files/rust-1.2.0/0007-mk-install-use-disable-rewrite-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 622a5811ed511ea29080cc42a74fe50f308ce91e Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 2 Mar 2015 13:34:59 -0500 -Subject: [PATCH 07/10] mk/install: use disable-rewrite-paths - -This stops the install scripts from doing work we've already handled. - -Path rewriting is only useful for prepackaged binary installers. ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index cabc97a..273bb0e 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" -+ $(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)" -+ $(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 - -@@ -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)" --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)" -+ $(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.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.2.0/0008-install-disable-ldconfig.patch deleted file mode 100644 index e23e6a5..0000000 --- a/recipes/rust/files/rust-1.2.0/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,40 +0,0 @@ -From cc039d1c87a417297d8c2b9ee86a3a6d9bf9ae91 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 08/10] install: disable ldconfig - ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 273bb0e..58cfc99 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" --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)" --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 - -@@ -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)" --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)" --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.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust-1.2.0/0009-Remove-crate-metadata-from-symbol-hashing.patch deleted file mode 100644 index b4a4e49..0000000 --- a/recipes/rust/files/rust-1.2.0/0009-Remove-crate-metadata-from-symbol-hashing.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ec110b1823638d3ddbedc29e176c1b6dd9a4a9e2 Mon Sep 17 00:00:00 2001 -From: Steven Walter -Date: Tue, 7 Jul 2015 14:57:42 -0400 -Subject: [PATCH 09/10] Remove crate metadata from symbol hashing - ---- - src/librustc_trans/back/link.rs | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index 6e03f3c..9a5efba 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -204,11 +204,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, - symbol_hasher.reset(); - symbol_hasher.input_str(&link_meta.crate_name); - symbol_hasher.input_str("-"); -- symbol_hasher.input_str(link_meta.crate_hash.as_str()); -- for meta in tcx.sess.crate_metadata.borrow().iter() { -- symbol_hasher.input_str(&meta[..]); -- } -- symbol_hasher.input_str("-"); - symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); - // Prefix with 'h' so that it never blends into adjacent digits - let mut hash = String::from("h"); --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch b/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch deleted file mode 100644 index a3e8f2f..0000000 --- a/recipes/rust/files/rust-1.2.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 64679c95a8f1fcc27702a0ada730d1fd320ab307 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 26 Aug 2015 11:21:36 -0400 -Subject: [PATCH 10/10] mk: tell rustc that we're only looking for native libs - in the LLVM_LIBDIR - -This fixes the case where we try to re-build & re-install rust to the -same prefix (without uninstalling) while using an llvm-root that is the -same as the prefix. - -Without this, builds like that fail with: - 'error: multiple dylib candidates for `std` found' - -See https://github.com/jmesmon/meta-rust/issues/6 for some details. - -May also be related to #20342. ---- - mk/main.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 73fb58b..4075c24 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -294,7 +294,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) - LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir) - LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir) - LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir) --LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))" -+LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))" - LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS)) - LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags) - ifeq ($$(findstring freebsd,$(1)),freebsd) --- -2.5.0 - diff --git a/recipes/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch deleted file mode 100644 index 634fefd..0000000 --- a/recipes/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6d0905573f38d0fbdde74848c0cd7cdbb603c238 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Sat, 15 Nov 2014 20:12:48 -0500 -Subject: [PATCH 01/10] 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 60fe22c..9c57656 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -14,7 +14,9 @@ - # would create a variable HOST_i686-darwin-macos with the value - # i386. - define DEF_HOST_VAR -- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) -+ HOST_$(1) = $(subst i686,i386,\ -+ $(subst i586,i386,\ -+ $(word 1,$(subst -, ,$(1))))) - endef - $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) - $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch deleted file mode 100644 index 236ee7a..0000000 --- a/recipes/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch +++ /dev/null @@ -1,109 +0,0 @@ -From e9d46f8cb10eec1f8ee19ed2aab385d17ec85757 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 01:40:21 -0500 -Subject: [PATCH 02/10] 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 | 14 +++++++++++--- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index c5db7cd..2b9069f 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -38,7 +38,7 @@ use getopts; - use std::collections::HashMap; - use std::env; - use std::fmt; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - - use llvm; - -@@ -655,8 +655,8 @@ 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[..]) { - Ok(t) => t, - Err(e) => { - sp.handler().fatal(&format!("Error loading target specification: {}", e)); -diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index 99a58f0..d25e476 100644 ---- a/src/librustc/session/mod.rs -+++ b/src/librustc/session/mod.rs -@@ -385,14 +385,18 @@ pub fn build_session_(sopts: config::Options, - local_crate_source_file: Option, - span_diagnostic: diagnostic::SpanHandler) - -> Session { -- let host = match Target::search(config::host_triple()) { -+ let sysroot = match sopts.maybe_sysroot { -+ Some(ref x) => PathBuf::from(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::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 ce05a88..1d1ff70 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; - use std::default::Default; - use std::io::prelude::*; - use syntax::{diagnostic, abi}; -+use std::borrow::ToOwned; -+use std::path::Path; - - mod android_base; - mod apple_base; -@@ -320,12 +322,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 { -+ pub fn search(sysroot: &Path, target: &str) -> Result { - use std::env; - use std::ffi::OsString; - use std::fs::File; - use std::path::{Path, PathBuf}; - use serialize::json; -+ use std::iter::IntoIterator; - - fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -417,9 +420,14 @@ impl Target { - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::new()); - -- // FIXME 16351: add a sane default search path? -+ 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() { - return load_file(&p); --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch deleted file mode 100644 index 7b125b9..0000000 --- a/recipes/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e468926e5e331dc6a68be5d0731a331940bd0199 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 14:52:56 -0500 -Subject: [PATCH 03/10] 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 -the place requested by configure, use '-L' and '--sysroot' to point -stage0-rustc at the appropriate location. ---- - mk/main.mk | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 99b0797..d907628 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -369,21 +369,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 --ifeq ($$(CFG_WINDOWSY_$(3)),1) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --else --ifeq ($(1),0) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib --else - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --endif --endif - - # Destinations of artifacts for target architectures - TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) - TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin - TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib - -+# Don't trust stage0, be explicit about libraries -+# TODO: rather than specifying sysroot, we really want to tell which libdir to -+# use (ie: the dir containing 'rustlib'). This would allow us to avoid -+# passing the '-L' options. -+ifeq ($(1),0) -+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ -+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" -+endif -+ - # Preqrequisites for using the stageN compiler - ifeq ($(1),0) - HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -495,6 +496,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - PERF_STAGE$(1)_T_$(2)_H_$(3) := \ -@@ -503,6 +505,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - endef --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch deleted file mode 100644 index f41a4e8..0000000 --- a/recipes/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 977954fbe5a3c9d0b89652f852b174aa9ac0e0a4 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 13:48:14 -0500 -Subject: [PATCH 04/10] 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 d9c66e2..585206d 100644 ---- a/mk/grammar.mk -+++ b/mk/grammar.mk -@@ -11,8 +11,8 @@ - BG = $(CFG_BUILD_DIR)/grammar/ - SG = $(S)src/grammar/ - B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ --L = $(B)lib/rustlib/$(CFG_BUILD)/lib --LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ -+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)) - ifeq ($(CFG_OSTYPE),apple-darwin) - FLEX_LDFLAGS=-ll --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch deleted file mode 100644 index dc71af7..0000000 --- a/recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 08aecf1062fd85207e9b5c688b84def523eb05a0 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 24 Nov 2014 13:10:15 -0500 -Subject: [PATCH 05/10] configure: support --bindir, and extend libdir to - non-blessed dirs - -Adds --bindir, and: - -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 assumes absolute paths start with '/', which may break -windows platforms ---- - configure | 49 ++++++++++++++++------ - mk/host.mk | 6 ++- - mk/main.mk | 11 +++++ - mk/perf.mk | 4 +- - mk/prepare.mk | 4 +- - src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- - src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 90 insertions(+), 71 deletions(-) - -diff --git a/configure b/configure -index 2c8d785..d214382 100755 ---- a/configure -+++ b/configure -@@ -334,6 +334,31 @@ enable_if_not_disabled() { - fi - } - -+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 ;; -@@ -626,6 +651,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. -@@ -633,24 +660,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 -- CFG_LIBDIR_RELATIVE=lib - fi - --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_BINDIR_RELATIVE=bin -+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" - --CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -+# 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}") - - 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 ] -@@ -1685,6 +1709,7 @@ putvar CFG_PREFIX - putvar CFG_HOST - putvar CFG_TARGET - putvar CFG_LIBDIR_RELATIVE -+putvar CFG_BINDIR_RELATIVE - putvar CFG_DISABLE_MANAGE_SUBMODULES - putvar CFG_AARCH64_LINUX_ANDROID_NDK - putvar CFG_ARM_LINUX_ANDROIDEABI_NDK -diff --git a/mk/host.mk b/mk/host.mk -index 59a0095..b8e8345 100644 ---- a/mk/host.mk -+++ b/mk/host.mk -@@ -59,9 +59,13 @@ endef - # $(4) - the host triple (same as $(3)) - define CP_HOST_STAGE_N - --ifneq ($(CFG_LIBDIR_RELATIVE),bin) - $$(HLIB$(2)_H_$(4))/: - @mkdir -p $$@ -+ -+# Avoid redefinition warnings if libdir==bindir -+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) -+$$(HBIN$(2)_H_$(4))/: -+ @mkdir -p $$@ - endif - - endef -diff --git a/mk/main.mk b/mk/main.mk -index d907628..6782bed 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -338,7 +338,9 @@ export CFG_RELEASE_CHANNEL - export CFG_LLVM_ROOT - export CFG_PREFIX - export CFG_LIBDIR -+export CFG_BINDIR - export CFG_LIBDIR_RELATIVE -+export CFG_BINDIR_RELATIVE - export CFG_DISABLE_INJECT_STD_VERSION - ifdef CFG_DISABLE_UNSTABLE_FEATURES - CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -368,7 +370,16 @@ define SREQ - - # Destinations of artifacts for the host compiler - HROOT$(1)_H_$(3) = $(3)/stage$(1) -+ -+ifeq ($(1)-$(3),0-$$(CFG_BUILD)) -+# stage0 relative paths are fixed so we can bootstrap from snapshots -+# (downloaded snapshots drop their rustc in HROOT/bin) -+# libdir discrepancy is worked around with RUSTFLAGS below. - HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin -+else -+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) -+endif -+ - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) - - # Destinations of artifacts for target architectures -diff --git a/mk/perf.mk b/mk/perf.mk -index 16cbaab..f8a354c 100644 ---- a/mk/perf.mk -+++ b/mk/perf.mk -@@ -10,13 +10,13 @@ - - - ifdef CFG_PERF_TOOL --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - @$(call E, perf compile: $@) - $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 - $(Q)rm -f $(LIBRUSTC_GLOB) - else --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - $(Q)touch $@ - endif - -diff --git a/mk/prepare.mk b/mk/prepare.mk -index fe619cc..b8aa0cb 100644 ---- a/mk/prepare.mk -+++ b/mk/prepare.mk -@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ - define DEF_PREPARE - - prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) --prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man --prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) - 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 311ab1c..1b03b1a 100644 ---- a/src/librustc/metadata/filesearch.rs -+++ b/src/librustc/metadata/filesearch.rs -@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { - if !found { - let rustpath = rust_path(); - 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)); - -@@ -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 { - let mut p = PathBuf::from(self.sysroot); -- p.push(&find_libdir(self.sysroot)); -+ p.push(libdir_str()); - p.push(&rustlibdir()); - p.push(&self.triple); - p.push("bin"); -@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { - } - } - --pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { -- let mut p = PathBuf::from(&find_libdir(sysroot)); -+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { -+ let mut p = PathBuf::from(&libdir_str()); - assert!(p.is_relative()); - p.push(&rustlibdir()); - p.push(target_triple); -@@ -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 { -- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) -+ sysroot.join(&relative_target_lib_path(target_triple)) - } - --fn make_rustpkg_lib_path(sysroot: &Path, -- dir: &Path, -+fn make_rustpkg_lib_path(dir: &Path, - triple: &str) -> PathBuf { -- let mut p = dir.join(&find_libdir(sysroot)); -+ let mut p = dir.join(libdir_str()); - p.push(triple); - p - } - -+pub fn bindir_relative_str() -> &'static str { -+ env!("CFG_BINDIR_RELATIVE") -+} -+ -+pub fn bindir_relative_path() -> PathBuf { -+ 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) -> Option { -@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { - } - - match canonicalize(env::current_exe().ok()) { -- Some(mut p) => { p.pop(); p.pop(); p } -+ Some(mut p) => { -+ // 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() { -+ p.pop(); -+ } -+ p -+ } - None => panic!("can't determine value for sysroot") - } - } -@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { - env_rust_path - } - --// The name of the directory rustc expects libraries to be located. --// On Unix should be "lib", on windows "bin" --#[cfg(unix)] --fn find_libdir(sysroot: &Path) -> String { -- // FIXME: This is a quick hack to make the rustc binary able to locate -- // Rust libraries in Linux environments where libraries might be installed -- // to lib64/lib32. This would be more foolproof by basing the sysroot off -- // of the directory where librustc is located, rather than where the rustc -- // binary is. -- //If --libdir is set during configuration to the value other than -- // "lib" (i.e. non-default), this value is used (see issue #16552). -- -- match option_env!("CFG_LIBDIR_RELATIVE") { -- Some(libdir) if libdir != "lib" => return libdir.to_string(), -- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { -- return primary_libdir_name(); -- } else { -- return secondary_libdir_name(); -- } -- } -- -- #[cfg(target_pointer_width = "64")] -- fn primary_libdir_name() -> String { -- "lib64".to_string() -- } -- -- #[cfg(target_pointer_width = "32")] -- fn primary_libdir_name() -> String { -- "lib32".to_string() -- } -- -- fn secondary_libdir_name() -> String { -- "lib".to_string() -- } --} -- --#[cfg(windows)] --fn find_libdir(_sysroot: &Path) -> String { -- "bin".to_string() --} -- - // 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 5bdc76b..25dd2e6 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -1011,11 +1011,10 @@ fn link_args(cmd: &mut Linker, - // 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 mut 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); - let mut path = PathBuf::from(install_prefix); - path.push(&tlib); - --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch deleted file mode 100644 index 580303a..0000000 --- a/recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1aebe22b98f797765293bafc1f5e8990a742b291 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 3 Dec 2014 19:15:19 -0500 -Subject: [PATCH 06/10] std/thread_local: workaround for NULL __dso_handle - ---- - src/libstd/thread/local.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs -index 9a6d68a..37a0ea0 100644 ---- a/src/libstd/thread/local.rs -+++ b/src/libstd/thread/local.rs -@@ -337,7 +337,7 @@ mod imp { - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const libc::c_void; - } -- if !__cxa_thread_atexit_impl.is_null() { -+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch deleted file mode 100644 index 5e875f0..0000000 --- a/recipes/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 564742fb9c94f9b8e7f6ad4ec34fd2254c337a09 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 2 Mar 2015 13:34:59 -0500 -Subject: [PATCH 07/10] mk/install: use disable-rewrite-paths - -This stops the install scripts from doing work we've already handled. - -Path rewriting is only useful for prepackaged binary installers. ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index cabc97a..273bb0e 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" -+ $(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)" -+ $(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 - -@@ -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)" --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)" -+ $(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.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch deleted file mode 100644 index 3a74e8e..0000000 --- a/recipes/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 24fc19c57309b0c23c34f22b87796bb8aee4efa7 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 08/10] install: disable ldconfig - ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 273bb0e..58cfc99 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" --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)" --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 - -@@ -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)" --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)" --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.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch deleted file mode 100644 index 62024d3..0000000 --- a/recipes/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ffacbea82a7e03fadc05d31313e2bbd3e10388fb Mon Sep 17 00:00:00 2001 -From: Steven Walter -Date: Tue, 7 Jul 2015 14:57:42 -0400 -Subject: [PATCH 09/10] Remove crate metadata from symbol hashing - ---- - src/librustc_trans/back/link.rs | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index 25dd2e6..d203d07 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -206,11 +206,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, - symbol_hasher.reset(); - symbol_hasher.input_str(&link_meta.crate_name); - symbol_hasher.input_str("-"); -- symbol_hasher.input_str(link_meta.crate_hash.as_str()); -- for meta in tcx.sess.crate_metadata.borrow().iter() { -- symbol_hasher.input_str(&meta[..]); -- } -- symbol_hasher.input_str("-"); - symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); - // Prefix with 'h' so that it never blends into adjacent digits - let mut hash = String::from("h"); --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch b/recipes/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch deleted file mode 100644 index e810414..0000000 --- a/recipes/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 053afad02e46b0cb62569018f07f7430ebf9afc5 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 26 Aug 2015 11:21:36 -0400 -Subject: [PATCH 10/10] mk: tell rustc that we're only looking for native libs - in the LLVM_LIBDIR - -This fixes the case where we try to re-build & re-install rust to the -same prefix (without uninstalling) while using an llvm-root that is the -same as the prefix. - -Without this, builds like that fail with: - 'error: multiple dylib candidates for `std` found' - -See https://github.com/jmesmon/meta-rust/issues/6 for some details. - -May also be related to #20342. ---- - mk/main.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 6782bed..63b4fef 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -294,7 +294,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) - LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir) - LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir) - LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir) --LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))" -+LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))" - LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags) - ifeq ($$(findstring freebsd,$(1)),freebsd) - # On FreeBSD, it may search wrong headers (that are for pre-installed LLVM), --- -2.5.1 - diff --git a/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch deleted file mode 100644 index 1d52764..0000000 --- a/recipes/rust/files/rust-1.4.0/0001-platform.mk-avoid-choking-on-i586.patch +++ /dev/null @@ -1,27 +0,0 @@ -From cc1513e3f9c65c0ff97f92b0f2d0452b23a1f712 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Sat, 15 Nov 2014 20:12:48 -0500 -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 fcb6a5b..96f6d91 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -14,7 +14,9 @@ - # would create a variable HOST_i686-darwin-macos with the value - # i386. - define DEF_HOST_VAR -- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) -+ HOST_$(1) = $(subst i686,i386,\ -+ $(subst i586,i386,\ -+ $(word 1,$(subst -, ,$(1))))) - endef - $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) - $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch deleted file mode 100644 index 9fcef0d..0000000 --- a/recipes/rust/files/rust-1.4.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 8dcca17fe0c639bddf380d4dbed93c6c05fbd8d3 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 01:40:21 -0500 -Subject: [PATCH 2/9] 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 | 14 +++++++++++--- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index b56283e..cfef75a 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -39,7 +39,7 @@ use getopts; - use std::collections::HashMap; - use std::env; - use std::fmt; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - - use llvm; - -@@ -660,8 +660,8 @@ 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[..]) { - Ok(t) => t, - Err(e) => { - sp.handler().fatal(&format!("Error loading target specification: {}", e)); -diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index ff732ee..bf81605 100644 ---- a/src/librustc/session/mod.rs -+++ b/src/librustc/session/mod.rs -@@ -405,14 +405,18 @@ pub fn build_session_(sopts: config::Options, - local_crate_source_file: Option, - span_diagnostic: diagnostic::SpanHandler) - -> Session { -- let host = match Target::search(config::host_triple()) { -+ let sysroot = match sopts.maybe_sysroot { -+ Some(ref x) => PathBuf::from(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::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 56562c8..c3a47dc 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; - use std::default::Default; - use std::io::prelude::*; - use syntax::{diagnostic, abi}; -+use std::borrow::ToOwned; -+use std::path::Path; - - mod android_base; - mod apple_base; -@@ -333,12 +335,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 { -+ pub fn search(sysroot: &Path, target: &str) -> Result { - use std::env; - use std::ffi::OsString; - use std::fs::File; - use std::path::{Path, PathBuf}; - use serialize::json; -+ use std::iter::IntoIterator; - - fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -431,9 +434,14 @@ impl Target { - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::new()); - -- // FIXME 16351: add a sane default search path? -+ 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() { - return load_file(&p); --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch deleted file mode 100644 index 36a52d7..0000000 --- a/recipes/rust/files/rust-1.4.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7be198aa05895e739805fcb74c81ef4379d15c2d Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 14:52:56 -0500 -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 -the place requested by configure, use '-L' and '--sysroot' to point -stage0-rustc at the appropriate location. ---- - mk/main.mk | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mk/main.mk b/mk/main.mk -index f133555..64c3834 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -381,21 +381,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 --ifeq ($$(CFG_WINDOWSY_$(3)),1) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --else --ifeq ($(1),0) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib --else - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --endif --endif - - # Destinations of artifacts for target architectures - TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) - TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin - TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib - -+# Don't trust stage0, be explicit about libraries -+# TODO: rather than specifying sysroot, we really want to tell which libdir to -+# use (ie: the dir containing 'rustlib'). This would allow us to avoid -+# passing the '-L' options. -+ifeq ($(1),0) -+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ -+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" -+endif -+ - # Preqrequisites for using the stageN compiler - ifeq ($(1),0) - HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -507,6 +508,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - PERF_STAGE$(1)_T_$(2)_H_$(3) := \ -@@ -515,6 +517,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - endef --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch deleted file mode 100644 index 032d577..0000000 --- a/recipes/rust/files/rust-1.4.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6e767a11bea08a4e0affb06b0c3ef943ef900f0f Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 13:48:14 -0500 -Subject: [PATCH 4/9] 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 d9c66e2..585206d 100644 ---- a/mk/grammar.mk -+++ b/mk/grammar.mk -@@ -11,8 +11,8 @@ - BG = $(CFG_BUILD_DIR)/grammar/ - SG = $(S)src/grammar/ - B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ --L = $(B)lib/rustlib/$(CFG_BUILD)/lib --LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ -+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)) - ifeq ($(CFG_OSTYPE),apple-darwin) - FLEX_LDFLAGS=-ll --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch deleted file mode 100644 index 403b97f..0000000 --- a/recipes/rust/files/rust-1.4.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From b55b786f7d0887700f38d57b9f5d90f990745510 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 24 Nov 2014 13:10:15 -0500 -Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to - non-blessed dirs - -Adds --bindir, and: - -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 assumes absolute paths start with '/', which may break -windows platforms ---- - configure | 49 ++++++++++++++++------ - mk/host.mk | 6 ++- - mk/main.mk | 11 +++++ - mk/perf.mk | 4 +- - mk/prepare.mk | 4 +- - src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- - src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 90 insertions(+), 71 deletions(-) - -diff --git a/configure b/configure -index 2d03b5f..3bc3178 100755 ---- a/configure -+++ b/configure -@@ -334,6 +334,31 @@ enable_if_not_disabled() { - fi - } - -+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 ;; -@@ -631,6 +656,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. -@@ -638,24 +665,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 -- CFG_LIBDIR_RELATIVE=lib - fi - --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_BINDIR_RELATIVE=bin -+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" - --CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -+# 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}") - - 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 ] -@@ -1742,6 +1766,7 @@ putvar CFG_PREFIX - putvar CFG_HOST - putvar CFG_TARGET - putvar CFG_LIBDIR_RELATIVE -+putvar CFG_BINDIR_RELATIVE - putvar CFG_DISABLE_MANAGE_SUBMODULES - putvar CFG_AARCH64_LINUX_ANDROID_NDK - putvar CFG_ARM_LINUX_ANDROIDEABI_NDK -diff --git a/mk/host.mk b/mk/host.mk -index 59a0095..b8e8345 100644 ---- a/mk/host.mk -+++ b/mk/host.mk -@@ -59,9 +59,13 @@ endef - # $(4) - the host triple (same as $(3)) - define CP_HOST_STAGE_N - --ifneq ($(CFG_LIBDIR_RELATIVE),bin) - $$(HLIB$(2)_H_$(4))/: - @mkdir -p $$@ -+ -+# Avoid redefinition warnings if libdir==bindir -+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) -+$$(HBIN$(2)_H_$(4))/: -+ @mkdir -p $$@ - endif - - endef -diff --git a/mk/main.mk b/mk/main.mk -index 64c3834..c8f6b90 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -350,7 +350,9 @@ export CFG_RELEASE_CHANNEL - export CFG_LLVM_ROOT - export CFG_PREFIX - export CFG_LIBDIR -+export CFG_BINDIR - export CFG_LIBDIR_RELATIVE -+export CFG_BINDIR_RELATIVE - export CFG_DISABLE_INJECT_STD_VERSION - ifdef CFG_DISABLE_UNSTABLE_FEATURES - CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -380,7 +382,16 @@ define SREQ - - # Destinations of artifacts for the host compiler - HROOT$(1)_H_$(3) = $(3)/stage$(1) -+ -+ifeq ($(1)-$(3),0-$$(CFG_BUILD)) -+# stage0 relative paths are fixed so we can bootstrap from snapshots -+# (downloaded snapshots drop their rustc in HROOT/bin) -+# libdir discrepancy is worked around with RUSTFLAGS below. - HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin -+else -+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) -+endif -+ - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) - - # Destinations of artifacts for target architectures -diff --git a/mk/perf.mk b/mk/perf.mk -index 16cbaab..f8a354c 100644 ---- a/mk/perf.mk -+++ b/mk/perf.mk -@@ -10,13 +10,13 @@ - - - ifdef CFG_PERF_TOOL --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - @$(call E, perf compile: $@) - $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 - $(Q)rm -f $(LIBRUSTC_GLOB) - else --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - $(Q)touch $@ - endif - -diff --git a/mk/prepare.mk b/mk/prepare.mk -index fe619cc..b8aa0cb 100644 ---- a/mk/prepare.mk -+++ b/mk/prepare.mk -@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ - define DEF_PREPARE - - prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) --prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man --prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) - 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 311ab1c..1b03b1a 100644 ---- a/src/librustc/metadata/filesearch.rs -+++ b/src/librustc/metadata/filesearch.rs -@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { - if !found { - let rustpath = rust_path(); - 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)); - -@@ -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 { - let mut p = PathBuf::from(self.sysroot); -- p.push(&find_libdir(self.sysroot)); -+ p.push(libdir_str()); - p.push(&rustlibdir()); - p.push(&self.triple); - p.push("bin"); -@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { - } - } - --pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { -- let mut p = PathBuf::from(&find_libdir(sysroot)); -+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { -+ let mut p = PathBuf::from(&libdir_str()); - assert!(p.is_relative()); - p.push(&rustlibdir()); - p.push(target_triple); -@@ -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 { -- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) -+ sysroot.join(&relative_target_lib_path(target_triple)) - } - --fn make_rustpkg_lib_path(sysroot: &Path, -- dir: &Path, -+fn make_rustpkg_lib_path(dir: &Path, - triple: &str) -> PathBuf { -- let mut p = dir.join(&find_libdir(sysroot)); -+ let mut p = dir.join(libdir_str()); - p.push(triple); - p - } - -+pub fn bindir_relative_str() -> &'static str { -+ env!("CFG_BINDIR_RELATIVE") -+} -+ -+pub fn bindir_relative_path() -> PathBuf { -+ 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) -> Option { -@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { - } - - match canonicalize(env::current_exe().ok()) { -- Some(mut p) => { p.pop(); p.pop(); p } -+ Some(mut p) => { -+ // 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() { -+ p.pop(); -+ } -+ p -+ } - None => panic!("can't determine value for sysroot") - } - } -@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { - env_rust_path - } - --// The name of the directory rustc expects libraries to be located. --// On Unix should be "lib", on windows "bin" --#[cfg(unix)] --fn find_libdir(sysroot: &Path) -> String { -- // FIXME: This is a quick hack to make the rustc binary able to locate -- // Rust libraries in Linux environments where libraries might be installed -- // to lib64/lib32. This would be more foolproof by basing the sysroot off -- // of the directory where librustc is located, rather than where the rustc -- // binary is. -- //If --libdir is set during configuration to the value other than -- // "lib" (i.e. non-default), this value is used (see issue #16552). -- -- match option_env!("CFG_LIBDIR_RELATIVE") { -- Some(libdir) if libdir != "lib" => return libdir.to_string(), -- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { -- return primary_libdir_name(); -- } else { -- return secondary_libdir_name(); -- } -- } -- -- #[cfg(target_pointer_width = "64")] -- fn primary_libdir_name() -> String { -- "lib64".to_string() -- } -- -- #[cfg(target_pointer_width = "32")] -- fn primary_libdir_name() -> String { -- "lib32".to_string() -- } -- -- fn secondary_libdir_name() -> String { -- "lib".to_string() -- } --} -- --#[cfg(windows)] --fn find_libdir(_sysroot: &Path) -> String { -- "bin".to_string() --} -- - // 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 d5486e8..af943ca 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -1016,11 +1016,10 @@ fn link_args(cmd: &mut Linker, - // 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 mut 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); - let mut path = PathBuf::from(install_prefix); - path.push(&tlib); - --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch deleted file mode 100644 index 35a2804..0000000 --- a/recipes/rust/files/rust-1.4.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 07386b867dfe059430f3145c3d2c8d5da84c4c69 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 3 Dec 2014 19:15:19 -0500 -Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle - ---- - src/libstd/thread/local.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs -index c204f79..b2f6f1d 100644 ---- a/src/libstd/thread/local.rs -+++ b/src/libstd/thread/local.rs -@@ -338,7 +338,7 @@ mod imp { - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const libc::c_void; - } -- if !__cxa_thread_atexit_impl.is_null() { -+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; --- -2.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch deleted file mode 100644 index 1dee032..0000000 --- a/recipes/rust/files/rust-1.4.0/0007-mk-install-use-disable-rewrite-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 82fa132a53257b9a787a5035ddaf9dc2adcd7a3e Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 2 Mar 2015 13:34:59 -0500 -Subject: [PATCH 7/9] mk/install: use disable-rewrite-paths - -This stops the install scripts from doing work we've already handled. - -Path rewriting is only useful for prepackaged binary installers. ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index cabc97a..273bb0e 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" -+ $(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)" -+ $(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 - -@@ -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)" --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)" -+ $(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.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch deleted file mode 100644 index 0a2b5e6..0000000 --- a/recipes/rust/files/rust-1.4.0/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b13d17f8a095174f34b17f8194e631209da2e17e Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 8/9] install: disable ldconfig - ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 273bb0e..58cfc99 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" --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)" --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 - -@@ -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)" --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)" --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.6.2 - diff --git a/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch deleted file mode 100644 index cf5d6b4..0000000 --- a/recipes/rust/files/rust-1.4.0/0009-Remove-crate-metadata-from-symbol-hashing.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 22be794babc407227500d54e14638efe96b1eaf6 Mon Sep 17 00:00:00 2001 -From: Steven Walter -Date: Tue, 7 Jul 2015 14:57:42 -0400 -Subject: [PATCH 9/9] Remove crate metadata from symbol hashing - ---- - src/librustc_trans/back/link.rs | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index af943ca..84a275c 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -210,11 +210,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>, - symbol_hasher.reset(); - symbol_hasher.input_str(&link_meta.crate_name); - symbol_hasher.input_str("-"); -- symbol_hasher.input_str(link_meta.crate_hash.as_str()); -- for meta in tcx.sess.crate_metadata.borrow().iter() { -- symbol_hasher.input_str(&meta[..]); -- } -- symbol_hasher.input_str("-"); - symbol_hasher.input_str(&encoder::encoded_ty(tcx, t)); - // Prefix with 'h' so that it never blends into adjacent digits - let mut hash = String::from("h"); --- -2.6.2 - diff --git a/recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch deleted file mode 100644 index 2f4f706..0000000 --- a/recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 237f665afaf7ec35f067ede4c09a013e86ad12c4 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Sat, 15 Nov 2014 20:12:48 -0500 -Subject: [PATCH 1/8] 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 8a5e58c..e2c3d8f 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -14,7 +14,9 @@ - # would create a variable HOST_i686-darwin-macos with the value - # i386. - define DEF_HOST_VAR -- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) -+ HOST_$(1) = $(subst i686,i386,\ -+ $(subst i586,i386,\ -+ $(word 1,$(subst -, ,$(1))))) - endef - $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) - $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch deleted file mode 100644 index 7c0aee1..0000000 --- a/recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 221ff5acf7b3b176882908d2f7010784614005e8 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 01:40:21 -0500 -Subject: [PATCH 2/8] 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 | 14 +++++++++++--- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index c6ce3a2..51152c7 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -38,7 +38,7 @@ use getopts; - use std::collections::HashMap; - use std::env; - use std::fmt; --use std::path::PathBuf; -+use std::path::{Path, PathBuf}; - - use llvm; - -@@ -651,8 +651,8 @@ 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[..]) { - Ok(t) => t, - Err(e) => { - sp.handler().fatal(&format!("Error loading target specification: {}", e)); -diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index 6b5f587..4432440 100644 ---- a/src/librustc/session/mod.rs -+++ b/src/librustc/session/mod.rs -@@ -381,14 +381,18 @@ pub fn build_session_(sopts: config::Options, - local_crate_source_file: Option, - span_diagnostic: diagnostic::SpanHandler) - -> Session { -- let host = match Target::search(config::host_triple()) { -+ let sysroot = match sopts.maybe_sysroot { -+ Some(ref x) => PathBuf::from(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::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 402fbcd..a211b84 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; - use std::default::Default; - use std::io::prelude::*; - use syntax::{diagnostic, abi}; -+use std::borrow::ToOwned; -+use std::path::Path; - - mod android_base; - mod apple_base; -@@ -306,12 +308,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 { -+ pub fn search(sysroot: &Path, target: &str) -> Result { - use std::env; - use std::ffi::OsString; - use std::fs::File; - use std::path::{Path, PathBuf}; - use serialize::json; -+ use std::iter::IntoIterator; - - fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -400,9 +403,14 @@ impl Target { - let target_path = env::var_os("RUST_TARGET_PATH") - .unwrap_or(OsString::new()); - -- // FIXME 16351: add a sane default search path? -+ 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() { - return load_file(&p); --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch deleted file mode 100644 index 82e78f9..0000000 --- a/recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 057d6be30ff1437a53132175720c96fa93826a08 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 14:52:56 -0500 -Subject: [PATCH 3/8] 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 -the place requested by configure, use '-L' and '--sysroot' to point -stage0-rustc at the appropriate location. ---- - mk/main.mk | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mk/main.mk b/mk/main.mk -index 3926119..165afc3 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -370,21 +370,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 --ifeq ($$(CFG_WINDOWSY_$(3)),1) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --else --ifeq ($(1),0) --HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib --else - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) --endif --endif - - # Destinations of artifacts for target architectures - TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) - TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin - TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib - -+# Don't trust stage0, be explicit about libraries -+# TODO: rather than specifying sysroot, we really want to tell which libdir to -+# use (ie: the dir containing 'rustlib'). This would allow us to avoid -+# passing the '-L' options. -+ifeq ($(1),0) -+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \ -+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))" -+endif -+ - # Preqrequisites for using the stageN compiler - ifeq ($(1),0) - HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -496,6 +497,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - PERF_STAGE$(1)_T_$(2)_H_$(3) := \ -@@ -504,6 +506,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)) \ -+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \ - $$(RUSTC_FLAGS_$(2)) - - endef --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch deleted file mode 100644 index b14c735..0000000 --- a/recipes/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch +++ /dev/null @@ -1,27 +0,0 @@ -From af95f47a39a91a3e4a58b1df6c48bc4e010520c6 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 18 Nov 2014 13:48:14 -0500 -Subject: [PATCH 4/8] 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 d9c66e2..585206d 100644 ---- a/mk/grammar.mk -+++ b/mk/grammar.mk -@@ -11,8 +11,8 @@ - BG = $(CFG_BUILD_DIR)/grammar/ - SG = $(S)src/grammar/ - B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/ --L = $(B)lib/rustlib/$(CFG_BUILD)/lib --LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/ -+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)) - ifeq ($(CFG_OSTYPE),apple-darwin) - FLEX_LDFLAGS=-ll --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch deleted file mode 100644 index 0002ef8..0000000 --- a/recipes/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 64dcf50a8a0f3aaf37ec6e4fe6143d0832592c05 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 24 Nov 2014 13:10:15 -0500 -Subject: [PATCH 5/8] configure: support --bindir, and extend libdir to - non-blessed dirs - -Adds --bindir, and: - -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 assumes absolute paths start with '/', which may break -windows platforms ---- - configure | 49 ++++++++++++++++------ - mk/host.mk | 6 ++- - mk/main.mk | 11 +++++ - mk/perf.mk | 4 +- - mk/prepare.mk | 4 +- - src/librustc/metadata/filesearch.rs | 84 ++++++++++++++----------------------- - src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 90 insertions(+), 71 deletions(-) - -diff --git a/configure b/configure -index 891f524..441793c 100755 ---- a/configure -+++ b/configure -@@ -323,6 +323,31 @@ envopt() { - fi - } - -+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 ;; -@@ -609,6 +634,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. -@@ -616,24 +643,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 -- CFG_LIBDIR_RELATIVE=lib - fi - --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_BINDIR_RELATIVE=bin -+valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" - --CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -+# 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}") - - 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 ] -@@ -1588,6 +1612,7 @@ putvar CFG_PREFIX - putvar CFG_HOST - putvar CFG_TARGET - putvar CFG_LIBDIR_RELATIVE -+putvar CFG_BINDIR_RELATIVE - putvar CFG_DISABLE_MANAGE_SUBMODULES - putvar CFG_ANDROID_CROSS_PATH - putvar CFG_MANDIR -diff --git a/mk/host.mk b/mk/host.mk -index 59a0095..b8e8345 100644 ---- a/mk/host.mk -+++ b/mk/host.mk -@@ -59,9 +59,13 @@ endef - # $(4) - the host triple (same as $(3)) - define CP_HOST_STAGE_N - --ifneq ($(CFG_LIBDIR_RELATIVE),bin) - $$(HLIB$(2)_H_$(4))/: - @mkdir -p $$@ -+ -+# Avoid redefinition warnings if libdir==bindir -+ifneq ($(HBIN$(2)_H_$(4)),$(HLIB$(2)_H_$(4))) -+$$(HBIN$(2)_H_$(4))/: -+ @mkdir -p $$@ - endif - - endef -diff --git a/mk/main.mk b/mk/main.mk -index 165afc3..33f9545 100644 ---- a/mk/main.mk -+++ b/mk/main.mk -@@ -339,7 +339,9 @@ export CFG_RELEASE_CHANNEL - export CFG_LLVM_ROOT - export CFG_PREFIX - export CFG_LIBDIR -+export CFG_BINDIR - export CFG_LIBDIR_RELATIVE -+export CFG_BINDIR_RELATIVE - export CFG_DISABLE_INJECT_STD_VERSION - ifdef CFG_DISABLE_UNSTABLE_FEATURES - CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -369,7 +371,16 @@ define SREQ - - # Destinations of artifacts for the host compiler - HROOT$(1)_H_$(3) = $(3)/stage$(1) -+ -+ifeq ($(1)-$(3),0-$$(CFG_BUILD)) -+# stage0 relative paths are fixed so we can bootstrap from snapshots -+# (downloaded snapshots drop their rustc in HROOT/bin) -+# libdir discrepancy is worked around with RUSTFLAGS below. - HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin -+else -+HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_BINDIR_RELATIVE) -+endif -+ - HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) - - # Destinations of artifacts for target architectures -diff --git a/mk/perf.mk b/mk/perf.mk -index 16cbaab..f8a354c 100644 ---- a/mk/perf.mk -+++ b/mk/perf.mk -@@ -10,13 +10,13 @@ - - - ifdef CFG_PERF_TOOL --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - @$(call E, perf compile: $@) - $(PERF_STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \ - -o $@ $(COMPILER_CRATE) >rustc-perf.err 2>&1 - $(Q)rm -f $(LIBRUSTC_GLOB) - else --rustc-perf$(X): $(CFG_BUILD)/stage2/bin/rustc$(X_$(CFG_BUILD)) -+rustc-perf$(X): $(CFG_BUILD)/stage2/$(CFG_BINDIR_RELATIVE)/rustc$(X_$(CFG_BUILD)) - $(Q)touch $@ - endif - -diff --git a/mk/prepare.mk b/mk/prepare.mk -index fe619cc..b8aa0cb 100644 ---- a/mk/prepare.mk -+++ b/mk/prepare.mk -@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ - define DEF_PREPARE - - prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) --prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -+prepare-base-$(1): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) - prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man --prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -+prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_BINDIR_RELATIVE) - prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) - 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 311ab1c..1b03b1a 100644 ---- a/src/librustc/metadata/filesearch.rs -+++ b/src/librustc/metadata/filesearch.rs -@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> { - if !found { - let rustpath = rust_path(); - 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)); - -@@ -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 { - let mut p = PathBuf::from(self.sysroot); -- p.push(&find_libdir(self.sysroot)); -+ p.push(libdir_str()); - p.push(&rustlibdir()); - p.push(&self.triple); - p.push("bin"); -@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> { - } - } - --pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { -- let mut p = PathBuf::from(&find_libdir(sysroot)); -+pub fn relative_target_lib_path(target_triple: &str) -> PathBuf { -+ let mut p = PathBuf::from(&libdir_str()); - assert!(p.is_relative()); - p.push(&rustlibdir()); - p.push(target_triple); -@@ -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 { -- sysroot.join(&relative_target_lib_path(sysroot, target_triple)) -+ sysroot.join(&relative_target_lib_path(target_triple)) - } - --fn make_rustpkg_lib_path(sysroot: &Path, -- dir: &Path, -+fn make_rustpkg_lib_path(dir: &Path, - triple: &str) -> PathBuf { -- let mut p = dir.join(&find_libdir(sysroot)); -+ let mut p = dir.join(libdir_str()); - p.push(triple); - p - } - -+pub fn bindir_relative_str() -> &'static str { -+ env!("CFG_BINDIR_RELATIVE") -+} -+ -+pub fn bindir_relative_path() -> PathBuf { -+ 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) -> Option { -@@ -202,7 +212,18 @@ pub fn get_or_default_sysroot() -> PathBuf { - } - - match canonicalize(env::current_exe().ok()) { -- Some(mut p) => { p.pop(); p.pop(); p } -+ Some(mut p) => { -+ // 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() { -+ p.pop(); -+ } -+ p -+ } - None => panic!("can't determine value for sysroot") - } - } -@@ -257,47 +278,6 @@ pub fn rust_path() -> Vec { - env_rust_path - } - --// The name of the directory rustc expects libraries to be located. --// On Unix should be "lib", on windows "bin" --#[cfg(unix)] --fn find_libdir(sysroot: &Path) -> String { -- // FIXME: This is a quick hack to make the rustc binary able to locate -- // Rust libraries in Linux environments where libraries might be installed -- // to lib64/lib32. This would be more foolproof by basing the sysroot off -- // of the directory where librustc is located, rather than where the rustc -- // binary is. -- //If --libdir is set during configuration to the value other than -- // "lib" (i.e. non-default), this value is used (see issue #16552). -- -- match option_env!("CFG_LIBDIR_RELATIVE") { -- Some(libdir) if libdir != "lib" => return libdir.to_string(), -- _ => if sysroot.join(&primary_libdir_name()).join(&rustlibdir()).exists() { -- return primary_libdir_name(); -- } else { -- return secondary_libdir_name(); -- } -- } -- -- #[cfg(target_pointer_width = "64")] -- fn primary_libdir_name() -> String { -- "lib64".to_string() -- } -- -- #[cfg(target_pointer_width = "32")] -- fn primary_libdir_name() -> String { -- "lib32".to_string() -- } -- -- fn secondary_libdir_name() -> String { -- "lib".to_string() -- } --} -- --#[cfg(windows)] --fn find_libdir(_sysroot: &Path) -> String { -- "bin".to_string() --} -- - // 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 6b8b59d..6e03f3c 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -997,11 +997,10 @@ fn link_args(cmd: &mut Linker, - // 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 mut 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); - let mut path = PathBuf::from(install_prefix); - path.push(&tlib); - --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch deleted file mode 100644 index 531fe57..0000000 --- a/recipes/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fb56f1fa6d0bdc62f7fd0c480446255698dc1635 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Wed, 3 Dec 2014 19:15:19 -0500 -Subject: [PATCH 6/8] std/thread_local: workaround for NULL __dso_handle - ---- - src/libstd/thread/local.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs -index 6056334..e79bd8b 100644 ---- a/src/libstd/thread/local.rs -+++ b/src/libstd/thread/local.rs -@@ -337,7 +337,7 @@ mod imp { - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const (); - } -- if !__cxa_thread_atexit_impl.is_null() { -+ if !__cxa_thread_atexit_impl.is_null() && !__dso_handle.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; --- -2.4.3 - diff --git a/recipes/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch deleted file mode 100644 index 5d4939a..0000000 --- a/recipes/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From de01acf6395a4c7f7d5c9d7ba251d9f2af570127 Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Mon, 2 Mar 2015 13:34:59 -0500 -Subject: [PATCH 7/8] mk/install: use disable-rewrite-paths - -This stops the install scripts from doing work we've already handled. - -Path rewriting is only useful for prepackaged binary installers. ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index cabc97a..273bb0e 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" -+ $(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)" -+ $(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 - -@@ -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)" --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)" -+ $(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.4.3 - diff --git a/recipes/rust/files/rust-git/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust-git/0008-install-disable-ldconfig.patch deleted file mode 100644 index 0dbab24..0000000 --- a/recipes/rust/files/rust-git/0008-install-disable-ldconfig.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8b87c3e5a7181f828dee1c8c0598b1bafa9dd4cc Mon Sep 17 00:00:00 2001 -From: Cody P Schafer -Date: Tue, 26 May 2015 12:09:36 -0400 -Subject: [PATCH 8/8] install: disable ldconfig - ---- - mk/install.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/mk/install.mk b/mk/install.mk -index 273bb0e..58cfc99 100644 ---- a/mk/install.mk -+++ b/mk/install.mk -@@ -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)" --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)" --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 - -@@ -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)" --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)" --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.4.3 - diff --git a/recipes/rust/rust-1.2.0.inc b/recipes/rust/rust-1.2.0.inc deleted file mode 100644 index 26b79b0..0000000 --- a/recipes/rust/rust-1.2.0.inc +++ /dev/null @@ -1,17 +0,0 @@ -SRC_URI[rust.md5sum] = "e853b04d9da15055d1f8f33b45a1ae68" -SRC_URI[rust.sha256sum] = "ea6eb983daf2a073df57186a58f0d4ce0e85c711bec13c627a8c85d51b6a6d78" - -## snapshot info taken from rust/src/snapshots.txt -## TODO: find a way to add aditional SRC_URIs based on the contents of an -## earlier SRC_URI. -RS_DATE = "2015-05-24" -RS_SRCHASH = "ba0e1cd" -# linux-x86_64 -RS_ARCH = "linux-x86_64" -RS_HASH = "5fd8698fdfe953e6c4d86cf4fa1d5f3a0053248c" -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "04deb393c39d43a2abc68ebac6a0bad2" -SRC_URI[rust-snapshot.sha256sum] = "11f7f56320bd0dff5b47bae3f80377d9514a3ad4bc983d674eb33074c95d66a0" - -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3" diff --git a/recipes/rust/rust-1.3.0.inc b/recipes/rust/rust-1.3.0.inc deleted file mode 100644 index 3dc0142..0000000 --- a/recipes/rust/rust-1.3.0.inc +++ /dev/null @@ -1,17 +0,0 @@ -SRC_URI[rust.md5sum] = "ffb3971cc96eccaf2de202f621fd415f" -SRC_URI[rust.sha256sum] = "ea02d7bc9e7de5b8be3fe6b37ea9b2bd823f9a532c8e4c47d02f37f24ffa3126" - -## snapshot info taken from rust/src/snapshots.txt -## TODO: find a way to add aditional SRC_URIs based on the contents of an -## earlier SRC_URI. -RS_DATE = "2015-07-26" -RS_SRCHASH = "a5c12f4" -# linux-x86_64 -RS_ARCH = "linux-x86_64" -RS_HASH = "e451e3bd6e5fcef71e41ae6f3da9fb1cf0e13a0c" -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "8f804ec5cebf370c59563a2b35a808cb" -SRC_URI[rust-snapshot.sha256sum] = "779943595dd63d6869c747e2a31c13095f9c5354d4530327d6f9310cc580c2ff" - -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3" diff --git a/recipes/rust/rust-1.4.0.inc b/recipes/rust/rust-1.4.0.inc deleted file mode 100644 index cb7b053..0000000 --- a/recipes/rust/rust-1.4.0.inc +++ /dev/null @@ -1,5 +0,0 @@ -SRC_URI[rust.md5sum] = "53907e4b819872bd256df8edc0d9f064" -SRC_URI[rust.sha256sum] = "1c0dfdce5c85d8098fcebb9adf1493847ab40c1dfaa8cc997af09b2ef0aa8211" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" - -require rust-snapshot-2015-08-11.inc diff --git a/recipes/rust/rust-llvm_1.1.0.bb b/recipes/rust/rust-llvm_1.1.0.bb deleted file mode 100644 index fb08854..0000000 --- a/recipes/rust/rust-llvm_1.1.0.bb +++ /dev/null @@ -1,8 +0,0 @@ -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" - -# 1.1.0 -require rust-release.inc -SRC_URI[rust.md5sum] = "5f2f923f8d1c77a55721d1f0813a158a" -SRC_URI[rust.sha256sum] = "cb09f443b37ec1b81fe73c04eb413f9f656859cf7d00bc5088008cbc2a63fa8a" - -require rust-llvm.inc diff --git a/recipes/rust/rust-llvm_1.2.0.bb b/recipes/rust/rust-llvm_1.2.0.bb deleted file mode 100644 index 073c48a..0000000 --- a/recipes/rust/rust-llvm_1.2.0.bb +++ /dev/null @@ -1,5 +0,0 @@ -require rust-release.inc -require rust-1.2.0.inc -require rust-llvm.inc - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" diff --git a/recipes/rust/rust-llvm_1.3.0.bb b/recipes/rust/rust-llvm_1.3.0.bb deleted file mode 100644 index f6a9869..0000000 --- a/recipes/rust/rust-llvm_1.3.0.bb +++ /dev/null @@ -1,5 +0,0 @@ -require rust-release.inc -require rust-${PV}.inc -require rust-llvm.inc - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" diff --git a/recipes/rust/rust-llvm_1.4.0.bb b/recipes/rust/rust-llvm_1.4.0.bb deleted file mode 100644 index f1e2660..0000000 --- a/recipes/rust/rust-llvm_1.4.0.bb +++ /dev/null @@ -1,11 +0,0 @@ -require rust-release.inc -require rust-${PV}.inc -require rust-llvm.inc - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" - -do_install_append () { - cd "${B}" - install -d "${D}${bindir}" - install -m755 "Release/bin/FileCheck" "${D}${bindir}" -} diff --git a/recipes/rust/rust_1.1.0.bb b/recipes/rust/rust_1.1.0.bb deleted file mode 100644 index 48c5b73..0000000 --- a/recipes/rust/rust_1.1.0.bb +++ /dev/null @@ -1,34 +0,0 @@ -# 1.1.0 -require rust-release.inc -require rust.inc -SRC_URI[rust.md5sum] = "5f2f923f8d1c77a55721d1f0813a158a" -SRC_URI[rust.sha256sum] = "cb09f443b37ec1b81fe73c04eb413f9f656859cf7d00bc5088008cbc2a63fa8a" - -## snapshot info taken from rust/src/snapshots.txt -## TODO: find a way to add aditional SRC_URIs based on the contents of an -## earlier SRC_URI. -RS_DATE = "2015-04-27" -RS_SRCHASH = "857ef6e" -# linux-x86_64 -RS_HASH = "94089740e48167c5975c92c139ae9c286764012f" -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-linux-x86_64-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "e0d49475a787aaa9481ec0b1a28d1f7a" -SRC_URI[rust-snapshot.sha256sum] = "e7858a90c2c6c35299ebe2cb6425f3f84d0ba171dcbce20ff68295a1ff75c7e5" - -# "patch-prefix" -PP = "rust-${PV}" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ - file://${PP}/0009-src-rt-arch-i386-morestack.S-call-rust_stack_exhaust.patch \ - file://${PP}/0010-disable-symbol-version-hashing.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" diff --git a/recipes/rust/rust_1.2.0.bb b/recipes/rust/rust_1.2.0.bb deleted file mode 100644 index 2339e1c..0000000 --- a/recipes/rust/rust_1.2.0.bb +++ /dev/null @@ -1,20 +0,0 @@ -require rust-release.inc -require rust.inc -require rust-1.2.0.inc - -# "patch-prefix" -PP = "rust-${PV}" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ - file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ - file://${PP}/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" diff --git a/recipes/rust/rust_1.3.0.bb b/recipes/rust/rust_1.3.0.bb deleted file mode 100644 index d330d33..0000000 --- a/recipes/rust/rust_1.3.0.bb +++ /dev/null @@ -1,20 +0,0 @@ -require rust-release.inc -require rust.inc -require rust-${PV}.inc - -# "patch-prefix" -PP = "rust-${PV}" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ - file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ - file://${PP}/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" diff --git a/recipes/rust/rust_1.4.0.bb b/recipes/rust/rust_1.4.0.bb deleted file mode 100644 index 2a2fdca..0000000 --- a/recipes/rust/rust_1.4.0.bb +++ /dev/null @@ -1,19 +0,0 @@ -require rust-release.inc -require rust.inc -require rust-${PV}.inc - -# "patch-prefix" -PP = "rust-${PV}" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ - file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" diff --git a/recipes/rust/rust_git.bb b/recipes/rust/rust_git.bb deleted file mode 100644 index c636af2..0000000 --- a/recipes/rust/rust_git.bb +++ /dev/null @@ -1,29 +0,0 @@ -# 2015-06-26 -SRCREV = "378a370ff2057afeb1eae86eb6e78c476866a4a6" -require rust-git.inc - -RS_DATE = "2015-05-24" -RS_SRCHASH = "ba0e1cd" -# linux-x86_64 -RS_HASH = "5fd8698fdfe953e6c4d86cf4fa1d5f3a0053248c" -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-linux-x86_64-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "e0d49475a787aaa9481ec0b1a28d1f7a" -SRC_URI[rust-snapshot.sha256sum] = "e7858a90c2c6c35299ebe2cb6425f3f84d0ba171dcbce20ff68295a1ff75c7e5" - -# "patch-prefix" -PP = "rust-git" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" - -DEFAULT_PREFERENCE = "-1" From 5dbe9be9a8d50b75faa018a72ae9177d89115080 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 3 Feb 2016 10:43:00 -0500 Subject: [PATCH 30/47] rust: switch to only supporting a single version at a time --- ...01-platform.mk-avoid-choking-on-i586.patch | 0 ...lt-target.json-path-libdir-rust-targ.patch | 0 ...e-RUSTFLAGS-to-override-target-libs-.patch | 0 ...4-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 0 ...t-bindir-and-extend-libdir-to-non-bl.patch | 0 ...cal-workaround-for-NULL-__dso_handle.patch | 0 ...mk-install-use-disable-rewrite-paths.patch | 0 .../0008-install-disable-ldconfig.patch | 0 ...e-crate-metadata-from-symbol-hashing.patch | 0 recipes/rust/rust-git.inc | 7 ------- .../rust/{rust-llvm_1.5.0.bb => rust-llvm.bb} | 2 +- .../rust/{rust-1.5.0.inc => rust-version.inc} | 1 + recipes/rust/rust.bb | 17 +++++++++++++++++ recipes/rust/rust_1.5.0.bb | 19 ------------------- 14 files changed, 19 insertions(+), 27 deletions(-) rename recipes/rust/files/{rust-1.5.0 => rust}/0001-platform.mk-avoid-choking-on-i586.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0007-mk-install-use-disable-rewrite-paths.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0008-install-disable-ldconfig.patch (100%) rename recipes/rust/files/{rust-1.5.0 => rust}/0009-Remove-crate-metadata-from-symbol-hashing.patch (100%) delete mode 100644 recipes/rust/rust-git.inc rename recipes/rust/{rust-llvm_1.5.0.bb => rust-llvm.bb} (90%) rename recipes/rust/{rust-1.5.0.inc => rust-version.inc} (95%) create mode 100644 recipes/rust/rust.bb delete mode 100644 recipes/rust/rust_1.5.0.bb diff --git a/recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch b/recipes/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0001-platform.mk-avoid-choking-on-i586.patch rename to recipes/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch diff --git a/recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch rename to recipes/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch diff --git a/recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch rename to recipes/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch diff --git a/recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch rename to recipes/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch diff --git a/recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch rename to recipes/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch diff --git a/recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch rename to recipes/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch diff --git a/recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch b/recipes/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0007-mk-install-use-disable-rewrite-paths.patch rename to recipes/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch diff --git a/recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch b/recipes/rust/files/rust/0008-install-disable-ldconfig.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0008-install-disable-ldconfig.patch rename to recipes/rust/files/rust/0008-install-disable-ldconfig.patch diff --git a/recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch similarity index 100% rename from recipes/rust/files/rust-1.5.0/0009-Remove-crate-metadata-from-symbol-hashing.patch rename to recipes/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch diff --git a/recipes/rust/rust-git.inc b/recipes/rust/rust-git.inc deleted file mode 100644 index 831ee68..0000000 --- a/recipes/rust/rust-git.inc +++ /dev/null @@ -1,7 +0,0 @@ -SRC_URI = "\ - gitsm://github.com/rust-lang/rust.git;protocol=https \ -" -S = "${WORKDIR}/git" -PV .= "+git${SRCPV}" -require rust.inc - diff --git a/recipes/rust/rust-llvm_1.5.0.bb b/recipes/rust/rust-llvm.bb similarity index 90% rename from recipes/rust/rust-llvm_1.5.0.bb rename to recipes/rust/rust-llvm.bb index f1e2660..914f468 100644 --- a/recipes/rust/rust-llvm_1.5.0.bb +++ b/recipes/rust/rust-llvm.bb @@ -1,5 +1,5 @@ require rust-release.inc -require rust-${PV}.inc +require rust-version.inc require rust-llvm.inc LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" diff --git a/recipes/rust/rust-1.5.0.inc b/recipes/rust/rust-version.inc similarity index 95% rename from recipes/rust/rust-1.5.0.inc rename to recipes/rust/rust-version.inc index 117b8b8..f691fd3 100644 --- a/recipes/rust/rust-1.5.0.inc +++ b/recipes/rust/rust-version.inc @@ -1,3 +1,4 @@ +PV = "1.5.0" SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485" SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0" LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" diff --git a/recipes/rust/rust.bb b/recipes/rust/rust.bb new file mode 100644 index 0000000..85d7cd1 --- /dev/null +++ b/recipes/rust/rust.bb @@ -0,0 +1,17 @@ +require rust-release.inc +require rust.inc +require rust-version.inc + +SRC_URI_append = "\ + file://rust/0001-platform.mk-avoid-choking-on-i586.patch \ + file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ + file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ + file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ + file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ + file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ + file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ + file://rust/0008-install-disable-ldconfig.patch \ + file://rust/0009-Remove-crate-metadata-from-symbol-hashing.patch \ +\ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ +" diff --git a/recipes/rust/rust_1.5.0.bb b/recipes/rust/rust_1.5.0.bb deleted file mode 100644 index 2a2fdca..0000000 --- a/recipes/rust/rust_1.5.0.bb +++ /dev/null @@ -1,19 +0,0 @@ -require rust-release.inc -require rust.inc -require rust-${PV}.inc - -# "patch-prefix" -PP = "rust-${PV}" -SRC_URI_append = "\ - file://${PP}/0001-platform.mk-avoid-choking-on-i586.patch \ - file://${PP}/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://${PP}/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://${PP}/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://${PP}/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://${PP}/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://${PP}/0007-mk-install-use-disable-rewrite-paths.patch \ - file://${PP}/0008-install-disable-ldconfig.patch \ - file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" From 3a832dd4397e8bc53f229ff8de142b76443ea130 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Wed, 18 Nov 2015 08:43:15 -0500 Subject: [PATCH 31/47] rust: force crate hash to use bitbake input hash This should eliminate the problems that have been seen when bitbake rebuilds part of the rust stack (due to missing sstate) and ends up getting hash mismatches. Unlike rust's internally generated hash, ours is guaranteed to be stable. --- classes/rust.bbclass | 2 +- ...rriding-crate_hash-with-C-crate_hash.patch | 78 +++++++++++++++++++ ...tform.mk-pass-C-crate_hash-to-builds.patch | 25 ++++++ recipes/rust/rust.inc | 2 + recipes/rust/rust_1.5.0.bb | 2 + 5 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 recipes/rust/files/rust-1.5.0/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch create mode 100644 recipes/rust/files/rust-1.5.0/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch diff --git a/classes/rust.bbclass b/classes/rust.bbclass index 7b71197..5270fc5 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -1,7 +1,7 @@ RUSTC = "rustc" # FIXME: --sysroot might be needed -RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} -C rpath" +RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} -C rpath -C crate_hash=${BB_TASKHASH}" def rust_base_dep(d): # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to diff --git a/recipes/rust/files/rust-1.5.0/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch b/recipes/rust/files/rust-1.5.0/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch new file mode 100644 index 0000000..724cbac --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch @@ -0,0 +1,78 @@ +From 128a81ede6b188637743a37a582b2267a49d0a32 Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Wed, 18 Nov 2015 08:33:26 -0500 +Subject: [PATCH 11/12] Allow overriding crate_hash with -C crate_hash + +The current crate hash is not stable from run-to-run. This causes +problems with bitbake; it needs a guarantee that every build with the +same input will generate compatible output, otherwise sstate won't work. +Using -C crate_hash, we can do that by using the bitbake input hash to +determine the crate hash; the bitbake input hash will be stable, but +still different for different rust recipes. +--- + src/librustc/session/config.rs | 2 ++ + src/librustc_trans/back/link.rs | 26 ++++++++++++++++++++++++-- + 2 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs +index b74b3c4..a11cb90 100644 +--- a/src/librustc/session/config.rs ++++ b/src/librustc/session/config.rs +@@ -500,6 +500,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options, + "choose the code model to use (llc -code-model for details)"), + metadata: Vec = (Vec::new(), parse_list, + "metadata to mangle symbol names with"), ++ crate_hash: String = ("".to_string(), parse_string, ++ "override crate hash with given value"), + extra_filename: String = ("".to_string(), parse_string, + "extra data to put in each output filename"), + codegen_units: usize = (1, parse_uint, +diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs +index 53fa913..83619ae 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -46,7 +46,7 @@ use std::str; + use flate; + use serialize::hex::ToHex; + use syntax::ast; +-use syntax::codemap::Span; ++use syntax::codemap::{Span,BytePos,NO_EXPANSION}; + use syntax::parse::token::{self, InternedString}; + use syntax::attr::AttrMetaMethods; + +@@ -185,9 +185,31 @@ pub fn find_crate_name(sess: Option<&Session>, + + pub fn build_link_meta(sess: &Session, krate: &hir::Crate, + name: &str) -> LinkMeta { ++ let crate_hash = if sess.opts.cg.crate_hash != "" { ++ let dummy_span = Span { ++ lo: BytePos(0), ++ hi: BytePos(0), ++ expn_id: NO_EXPANSION ++ }; ++ let dummy_module = hir::Mod { ++ inner: dummy_span, ++ items: vec!() ++ }; ++ let dummy_krate = hir::Crate { ++ module: dummy_module, ++ attrs: vec!(), ++ config: vec!(), ++ span: dummy_span, ++ exported_macros: vec!() ++ }; ++ ++ Svh::calculate(&vec!(sess.opts.cg.crate_hash.clone()), &dummy_krate) ++ } else { ++ Svh::calculate(&sess.opts.cg.metadata, krate) ++ }; + let r = LinkMeta { + crate_name: name.to_owned(), +- crate_hash: Svh::calculate(&sess.opts.cg.metadata, krate), ++ crate_hash: crate_hash, + }; + info!("{:?}", r); + return r; +-- +1.9.1 + diff --git a/recipes/rust/files/rust-1.5.0/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch b/recipes/rust/files/rust-1.5.0/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch new file mode 100644 index 0000000..1545448 --- /dev/null +++ b/recipes/rust/files/rust-1.5.0/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch @@ -0,0 +1,25 @@ +From d0fa41075317425b01262dd539c01e87e2eaf5f4 Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Wed, 18 Nov 2015 08:41:17 -0500 +Subject: [PATCH 12/12] mk/platform.mk: pass -C crate_hash to builds + +bitbake recipe will export FORCE_CRATE_HASH +--- + mk/platform.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mk/platform.mk b/mk/platform.mk +index 4681783..59aa560 100644 +--- a/mk/platform.mk ++++ b/mk/platform.mk +@@ -182,6 +182,7 @@ define CFG_MAKE_TOOLCHAIN + LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1)) + RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \ + -C objcopy=$$(call FIND_COMPILER,$$(OBJCOPY_$(1))) \ ++ -C crate_hash=$(FORCE_CRATE_HASH) \ + -C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1)) + + RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1)) +-- +1.9.1 + diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 8cdb726..e786ec8 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -29,6 +29,8 @@ SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://sta # We generate local targets, and need to be able to locate them export RUST_TARGET_PATH="${WORKDIR}/targets/" +export FORCE_CRATE_HASH="${BB_TASKHASH}" + ## arm-unknown-linux-gnueabihf DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" diff --git a/recipes/rust/rust_1.5.0.bb b/recipes/rust/rust_1.5.0.bb index dbe0641..49b12c8 100644 --- a/recipes/rust/rust_1.5.0.bb +++ b/recipes/rust/rust_1.5.0.bb @@ -15,6 +15,8 @@ SRC_URI_append = "\ file://${PP}/0008-install-disable-ldconfig.patch \ file://${PP}/0009-Remove-crate-metadata-from-symbol-hashing.patch \ file://${PP}/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \ + file://${PP}/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \ + file://${PP}/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ \ file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ " From ec117587bc8d042accaec89de60ff7284f611a8b Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 3 Feb 2016 16:15:05 -0500 Subject: [PATCH 32/47] cargo: use new snapshot to avoid issue with version parsing cargo issue: https://github.com/rust-lang/cargo/pull/2352 At the same time, fix our snapshot support & add a patch to disable auto-download of snapshots to ensure we don't accidentally break it again in the future. --- recipes/cargo/cargo-snapshot-2015-04-02.inc | 4 --- recipes/cargo/cargo-snapshot.inc | 4 +++ recipes/cargo/cargo.inc | 2 +- recipes/cargo/cargo_0.7.0.bb | 3 ++- .../0001-disable-cargo-snapshot-fetch.patch | 27 +++++++++++++++++++ 5 files changed, 34 insertions(+), 6 deletions(-) delete mode 100644 recipes/cargo/cargo-snapshot-2015-04-02.inc create mode 100644 recipes/cargo/cargo-snapshot.inc create mode 100644 recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch diff --git a/recipes/cargo/cargo-snapshot-2015-04-02.inc b/recipes/cargo/cargo-snapshot-2015-04-02.inc deleted file mode 100644 index c81fa79..0000000 --- a/recipes/cargo/cargo-snapshot-2015-04-02.inc +++ /dev/null @@ -1,4 +0,0 @@ - -CARGO_SNAPSHOT = "2015-04-02/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" -SRC_URI[md5sum] = "3d62194d02a9088cd8aae379e9498134" -SRC_URI[sha256sum] = "16b6338ba2942989693984ba4dbd057c2801e8805e6da8fa7b781b00e722d117" diff --git a/recipes/cargo/cargo-snapshot.inc b/recipes/cargo/cargo-snapshot.inc new file mode 100644 index 0000000..0ea10ee --- /dev/null +++ b/recipes/cargo/cargo-snapshot.inc @@ -0,0 +1,4 @@ + +CARGO_SNAPSHOT = "2016-01-31/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz" +SRC_URI[md5sum] = "52f48780b7cfadc88813766048d4d402" +SRC_URI[sha256sum] = "1920e661bab536eba763ff6704a1d62fb20bb0f67d8c5a119e41c49510ea5fa6" diff --git a/recipes/cargo/cargo.inc b/recipes/cargo/cargo.inc index bc38345..ca6a31f 100644 --- a/recipes/cargo/cargo.inc +++ b/recipes/cargo/cargo.inc @@ -54,7 +54,7 @@ do_compile () { rm -rf target/snapshot mkdir -p target - cp -R ${WORKDIR}/$(basename ${CARGO_SNAPSHOT} .tar.gz) target/snapshot + cp -R ${WORKDIR}/$(basename ${CARGO_SNAPSHOT} .tar.gz)/cargo target/snapshot oe_runmake ARGS="--verbose" } diff --git a/recipes/cargo/cargo_0.7.0.bb b/recipes/cargo/cargo_0.7.0.bb index 1fccc96..5dd94fc 100644 --- a/recipes/cargo/cargo_0.7.0.bb +++ b/recipes/cargo/cargo_0.7.0.bb @@ -1,8 +1,9 @@ -require cargo-snapshot-2015-04-02.inc +require cargo-snapshot.inc require cargo.inc SRC_URI += " \ https://github.com/rust-lang/cargo/archive/${PV}.tar.gz;name=cargo \ + file://0001-disable-cargo-snapshot-fetch.patch \ git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${BP}/src/rust-installer \ " SRC_URI[cargo.md5sum] = "2089790a4a48de7f8f3cb1afcfa9ec74" diff --git a/recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch b/recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch new file mode 100644 index 0000000..82fac10 --- /dev/null +++ b/recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch @@ -0,0 +1,27 @@ +From 9652ddba460f30e83f401ab1564656e7787bdea9 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Wed, 3 Feb 2016 15:59:48 -0500 +Subject: [PATCH] disable cargo snapshot fetch + +--- + Makefile.in | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 286a593..9c66486 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -92,10 +92,6 @@ test-unit-$(1): $$(CARGO) + endef + $(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target)))) + +-$(TARGET_ROOT)/snapshot/bin/cargo$(X): src/snapshots.txt +- $(CFG_PYTHON) src/etc/dl-snapshot.py $(CFG_BUILD) +- touch $@ +- + + # === Tests + +-- +2.7.0 + From ce1881d08cefe963843686f23ce593b0b6d2cd89 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 4 Feb 2016 12:40:22 -0500 Subject: [PATCH 33/47] rust: use a shared source location for all the packages needing the rustc source tree --- classes/shared-source-provide.bbclass | 38 ++ classes/shared-source-use.bbclass | 4 + ...g-the-platform-configuration-source-.patch | 56 +++ recipes/rust/rust-llvm.bb | 2 - recipes/rust/rust-llvm.inc | 3 +- recipes/rust/rust-shared-source.inc | 3 + recipes/rust/rust-source.bb | 31 ++ recipes/rust/rust-version.inc | 8 +- recipes/rust/rust.bb | 472 +++++++++++++++++- recipes/rust/rust.inc | 439 ---------------- 10 files changed, 591 insertions(+), 465 deletions(-) create mode 100644 classes/shared-source-provide.bbclass create mode 100644 classes/shared-source-use.bbclass create mode 100644 recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch create mode 100644 recipes/rust/rust-shared-source.inc create mode 100644 recipes/rust/rust-source.bb delete mode 100644 recipes/rust/rust.inc diff --git a/classes/shared-source-provide.bbclass b/classes/shared-source-provide.bbclass new file mode 100644 index 0000000..fc0cad2 --- /dev/null +++ b/classes/shared-source-provide.bbclass @@ -0,0 +1,38 @@ +# In order to share the same source between multiple packages (.bb files), we +# unpack and patch the X source here into a shared dir. +# +# Take a look at gcc-source.inc for the general structure of this + +# We require that "SOURCE_NAME" be set + +# nopackages.bbclass { +deltask do_package +deltask do_package_write_rpm +deltask do_package_write_ipk +deltask do_package_write_deb +deltask do_package_qa +deltask do_packagedata +#} + +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot +deltask do_populate_lic +deltask do_rm_work + + +# override to get rid of '-native' or other misc +# XXX: consider ${PR} +PN = "${SOURCE_NAME}-source-${PV}" +WORKDIR = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" +SSTATE_SWSPEC = "sstate:${SOURCE_NAME}::${PV}:${PR}::${SSTATE_VERSION}:" + +STAMP = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" +STAMPCLEAN = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-*" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "" +PACKAGES = "" + +EXCLUDE_FROM_WORLD = "1" diff --git a/classes/shared-source-use.bbclass b/classes/shared-source-use.bbclass new file mode 100644 index 0000000..7df9916 --- /dev/null +++ b/classes/shared-source-use.bbclass @@ -0,0 +1,4 @@ +S = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" + +do_configure[depends] += "${SOURCE_NAME}-source-${PV}:do_patch" +do_populate_lic[depends] += "${SOURCE_NAME}-source-${PV}:do_unpack" diff --git a/recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch b/recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch new file mode 100644 index 0000000..ec33481 --- /dev/null +++ b/recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch @@ -0,0 +1,56 @@ +From 1fbfa088007054c655741e547bb3e72f1d5f1746 Mon Sep 17 00:00:00 2001 +From: Cody P Schafer +Date: Thu, 4 Feb 2016 10:44:23 -0500 +Subject: [PATCH] mk: allow changing the platform configuration source + directory + +--- + configure | 4 +++- + mk/platform.mk | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 01c447b..0f004cf 100755 +--- a/configure ++++ b/configure +@@ -650,6 +650,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary" + valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples" + valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples" + valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH" ++valopt_nosave platform-cfg "${CFG_SRC_DIR}/mk/cfg" "Location platform configuration for non-rust code" + + # Temporarily support old triples until buildbots get updated + CFG_BUILD=$(to_llvm_triple $CFG_BUILD) +@@ -1110,7 +1111,7 @@ CFG_MANDIR=${CFG_MANDIR%/} + CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')" + CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')" + CFG_SUPPORTED_TARGET="" +-for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do ++for target_file in ${CFG_PLATFORM_CFG}/*.mk; do + CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)" + done + +@@ -1763,6 +1764,7 @@ putvar CFG_AARCH64_LINUX_ANDROID_NDK + putvar CFG_ARM_LINUX_ANDROIDEABI_NDK + putvar CFG_I686_LINUX_ANDROID_NDK + putvar CFG_MANDIR ++putvar CFG_PLATFORM_CFG + + # Avoid spurious warnings from clang by feeding it original source on + # ccache-miss rather than preprocessed input. +diff --git a/mk/platform.mk b/mk/platform.mk +index 59aa560..a964d6f 100644 +--- a/mk/platform.mk ++++ b/mk/platform.mk +@@ -112,7 +112,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \ + + CFG_RLIB_GLOB=lib$(1)-*.rlib + +-include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk) ++include $(wildcard $(CFG_PLATFORM_CFG)/*.mk) + + define ADD_INSTALLED_OBJECTS + INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) +-- +2.7.0 + diff --git a/recipes/rust/rust-llvm.bb b/recipes/rust/rust-llvm.bb index 914f468..62fb3d4 100644 --- a/recipes/rust/rust-llvm.bb +++ b/recipes/rust/rust-llvm.bb @@ -1,5 +1,3 @@ -require rust-release.inc -require rust-version.inc require rust-llvm.inc LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" diff --git a/recipes/rust/rust-llvm.inc b/recipes/rust/rust-llvm.inc index 388b991..06ee7ae 100644 --- a/recipes/rust/rust-llvm.inc +++ b/recipes/rust/rust-llvm.inc @@ -1,8 +1,9 @@ +require rust-shared-source.inc SUMMARY = "LLVM compiler framework (packaged with rust)" LICENSE = "NCSA" -S = "${WORKDIR}/rustc-${PV}/src/llvm" +S .= "/src/llvm" inherit autotools diff --git a/recipes/rust/rust-shared-source.inc b/recipes/rust/rust-shared-source.inc new file mode 100644 index 0000000..eeb066c --- /dev/null +++ b/recipes/rust/rust-shared-source.inc @@ -0,0 +1,3 @@ +inherit shared-source-use +require rust-version.inc +S .= "/rustc-${PV}" diff --git a/recipes/rust/rust-source.bb b/recipes/rust/rust-source.bb new file mode 100644 index 0000000..63d3792 --- /dev/null +++ b/recipes/rust/rust-source.bb @@ -0,0 +1,31 @@ +# In order to share the same source between multiple packages (.bb files), we +# unpack and patch the rustc source here into a shared dir. +# +# Take a look at gcc-source.inc for the general structure of this + +inherit shared-source-provide + +require rust-version.inc +require rust-release.inc + +SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485" +SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" + +SRC_URI_append = "\ + file://rust/0001-platform.mk-avoid-choking-on-i586.patch \ + file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ + file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ + file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ + file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ + file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ + file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ + file://rust/0008-install-disable-ldconfig.patch \ + file://rust/0009-Remove-crate-metadata-from-symbol-hashing.patch \ + file://rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \ + file://rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \ + file://rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ + file://rust/0013-mk-allow-changing-the-platform-configuration-source-.patch \ +\ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ +" diff --git a/recipes/rust/rust-version.inc b/recipes/rust/rust-version.inc index f691fd3..50ba9ad 100644 --- a/recipes/rust/rust-version.inc +++ b/recipes/rust/rust-version.inc @@ -1,6 +1,6 @@ +# Note: if you adjust this, you'll also need to change the hashes in +# rust-source.bb +SOURCE_NAME = "rust" PV = "1.5.0" -SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485" -SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" -require rust-snapshot-2015-08-11.inc +LICENSE = "MIT | Apache-2.0" diff --git a/recipes/rust/rust.bb b/recipes/rust/rust.bb index 740b0d4..bfbc1ba 100644 --- a/recipes/rust/rust.bb +++ b/recipes/rust/rust.bb @@ -1,20 +1,454 @@ -require rust-release.inc -require rust.inc -require rust-version.inc +inherit rust +inherit rust-installer +require rust-shared-source.inc +require rust-snapshot-2015-08-11.inc -SRC_URI_append = "\ - file://rust/0001-platform.mk-avoid-choking-on-i586.patch \ - file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ - file://rust/0008-install-disable-ldconfig.patch \ - file://rust/0009-Remove-crate-metadata-from-symbol-hashing.patch \ - file://rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch \ - file://rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \ - file://rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" +LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" + +SUMMARY = "Rust compiler and runtime libaries" +HOMEPAGE = "http://www.rust-lang.org" +SECTION = "devel" + +B = "${WORKDIR}/build" + +DEPENDS += "file-native" +DEPENDS += "rust-llvm" + +# Avoid having the default bitbake.conf disable sub-make parallelization +EXTRA_OEMAKE = "" + +PACKAGECONFIG ??= "" + +# Controls whether we use the local rust to build. +# By default, we use the rust-snapshot. In some cases (non-supported host +# systems) this may not be possible. In other cases, it might be desirable +# to have rust-cross built using rust-native. +PACKAGECONFIG[local-rust] = "" + +SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0;name=rust-snapshot', d)}" + +# We generate local targets, and need to be able to locate them +export RUST_TARGET_PATH="${WORKDIR}/targets/" + +export FORCE_CRATE_HASH="${BB_TASKHASH}" + +## arm-unknown-linux-gnueabihf +DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" +LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" +TARGET_ENDIAN[arm] = "little" +TARGET_POINTER_WIDTH[arm] = "32" +FEATURES[arm] = "+v6,+vfp2" +PRE_LINK_ARGS[arm] = "-Wl,--as-needed" + +DATA_LAYOUT[aarch64] = "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-n32:64-S128" +LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" +TARGET_ENDIAN[aarch64] = "little" +TARGET_POINTER_WIDTH[aarch64] = "64" +PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" + +## x86_64-unknown-linux-gnu +DATA_LAYOUT[x86_64] = "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] = "x86_64-unknown-linux-gnu" +TARGET_ENDIAN[x86_64] = "little" +TARGET_POINTER_WIDTH[x86_64] = "64" +PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64" + +## i686-unknown-linux-gnu +DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" +LLVM_TARGET[i686] = "i686-unknown-linux-gnu" +TARGET_ENDIAN[i686] = "little" +TARGET_POINTER_WIDTH[i686] = "32" +PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32" + +## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above +DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" +LLVM_TARGET[i586] = "i586-unknown-linux-gnu" +TARGET_ENDIAN[i586] = "little" +TARGET_POINTER_WIDTH[i586] = "32" +PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32" + +# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as +# DT_RPATH), which lets LD_LIBRARY_PATH override them +RPATH_LDFLAGS = "-Wl,--enable-new-dtags" +TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" + +# These LDFLAGS have '-L' options in them. We need these to come last so they +# don't screw up the link order and pull in the wrong rust build/version. +# TODO: may want to strip out all the '-L' flags entirely here +TARGET_POST_LINK_ARGS = "${TARGET_LDFLAGS}" +BUILD_POST_LINK_ARGS = "${BUILD_LDFLAGS}" +HOST_POST_LINK_ARGS = "${HOST_LDFLAGS}" + +def arch_for(d, thing): + return d.getVar('{}_ARCH'.format(thing), True) + +def sys_for(d, thing): + return d.getVar('{}_SYS'.format(thing), True) + +def prefix_for(d, thing): + return d.getVar('{}_PREFIX'.format(thing), True) + +## Note: TOOLCHAIN_OPTIONS is set to "" by native.bbclass and cross.bbclass, +## which prevents us from grabbing them when building a cross compiler (native doesn't matter). +## We workaround this in internal-rust-cross.bbclass. +def cflags_for(d, thing): + cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" + flags = d.getVar('{}_CFLAGS'.format(thing), True) or "" + tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" + return ' '.join([cc_arch, flags, tc]) + +def cxxflags_for(d, thing): + cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" + flags = d.getVar('{}_CXXFLAGS'.format(thing), True) or "" + tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" + return ' '.join([cc_arch, flags, tc]) + +# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something +# rust's internals won't choke on. +def arch_to_rust_target_arch(arch): + if arch == "i586" or arch == "i686": + return "x86" + else: + return arch + +def as_json(list_): + a = '[' + for e in list_: + if type(e) == str: + a += '"{}",'.format(e) + else: + raise Exception + if len(list_): + a = a[:-1] + a += ']' + return a + +def post_link_args_for(d, thing, arch): + post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() + post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) + return post_link_args + +def pre_link_args_for(d, thing, arch): + ldflags = (d.getVar('{}_PRE_LINK_ARGS'.format(thing), True) or "").split() + ldflags.extend((d.getVarFlag('PRE_LINK_ARGS', arch, True) or "").split()) + return ldflags + +def ldflags_for(d, thing, arch): + a = pre_link_args_for(d, thing, arch) + a.extend(post_link_args_for(d, thing, arch)) + return a + +def rust_gen_target(d, thing, wd): + arch = arch_for(d, thing) + sys = sys_for(d, thing) + prefix = prefix_for(d, thing) + o = open(wd + sys + '.json', 'w') + + data_layout = d.getVarFlag('DATA_LAYOUT', arch, True) + if not data_layout: + bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing)) + llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) + target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) + endian = d.getVarFlag('TARGET_ENDIAN', arch, True) + prefix = d.getVar('{}_PREFIX'.format(thing), True) + ccache = d.getVar('CCACHE', True) + linker = "{}{}gcc".format(ccache, prefix) + objcopy = "{}objcopy".format(prefix) + features = d.getVarFlag('FEATURES', arch, True) or "" + + pre_link_args = pre_link_args_for(d, thing, arch) + post_link_args = post_link_args_for(d, thing, arch) + + o.write('''{{ + "data-layout": "{}", + "llvm-target": "{}", + "target-endian": "{}", + "target-word-size": "{}", + "target-pointer-width": "{}", + "arch": "{}", + "os": "linux", + "linker": "{}", + "objcopy": "{}", + "features": "{}", + "dynamic-linking": true, + "executables": true, + "morestack": true, + "linker-is-gnu": true, + "has-rpath": true, + "position-independent-executables": true, + "pre-link-args": {}, + "post-link-args": {} + }}'''.format( + data_layout, + llvm_target, + endian, + target_pointer_width, + target_pointer_width, + arch_to_rust_target_arch(arch), + linker, + objcopy, + features, + as_json(pre_link_args), + as_json(post_link_args), + )) + o.close() + +python do_rust_gen_targets () { + wd = d.getVar('WORKDIR', True) + '/targets/' + try: + os.makedirs(wd) + except OSError as e: + if e.errno != 17: + raise e + for thing in ['BUILD', 'HOST', 'TARGET']: + bb.debug(1, "rust_gen_target for " + thing) + rust_gen_target(d, thing, wd) +} +addtask rust_gen_targets after do_patch before do_compile + +def rust_gen_mk_cfg(d, thing): + '''' + Rust's build system adds support for new archs via 2 things: + 1. a file in mk/cfg which defines how the runtime libraries are built + 2. and rustc arch definition either built into the compiler or supplied as a .json file + + This generates a new #1 for the given 'thing' (one of HOST, TARGET, BUILD) + using a "similar" config that rust already supplies as a template. + + Note that the configure process also depends on the existence of #1, so we + have to run this before do_configure + ''' + + import shutil, subprocess + + import errno + import os + + def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise + + rust_base_sys = rust_base_triple(d, thing) + arch = arch_for(d, thing) + sys = sys_for(d, thing) + prefix = prefix_for(d, thing) + llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) + ldflags = ' '.join(ldflags_for(d, thing, arch)) + + b = d.getVar('B', True) + '/mk-cfg/' + mkdir_p(b) + o = open(b + sys_for(d, thing) + '.mk', 'w') + i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r') + + r = subprocess.call(['sed', + # update all triplets to the new one + '-e', 's/{}/{}/g'.format(rust_base_sys, sys), + + # Replace tools with our own (CROSS_PREFIX is appended to all tools + # by rust's build system). We delete and then insert this because not + # all targets define it. + '-e', 's/^CROSS_PREFIX_{}.*$//'.format(sys), + '-e', '2 a CROSS_PREFIX_{} := {}'.format(sys, prefix), + '-e', 's/^CFG_LLVM_TARGET_.*$//', + '-e', '2 a CFG_LLVM_TARGET_{} := {}'.format(sys, llvm_target), + '-e', 's/^CC_{}=.*$/CC_{} := gcc/'.format(sys, sys), + '-e', 's/^CXX_{}.*$/CXX_{} := g++/'.format(sys, sys), + '-e', 's/^CPP_{}.*$/CPP_{} := gcc -E/'.format(sys, sys), + '-e', 's/^AR_{}.*$/AR_{} := ar/'.format(sys, sys), + + # Some targets don't have LINK even though it is required to build. + '-e', 's/^LINK_{}.*$//'.format(sys), + '-e', '2 a LINK_{} := gcc'.format(sys), + + # Append our flags to the existing ones + '-e', '/^CFG_JEMALLOC_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), + '-e', '/^CFG_GCCISH_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), + '-e', '/^CFG_GCCISH_CXXFLAGS/ s;$; {};'.format(cxxflags_for(d, thing)), + '-e', '/^CFG_GCCISH_LINK_FLAGS/ s;$; {};'.format(ldflags), + + # May need to add: CFG_LLC_FLAGS_{} + ], stdout=o, stdin=i) + if r: + raise Exception + o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix)) + o.close() + i.close() + +python do_rust_arch_fixup () { + for thing in ['BUILD', 'HOST', 'TARGET']: + bb.debug(1, "rust_gen_mk_cfg for " + thing) + rust_gen_mk_cfg(d, thing) +} +addtask rust_arch_fixup before do_configure after do_patch +do_rust_arch_fixup[dirs] = "${S}/mk/cfg" + +llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" + +do_configure () { + # FIXME: target_prefix vs prefix, see cross.bbclass + + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just HOST). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS + + # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case + # where we're reinstalling the compiler. May want to try for a real + # path based on bitbake vars + # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. + local_maybe_enable=disable + local_rust_root=/not/set/do/not/use + if which rustc >/dev/null 2>&1; then + local_rustc=$(which rustc) + if [ -n "$local_rustc" ]; then + local_rust_root=$(dirname $(dirname $local_rustc)) + if [ -e "$local_rust_root/bin/rustc" ]; then + local_maybe_enable=enable + fi + fi + fi + + # - rpath is required otherwise rustc fails to resolve symbols + # - submodule management is done by bitbake's fetching + ${S}/configure \ + "--enable-rpath" \ + "--disable-docs" \ + "--disable-manage-submodules" \ + "--disable-debug" \ + "--enable-debuginfo" \ + "--enable-optimize" \ + "--enable-optimize-cxx" \ + "--disable-llvm-version-check" \ + "--llvm-root=${llvmdir}" \ + "--enable-optimize-tests" \ + "--prefix=${prefix}" \ + "--target=${TARGET_SYS}" \ + "--host=${HOST_SYS}" \ + "--build=${BUILD_SYS}" \ + "--localstatedir=${localstatedir}" \ + "--sysconfdir=${sysconfdir}" \ + "--datadir=${datadir}" \ + "--infodir=${infodir}" \ + "--mandir=${mandir}" \ + "--libdir=${libdir}" \ + "--bindir=${bindir}" \ + "--platform-cfg=${B}/mk-cfg/" \ + ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ + ${EXTRA_OECONF} +} + +rust_runmake () { + echo "COMPILE ${PN}" "$@" + env + + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just TARGET). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS + + oe_runmake "VERBOSE=1" "$@" +} + +do_compile () { + if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then + mkdir -p dl + cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl + fi + rust_runmake +} + +rust_do_install () { + rust_runmake DESTDIR="${D}" install + + # Rust's install.sh doesn't mark executables as executable because + # we're using a custom bindir, do it ourselves. + chmod +x "${D}/${bindir}/rustc" + chmod +x "${D}/${bindir}/rustdoc" + chmod +x "${D}/${bindir}/rust-gdb" + + # Install our custom target.json files + local td="${D}${libdir}/rustlib/" + install -d "$td" + for tgt in "${WORKDIR}/targets/"* ; do + install -m 0644 "$tgt" "$td" + done + + ## rust will complain about multiple providers of the runtime libs + ## (libstd, libsync, etc.) without this. + (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) +} + +do_install () { + rust_do_install +} + +## {{{ native bits + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" + +## }}} + +## {{{ cross bits + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-cross = "1" + +# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely. +# Generally, we (and cross in general) need the same things that native needs, +# so it might make sense to take it's mapping. For now, though, we just mention +# the bits we need explicitly. +DEPENDS_class-cross += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'rust-native', '', d)}" +DEPENDS_class-cross += "rust-llvm-native" +DEPENDS_class-cross += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" + +PROVIDES_class-cross = "virtual/${TARGET_PREFIX}rust" +PN_class-cross = "rust-cross-${TARGET_ARCH}" + +# In the cross compilation case, rustc doesn't seem to get the rpath quite +# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't +# include the '../../lib' (ie: relative path from cross_bindir to normal +# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}. +# Most of the time this happens to work fine as the systems libraries are +# subsituted, but sometimes a host system will lack a library, or the right +# version of a library (libtinfo was how I noticed this). +# +# FIXME: this should really be fixed in rust itself. +# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for +# the relative path between 2 of it's vars. +HOST_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" +BUILD_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" + +# We need the same thing for the calls to the compiler when building the runtime crap +TARGET_CC_ARCH_append_class-cross = " --sysroot=${STAGING_DIR_TARGET}" + +# cross.bbclass is "helpful" and overrides our do_install. Tell it not to. +do_install_class-cross () { + rust_do_install +} + +# using host-strip on target .so files generated by this recipie causes build errors. +# for now, disable stripping. +# A better (but more complex) approach would be to mimic gcc-runtime and build +# the target.so files in a seperate .bb file. +INHIBIT_PACKAGE_STRIP_class-cross = "1" +INHIBIT_SYSROOT_STRIP_class-cross = "1" + +## }}} + +BBCLASSEXTEND = "cross native" diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc deleted file mode 100644 index e786ec8..0000000 --- a/recipes/rust/rust.inc +++ /dev/null @@ -1,439 +0,0 @@ -inherit rust -inherit rust-installer - -SUMMARY = "Rust compiler and runtime libaries" -HOMEPAGE = "http://www.rust-lang.org" -SECTION = "devel" -LICENSE = "MIT | Apache-2.0" - -B = "${WORKDIR}/build" - -DEPENDS += "file-native" -DEPENDS += "rust-llvm" - -# Avoid having the default bitbake.conf disable sub-make parallelization -EXTRA_OEMAKE = "" - -LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=b1ab5514343f97198b323e33779470a3" - -PACKAGECONFIG ??= "" - -# Controls whether we use the local rust to build. -# By default, we use the rust-snapshot. In some cases (non-supported host -# systems) this may not be possible. In other cases, it might be desirable -# to have rust-cross built using rust-native. -PACKAGECONFIG[local-rust] = "" - -SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0;name=rust-snapshot', d)}" - -# We generate local targets, and need to be able to locate them -export RUST_TARGET_PATH="${WORKDIR}/targets/" - -export FORCE_CRATE_HASH="${BB_TASKHASH}" - -## arm-unknown-linux-gnueabihf -DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" -LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" -TARGET_ENDIAN[arm] = "little" -TARGET_POINTER_WIDTH[arm] = "32" -FEATURES[arm] = "+v6,+vfp2" -PRE_LINK_ARGS[arm] = "-Wl,--as-needed" - -DATA_LAYOUT[aarch64] = "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-n32:64-S128" -LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" -TARGET_ENDIAN[aarch64] = "little" -TARGET_POINTER_WIDTH[aarch64] = "64" -PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" - -## x86_64-unknown-linux-gnu -DATA_LAYOUT[x86_64] = "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] = "x86_64-unknown-linux-gnu" -TARGET_ENDIAN[x86_64] = "little" -TARGET_POINTER_WIDTH[x86_64] = "64" -PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64" - -## i686-unknown-linux-gnu -DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" -LLVM_TARGET[i686] = "i686-unknown-linux-gnu" -TARGET_ENDIAN[i686] = "little" -TARGET_POINTER_WIDTH[i686] = "32" -PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32" - -## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above -DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" -LLVM_TARGET[i586] = "i586-unknown-linux-gnu" -TARGET_ENDIAN[i586] = "little" -TARGET_POINTER_WIDTH[i586] = "32" -PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32" - -# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as -# DT_RPATH), which lets LD_LIBRARY_PATH override them -RPATH_LDFLAGS = "-Wl,--enable-new-dtags" -TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" - -# These LDFLAGS have '-L' options in them. We need these to come last so they -# don't screw up the link order and pull in the wrong rust build/version. -# TODO: may want to strip out all the '-L' flags entirely here -TARGET_POST_LINK_ARGS = "${TARGET_LDFLAGS}" -BUILD_POST_LINK_ARGS = "${BUILD_LDFLAGS}" -HOST_POST_LINK_ARGS = "${HOST_LDFLAGS}" - -def arch_for(d, thing): - return d.getVar('{}_ARCH'.format(thing), True) - -def sys_for(d, thing): - return d.getVar('{}_SYS'.format(thing), True) - -def prefix_for(d, thing): - return d.getVar('{}_PREFIX'.format(thing), True) - -## Note: TOOLCHAIN_OPTIONS is set to "" by native.bbclass and cross.bbclass, -## which prevents us from grabbing them when building a cross compiler (native doesn't matter). -## We workaround this in internal-rust-cross.bbclass. -def cflags_for(d, thing): - cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" - flags = d.getVar('{}_CFLAGS'.format(thing), True) or "" - tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" - return ' '.join([cc_arch, flags, tc]) - -def cxxflags_for(d, thing): - cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" - flags = d.getVar('{}_CXXFLAGS'.format(thing), True) or "" - tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" - return ' '.join([cc_arch, flags, tc]) - -# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something -# rust's internals won't choke on. -def arch_to_rust_target_arch(arch): - if arch == "i586" or arch == "i686": - return "x86" - else: - return arch - -def as_json(list_): - a = '[' - for e in list_: - if type(e) == str: - a += '"{}",'.format(e) - else: - raise Exception - if len(list_): - a = a[:-1] - a += ']' - return a - -def post_link_args_for(d, thing, arch): - post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() - post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) - return post_link_args - -def pre_link_args_for(d, thing, arch): - ldflags = (d.getVar('{}_PRE_LINK_ARGS'.format(thing), True) or "").split() - ldflags.extend((d.getVarFlag('PRE_LINK_ARGS', arch, True) or "").split()) - return ldflags - -def ldflags_for(d, thing, arch): - a = pre_link_args_for(d, thing, arch) - a.extend(post_link_args_for(d, thing, arch)) - return a - -def rust_gen_target(d, thing, wd): - arch = arch_for(d, thing) - sys = sys_for(d, thing) - prefix = prefix_for(d, thing) - o = open(wd + sys + '.json', 'w') - - data_layout = d.getVarFlag('DATA_LAYOUT', arch, True) - if not data_layout: - bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing)) - llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) - target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) - endian = d.getVarFlag('TARGET_ENDIAN', arch, True) - prefix = d.getVar('{}_PREFIX'.format(thing), True) - ccache = d.getVar('CCACHE', True) - linker = "{}{}gcc".format(ccache, prefix) - objcopy = "{}objcopy".format(prefix) - features = d.getVarFlag('FEATURES', arch, True) or "" - - pre_link_args = pre_link_args_for(d, thing, arch) - post_link_args = post_link_args_for(d, thing, arch) - - o.write('''{{ - "data-layout": "{}", - "llvm-target": "{}", - "target-endian": "{}", - "target-word-size": "{}", - "target-pointer-width": "{}", - "arch": "{}", - "os": "linux", - "linker": "{}", - "objcopy": "{}", - "features": "{}", - "dynamic-linking": true, - "executables": true, - "morestack": true, - "linker-is-gnu": true, - "has-rpath": true, - "position-independent-executables": true, - "pre-link-args": {}, - "post-link-args": {} - }}'''.format( - data_layout, - llvm_target, - endian, - target_pointer_width, - target_pointer_width, - arch_to_rust_target_arch(arch), - linker, - objcopy, - features, - as_json(pre_link_args), - as_json(post_link_args), - )) - o.close() - -python do_rust_gen_targets () { - wd = d.getVar('WORKDIR', True) + '/targets/' - try: - os.makedirs(wd) - except OSError as e: - if e.errno != 17: - raise e - for thing in ['BUILD', 'HOST', 'TARGET']: - bb.debug(1, "rust_gen_target for " + thing) - rust_gen_target(d, thing, wd) -} -addtask rust_gen_targets after do_patch before do_compile - -def rust_gen_mk_cfg(d, thing): - '''' - Rust's build system adds support for new archs via 2 things: - 1. a file in mk/cfg which defines how the runtime libraries are built - 2. and rustc arch definition either built into the compiler or supplied as a .json file - - This generates a new #1 for the given 'thing' (one of HOST, TARGET, BUILD) - using a "similar" config that rust already supplies as a template. - - Note that the configure process also depends on the existence of #1, so we - have to run this before do_configure - ''' - - import shutil, subprocess - rust_base_sys = rust_base_triple(d, thing) - arch = arch_for(d, thing) - sys = sys_for(d, thing) - prefix = prefix_for(d, thing) - llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) - ldflags = ' '.join(ldflags_for(d, thing, arch)) - - p = d.getVar('S', True) + '/mk/cfg/' - - o = open(p + sys_for(d, thing) + '.mk', 'w') - i = open(p + rust_base_sys + '.mk', 'r') - - r = subprocess.call(['sed', - # update all triplets to the new one - '-e', 's/{}/{}/g'.format(rust_base_sys, sys), - - # Replace tools with our own (CROSS_PREFIX is appended to all tools - # by rust's build system). We delete and then insert this because not - # all targets define it. - '-e', 's/^CROSS_PREFIX_{}.*$//'.format(sys), - '-e', '2 a CROSS_PREFIX_{} := {}'.format(sys, prefix), - '-e', 's/^CFG_LLVM_TARGET_.*$//', - '-e', '2 a CFG_LLVM_TARGET_{} := {}'.format(sys, llvm_target), - '-e', 's/^CC_{}=.*$/CC_{} := gcc/'.format(sys, sys), - '-e', 's/^CXX_{}.*$/CXX_{} := g++/'.format(sys, sys), - '-e', 's/^CPP_{}.*$/CPP_{} := gcc -E/'.format(sys, sys), - '-e', 's/^AR_{}.*$/AR_{} := ar/'.format(sys, sys), - - # Some targets don't have LINK even though it is required to build. - '-e', 's/^LINK_{}.*$//'.format(sys), - '-e', '2 a LINK_{} := gcc'.format(sys), - - # Append our flags to the existing ones - '-e', '/^CFG_JEMALLOC_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), - '-e', '/^CFG_GCCISH_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), - '-e', '/^CFG_GCCISH_CXXFLAGS/ s;$; {};'.format(cxxflags_for(d, thing)), - '-e', '/^CFG_GCCISH_LINK_FLAGS/ s;$; {};'.format(ldflags), - - # May need to add: CFG_LLC_FLAGS_{} - ], stdout=o, stdin=i) - if r: - raise Exception - o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix)) - o.close() - i.close() - -python do_rust_arch_fixup () { - for thing in ['BUILD', 'HOST', 'TARGET']: - bb.debug(1, "rust_gen_mk_cfg for " + thing) - rust_gen_mk_cfg(d, thing) -} -addtask rust_arch_fixup before do_configure after do_patch -do_rust_arch_fixup[dirs] = "${S}/mk/cfg" - -llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" - -do_configure () { - # FIXME: target_prefix vs prefix, see cross.bbclass - - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just HOST). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - - # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case - # where we're reinstalling the compiler. May want to try for a real - # path based on bitbake vars - # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. - local_maybe_enable=disable - local_rust_root=/not/set/do/not/use - if which rustc >/dev/null 2>&1; then - local_rustc=$(which rustc) - if [ -n "$local_rustc" ]; then - local_rust_root=$(dirname $(dirname $local_rustc)) - if [ -e "$local_rust_root/bin/rustc" ]; then - local_maybe_enable=enable - fi - fi - fi - - # - rpath is required otherwise rustc fails to resolve symbols - # - submodule management is done by bitbake's fetching - ${S}/configure \ - "--enable-rpath" \ - "--disable-docs" \ - "--disable-manage-submodules" \ - "--disable-debug" \ - "--enable-debuginfo" \ - "--enable-optimize" \ - "--enable-optimize-cxx" \ - "--disable-llvm-version-check" \ - "--llvm-root=${llvmdir}" \ - "--enable-optimize-tests" \ - "--prefix=${prefix}" \ - "--target=${TARGET_SYS}" \ - "--host=${HOST_SYS}" \ - "--build=${BUILD_SYS}" \ - "--localstatedir=${localstatedir}" \ - "--sysconfdir=${sysconfdir}" \ - "--datadir=${datadir}" \ - "--infodir=${infodir}" \ - "--mandir=${mandir}" \ - "--libdir=${libdir}" \ - "--bindir=${bindir}" \ - ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ - ${EXTRA_OECONF} -} - -rust_runmake () { - echo "COMPILE ${PN}" "$@" - env - - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just TARGET). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - - oe_runmake "VERBOSE=1" "$@" -} - -do_compile () { - if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then - mkdir -p dl - cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl - fi - rust_runmake -} - -rust_do_install () { - rust_runmake DESTDIR="${D}" install - - # Rust's install.sh doesn't mark executables as executable because - # we're using a custom bindir, do it ourselves. - chmod +x "${D}/${bindir}/rustc" - chmod +x "${D}/${bindir}/rustdoc" - chmod +x "${D}/${bindir}/rust-gdb" - - # Install our custom target.json files - local td="${D}${libdir}/rustlib/" - install -d "$td" - for tgt in "${WORKDIR}/targets/"* ; do - install -m 0644 "$tgt" "$td" - done - - ## rust will complain about multiple providers of the runtime libs - ## (libstd, libsync, etc.) without this. - (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) -} - -do_install () { - rust_do_install -} - -## {{{ native bits - -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" -# We don't need to depend on gcc-native because yocto assumes it exists -PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" - -## }}} - -## {{{ cross bits - -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS_class-cross = "1" - -# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely. -# Generally, we (and cross in general) need the same things that native needs, -# so it might make sense to take it's mapping. For now, though, we just mention -# the bits we need explicitly. -DEPENDS_class-cross += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'rust-native', '', d)}" -DEPENDS_class-cross += "rust-llvm-native" -DEPENDS_class-cross += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" - -PROVIDES_class-cross = "virtual/${TARGET_PREFIX}rust" -PN_class-cross = "rust-cross-${TARGET_ARCH}" - -# In the cross compilation case, rustc doesn't seem to get the rpath quite -# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't -# include the '../../lib' (ie: relative path from cross_bindir to normal -# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}. -# Most of the time this happens to work fine as the systems libraries are -# subsituted, but sometimes a host system will lack a library, or the right -# version of a library (libtinfo was how I noticed this). -# -# FIXME: this should really be fixed in rust itself. -# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for -# the relative path between 2 of it's vars. -HOST_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" -BUILD_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" - -# We need the same thing for the calls to the compiler when building the runtime crap -TARGET_CC_ARCH_append_class-cross = " --sysroot=${STAGING_DIR_TARGET}" - -# cross.bbclass is "helpful" and overrides our do_install. Tell it not to. -do_install_class-cross () { - rust_do_install -} - -# using host-strip on target .so files generated by this recipie causes build errors. -# for now, disable stripping. -# A better (but more complex) approach would be to mimic gcc-runtime and build -# the target.so files in a seperate .bb file. -INHIBIT_PACKAGE_STRIP_class-cross = "1" -INHIBIT_SYSROOT_STRIP_class-cross = "1" - -## }}} - -BBCLASSEXTEND = "cross native" From ec974e5e92f14ae067b760c712789f74fa2b9fb0 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 4 Feb 2016 12:40:51 -0500 Subject: [PATCH 34/47] readme: add some clarification on my current practices --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1bac89..1bebafc 100644 --- a/README.md +++ b/README.md @@ -57,9 +57,14 @@ On the target: ## Maintainer(s) & Patch policy -Open a Pull Request +Open a Pull Request. + +Generally, I try to support the latest master of poky. I'm happy to support +older versions too by applying backwards compat patches as long as I don't need +to maintain a seperate branch. Of course, others are welcome to create forks to +support their individual needs. ## Copyright -MIT/Apache-2.0 - Same as rust +MIT OR Apache-2.0 - Same as rust From 5aab7e99ae659950474a5c2e77fcb240ff458d8f Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Sun, 14 Feb 2016 12:43:59 -0500 Subject: [PATCH 35/47] Add the llvm and new rust-cross to the set of items where PIE is disabled Signed-off-by: Derek Straka --- conf/distro/include/rust_security_flags.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/distro/include/rust_security_flags.inc b/conf/distro/include/rust_security_flags.inc index 28aec40..91f3e2a 100644 --- a/conf/distro/include/rust_security_flags.inc +++ b/conf/distro/include/rust_security_flags.inc @@ -1,4 +1,6 @@ # Build errors with PIE options enabled SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-cross = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}" +SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}" From 598bd26c2febe28698ee3147d856c59232c35a53 Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Sun, 14 Feb 2016 12:47:46 -0500 Subject: [PATCH 36/47] Add a new rust-cross package that will be different for each TARGET_ARCH Signed-off-by: Derek Straka --- .../0000-rust-llvm-remove-extra-slash.patch | 11 + recipes/rust/rust-cross.bb | 44 ++ recipes/rust/rust-llvm.inc | 13 +- recipes/rust/rust.bb | 448 +----------------- recipes/rust/rust.inc | 396 ++++++++++++++++ 5 files changed, 465 insertions(+), 447 deletions(-) create mode 100644 recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch create mode 100644 recipes/rust/rust-cross.bb create mode 100644 recipes/rust/rust.inc diff --git a/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch b/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch new file mode 100644 index 0000000..43c52d7 --- /dev/null +++ b/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch @@ -0,0 +1,11 @@ +lude/llvm/CodeGen/CommandFlags.h.orig 2016-01-18 19:18:03.847470845 +0000 ++++ llvm/include/llvm/CodeGen/CommandFlags.h 2016-01-18 19:18:11.211408270 +0000 +@@ -21,7 +21,7 @@ + #include "llvm/IR/Intrinsics.h" + #include "llvm/IR/Module.h" + #include "llvm/MC/MCTargetOptionsCommandFlags.h" +-#include "llvm//MC/SubtargetFeature.h" ++#include "llvm/MC/SubtargetFeature.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/CommandLine.h" + #include "llvm/Support/Host.h" diff --git a/recipes/rust/rust-cross.bb b/recipes/rust/rust-cross.bb new file mode 100644 index 0000000..d4324f1 --- /dev/null +++ b/recipes/rust/rust-cross.bb @@ -0,0 +1,44 @@ +require rust.inc +inherit cross + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS = "1" + +# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely. +# Generally, we (and cross in general) need the same things that native needs, +# so it might make sense to take it's mapping. For now, though, we just mention +# the bits we need explicitly. +DEPENDS += "rust-llvm-native" +DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" + +PROVIDES = "virtual/${TARGET_PREFIX}rust" +PN = "rust-cross-${TARGET_ARCH}" + +# In the cross compilation case, rustc doesn't seem to get the rpath quite +# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't +# include the '../../lib' (ie: relative path from cross_bindir to normal +# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}. +# Most of the time this happens to work fine as the systems libraries are +# subsituted, but sometimes a host system will lack a library, or the right +# version of a library (libtinfo was how I noticed this). +# +# FIXME: this should really be fixed in rust itself. +# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for +# the relative path between 2 of it's vars. +HOST_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib" +BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib" + +# We need the same thing for the calls to the compiler when building the runtime crap +TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}" + +# cross.bbclass is "helpful" and overrides our do_install. Tell it not to. +do_install () { + rust_do_install +} + +# using host-strip on target .so files generated by this recipie causes build errors. +# for now, disable stripping. +# A better (but more complex) approach would be to mimic gcc-runtime and build +# the target.so files in a seperate .bb file. +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" diff --git a/recipes/rust/rust-llvm.inc b/recipes/rust/rust-llvm.inc index 06ee7ae..15a8ddc 100644 --- a/recipes/rust/rust-llvm.inc +++ b/recipes/rust/rust-llvm.inc @@ -5,6 +5,8 @@ LICENSE = "NCSA" S .= "/src/llvm" +SRC_URI_append = "file://rust-llvm/0000-rust-llvm-remove-extra-slash.patch" + inherit autotools EXTRA_OECONF += "--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc" @@ -18,12 +20,21 @@ EXTRA_OECONF += "--disable-libffi" EXTRA_OECONF += "--enable-keep-symbols" +PACKAGES += "${PN}-data" + +# Add the extra locations to avoid the complaints about unpackaged files +FILES_${PN}-data = "${datadir}" +FILES_${PN}-dev += "${libdir}" + do_install_append () { + # Remove the debug info (>2 GB) as part of normal operation + rm -rf ${D}${bindir}/.debug + cd ${D}${bindir} ln -s *-llc llc for i in *-llvm-*; do link=$(echo $i | sed -e 's/.*-llvm-\(.*\)/\1/') - ln -s $i llvm-$link + ln -sf $i llvm-$link done } diff --git a/recipes/rust/rust.bb b/recipes/rust/rust.bb index bfbc1ba..93ceab2 100644 --- a/recipes/rust/rust.bb +++ b/recipes/rust/rust.bb @@ -1,454 +1,10 @@ -inherit rust -inherit rust-installer -require rust-shared-source.inc -require rust-snapshot-2015-08-11.inc +require rust.inc -LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" - -SUMMARY = "Rust compiler and runtime libaries" -HOMEPAGE = "http://www.rust-lang.org" -SECTION = "devel" - -B = "${WORKDIR}/build" - -DEPENDS += "file-native" DEPENDS += "rust-llvm" -# Avoid having the default bitbake.conf disable sub-make parallelization -EXTRA_OEMAKE = "" - -PACKAGECONFIG ??= "" - -# Controls whether we use the local rust to build. -# By default, we use the rust-snapshot. In some cases (non-supported host -# systems) this may not be possible. In other cases, it might be desirable -# to have rust-cross built using rust-native. -PACKAGECONFIG[local-rust] = "" - -SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0;name=rust-snapshot', d)}" - -# We generate local targets, and need to be able to locate them -export RUST_TARGET_PATH="${WORKDIR}/targets/" - -export FORCE_CRATE_HASH="${BB_TASKHASH}" - -## arm-unknown-linux-gnueabihf -DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" -LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" -TARGET_ENDIAN[arm] = "little" -TARGET_POINTER_WIDTH[arm] = "32" -FEATURES[arm] = "+v6,+vfp2" -PRE_LINK_ARGS[arm] = "-Wl,--as-needed" - -DATA_LAYOUT[aarch64] = "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-n32:64-S128" -LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" -TARGET_ENDIAN[aarch64] = "little" -TARGET_POINTER_WIDTH[aarch64] = "64" -PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" - -## x86_64-unknown-linux-gnu -DATA_LAYOUT[x86_64] = "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] = "x86_64-unknown-linux-gnu" -TARGET_ENDIAN[x86_64] = "little" -TARGET_POINTER_WIDTH[x86_64] = "64" -PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64" - -## i686-unknown-linux-gnu -DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" -LLVM_TARGET[i686] = "i686-unknown-linux-gnu" -TARGET_ENDIAN[i686] = "little" -TARGET_POINTER_WIDTH[i686] = "32" -PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32" - -## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above -DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" -LLVM_TARGET[i586] = "i586-unknown-linux-gnu" -TARGET_ENDIAN[i586] = "little" -TARGET_POINTER_WIDTH[i586] = "32" -PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32" - -# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as -# DT_RPATH), which lets LD_LIBRARY_PATH override them -RPATH_LDFLAGS = "-Wl,--enable-new-dtags" -TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" -HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" - -# These LDFLAGS have '-L' options in them. We need these to come last so they -# don't screw up the link order and pull in the wrong rust build/version. -# TODO: may want to strip out all the '-L' flags entirely here -TARGET_POST_LINK_ARGS = "${TARGET_LDFLAGS}" -BUILD_POST_LINK_ARGS = "${BUILD_LDFLAGS}" -HOST_POST_LINK_ARGS = "${HOST_LDFLAGS}" - -def arch_for(d, thing): - return d.getVar('{}_ARCH'.format(thing), True) - -def sys_for(d, thing): - return d.getVar('{}_SYS'.format(thing), True) - -def prefix_for(d, thing): - return d.getVar('{}_PREFIX'.format(thing), True) - -## Note: TOOLCHAIN_OPTIONS is set to "" by native.bbclass and cross.bbclass, -## which prevents us from grabbing them when building a cross compiler (native doesn't matter). -## We workaround this in internal-rust-cross.bbclass. -def cflags_for(d, thing): - cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" - flags = d.getVar('{}_CFLAGS'.format(thing), True) or "" - tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" - return ' '.join([cc_arch, flags, tc]) - -def cxxflags_for(d, thing): - cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" - flags = d.getVar('{}_CXXFLAGS'.format(thing), True) or "" - tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" - return ' '.join([cc_arch, flags, tc]) - -# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something -# rust's internals won't choke on. -def arch_to_rust_target_arch(arch): - if arch == "i586" or arch == "i686": - return "x86" - else: - return arch - -def as_json(list_): - a = '[' - for e in list_: - if type(e) == str: - a += '"{}",'.format(e) - else: - raise Exception - if len(list_): - a = a[:-1] - a += ']' - return a - -def post_link_args_for(d, thing, arch): - post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() - post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) - return post_link_args - -def pre_link_args_for(d, thing, arch): - ldflags = (d.getVar('{}_PRE_LINK_ARGS'.format(thing), True) or "").split() - ldflags.extend((d.getVarFlag('PRE_LINK_ARGS', arch, True) or "").split()) - return ldflags - -def ldflags_for(d, thing, arch): - a = pre_link_args_for(d, thing, arch) - a.extend(post_link_args_for(d, thing, arch)) - return a - -def rust_gen_target(d, thing, wd): - arch = arch_for(d, thing) - sys = sys_for(d, thing) - prefix = prefix_for(d, thing) - o = open(wd + sys + '.json', 'w') - - data_layout = d.getVarFlag('DATA_LAYOUT', arch, True) - if not data_layout: - bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing)) - llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) - target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) - endian = d.getVarFlag('TARGET_ENDIAN', arch, True) - prefix = d.getVar('{}_PREFIX'.format(thing), True) - ccache = d.getVar('CCACHE', True) - linker = "{}{}gcc".format(ccache, prefix) - objcopy = "{}objcopy".format(prefix) - features = d.getVarFlag('FEATURES', arch, True) or "" - - pre_link_args = pre_link_args_for(d, thing, arch) - post_link_args = post_link_args_for(d, thing, arch) - - o.write('''{{ - "data-layout": "{}", - "llvm-target": "{}", - "target-endian": "{}", - "target-word-size": "{}", - "target-pointer-width": "{}", - "arch": "{}", - "os": "linux", - "linker": "{}", - "objcopy": "{}", - "features": "{}", - "dynamic-linking": true, - "executables": true, - "morestack": true, - "linker-is-gnu": true, - "has-rpath": true, - "position-independent-executables": true, - "pre-link-args": {}, - "post-link-args": {} - }}'''.format( - data_layout, - llvm_target, - endian, - target_pointer_width, - target_pointer_width, - arch_to_rust_target_arch(arch), - linker, - objcopy, - features, - as_json(pre_link_args), - as_json(post_link_args), - )) - o.close() - -python do_rust_gen_targets () { - wd = d.getVar('WORKDIR', True) + '/targets/' - try: - os.makedirs(wd) - except OSError as e: - if e.errno != 17: - raise e - for thing in ['BUILD', 'HOST', 'TARGET']: - bb.debug(1, "rust_gen_target for " + thing) - rust_gen_target(d, thing, wd) -} -addtask rust_gen_targets after do_patch before do_compile - -def rust_gen_mk_cfg(d, thing): - '''' - Rust's build system adds support for new archs via 2 things: - 1. a file in mk/cfg which defines how the runtime libraries are built - 2. and rustc arch definition either built into the compiler or supplied as a .json file - - This generates a new #1 for the given 'thing' (one of HOST, TARGET, BUILD) - using a "similar" config that rust already supplies as a template. - - Note that the configure process also depends on the existence of #1, so we - have to run this before do_configure - ''' - - import shutil, subprocess - - import errno - import os - - def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(path): - pass - else: - raise - - rust_base_sys = rust_base_triple(d, thing) - arch = arch_for(d, thing) - sys = sys_for(d, thing) - prefix = prefix_for(d, thing) - llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) - ldflags = ' '.join(ldflags_for(d, thing, arch)) - - b = d.getVar('B', True) + '/mk-cfg/' - mkdir_p(b) - o = open(b + sys_for(d, thing) + '.mk', 'w') - i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r') - - r = subprocess.call(['sed', - # update all triplets to the new one - '-e', 's/{}/{}/g'.format(rust_base_sys, sys), - - # Replace tools with our own (CROSS_PREFIX is appended to all tools - # by rust's build system). We delete and then insert this because not - # all targets define it. - '-e', 's/^CROSS_PREFIX_{}.*$//'.format(sys), - '-e', '2 a CROSS_PREFIX_{} := {}'.format(sys, prefix), - '-e', 's/^CFG_LLVM_TARGET_.*$//', - '-e', '2 a CFG_LLVM_TARGET_{} := {}'.format(sys, llvm_target), - '-e', 's/^CC_{}=.*$/CC_{} := gcc/'.format(sys, sys), - '-e', 's/^CXX_{}.*$/CXX_{} := g++/'.format(sys, sys), - '-e', 's/^CPP_{}.*$/CPP_{} := gcc -E/'.format(sys, sys), - '-e', 's/^AR_{}.*$/AR_{} := ar/'.format(sys, sys), - - # Some targets don't have LINK even though it is required to build. - '-e', 's/^LINK_{}.*$//'.format(sys), - '-e', '2 a LINK_{} := gcc'.format(sys), - - # Append our flags to the existing ones - '-e', '/^CFG_JEMALLOC_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), - '-e', '/^CFG_GCCISH_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), - '-e', '/^CFG_GCCISH_CXXFLAGS/ s;$; {};'.format(cxxflags_for(d, thing)), - '-e', '/^CFG_GCCISH_LINK_FLAGS/ s;$; {};'.format(ldflags), - - # May need to add: CFG_LLC_FLAGS_{} - ], stdout=o, stdin=i) - if r: - raise Exception - o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix)) - o.close() - i.close() - -python do_rust_arch_fixup () { - for thing in ['BUILD', 'HOST', 'TARGET']: - bb.debug(1, "rust_gen_mk_cfg for " + thing) - rust_gen_mk_cfg(d, thing) -} -addtask rust_arch_fixup before do_configure after do_patch -do_rust_arch_fixup[dirs] = "${S}/mk/cfg" - -llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" - -do_configure () { - # FIXME: target_prefix vs prefix, see cross.bbclass - - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just HOST). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - - # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case - # where we're reinstalling the compiler. May want to try for a real - # path based on bitbake vars - # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. - local_maybe_enable=disable - local_rust_root=/not/set/do/not/use - if which rustc >/dev/null 2>&1; then - local_rustc=$(which rustc) - if [ -n "$local_rustc" ]; then - local_rust_root=$(dirname $(dirname $local_rustc)) - if [ -e "$local_rust_root/bin/rustc" ]; then - local_maybe_enable=enable - fi - fi - fi - - # - rpath is required otherwise rustc fails to resolve symbols - # - submodule management is done by bitbake's fetching - ${S}/configure \ - "--enable-rpath" \ - "--disable-docs" \ - "--disable-manage-submodules" \ - "--disable-debug" \ - "--enable-debuginfo" \ - "--enable-optimize" \ - "--enable-optimize-cxx" \ - "--disable-llvm-version-check" \ - "--llvm-root=${llvmdir}" \ - "--enable-optimize-tests" \ - "--prefix=${prefix}" \ - "--target=${TARGET_SYS}" \ - "--host=${HOST_SYS}" \ - "--build=${BUILD_SYS}" \ - "--localstatedir=${localstatedir}" \ - "--sysconfdir=${sysconfdir}" \ - "--datadir=${datadir}" \ - "--infodir=${infodir}" \ - "--mandir=${mandir}" \ - "--libdir=${libdir}" \ - "--bindir=${bindir}" \ - "--platform-cfg=${B}/mk-cfg/" \ - ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ - ${EXTRA_OECONF} -} - -rust_runmake () { - echo "COMPILE ${PN}" "$@" - env - - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just TARGET). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS - - oe_runmake "VERBOSE=1" "$@" -} - -do_compile () { - if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then - mkdir -p dl - cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl - fi - rust_runmake -} - -rust_do_install () { - rust_runmake DESTDIR="${D}" install - - # Rust's install.sh doesn't mark executables as executable because - # we're using a custom bindir, do it ourselves. - chmod +x "${D}/${bindir}/rustc" - chmod +x "${D}/${bindir}/rustdoc" - chmod +x "${D}/${bindir}/rust-gdb" - - # Install our custom target.json files - local td="${D}${libdir}/rustlib/" - install -d "$td" - for tgt in "${WORKDIR}/targets/"* ; do - install -m 0644 "$tgt" "$td" - done - - ## rust will complain about multiple providers of the runtime libs - ## (libstd, libsync, etc.) without this. - (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) -} - -do_install () { - rust_do_install -} - -## {{{ native bits - # Otherwise we'll depend on what we provide INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" # We don't need to depend on gcc-native because yocto assumes it exists PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" -## }}} - -## {{{ cross bits - -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS_class-cross = "1" - -# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely. -# Generally, we (and cross in general) need the same things that native needs, -# so it might make sense to take it's mapping. For now, though, we just mention -# the bits we need explicitly. -DEPENDS_class-cross += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'rust-native', '', d)}" -DEPENDS_class-cross += "rust-llvm-native" -DEPENDS_class-cross += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" - -PROVIDES_class-cross = "virtual/${TARGET_PREFIX}rust" -PN_class-cross = "rust-cross-${TARGET_ARCH}" - -# In the cross compilation case, rustc doesn't seem to get the rpath quite -# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't -# include the '../../lib' (ie: relative path from cross_bindir to normal -# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}. -# Most of the time this happens to work fine as the systems libraries are -# subsituted, but sometimes a host system will lack a library, or the right -# version of a library (libtinfo was how I noticed this). -# -# FIXME: this should really be fixed in rust itself. -# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for -# the relative path between 2 of it's vars. -HOST_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" -BUILD_POST_LINK_ARGS_append_class-cross = " -Wl,-rpath=../../lib" - -# We need the same thing for the calls to the compiler when building the runtime crap -TARGET_CC_ARCH_append_class-cross = " --sysroot=${STAGING_DIR_TARGET}" - -# cross.bbclass is "helpful" and overrides our do_install. Tell it not to. -do_install_class-cross () { - rust_do_install -} - -# using host-strip on target .so files generated by this recipie causes build errors. -# for now, disable stripping. -# A better (but more complex) approach would be to mimic gcc-runtime and build -# the target.so files in a seperate .bb file. -INHIBIT_PACKAGE_STRIP_class-cross = "1" -INHIBIT_SYSROOT_STRIP_class-cross = "1" - -## }}} - -BBCLASSEXTEND = "cross native" +BBCLASSEXTEND = "native" diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc new file mode 100644 index 0000000..e6d495d --- /dev/null +++ b/recipes/rust/rust.inc @@ -0,0 +1,396 @@ +inherit rust +inherit rust-installer +require rust-shared-source.inc +require rust-snapshot-2015-08-11.inc + +LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" + +SUMMARY = "Rust compiler and runtime libaries" +HOMEPAGE = "http://www.rust-lang.org" +SECTION = "devel" + +B = "${WORKDIR}/build" + +DEPENDS += "file-native" + +# Avoid having the default bitbake.conf disable sub-make parallelization +EXTRA_OEMAKE = "" + +PACKAGECONFIG ??= "" + +# Controls whether we use the local rust to build. +# By default, we use the rust-snapshot. In some cases (non-supported host +# systems) this may not be possible. In other cases, it might be desirable +# to have rust-cross built using rust-native. +PACKAGECONFIG[local-rust] = "" + +SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0;name=rust-snapshot', d)}" + +# We generate local targets, and need to be able to locate them +export RUST_TARGET_PATH="${WORKDIR}/targets/" + +export FORCE_CRATE_HASH="${BB_TASKHASH}" + +## arm-unknown-linux-gnueabihf +DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" +LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" +TARGET_ENDIAN[arm] = "little" +TARGET_POINTER_WIDTH[arm] = "32" +FEATURES[arm] = "+v6,+vfp2" +PRE_LINK_ARGS[arm] = "-Wl,--as-needed" + +DATA_LAYOUT[aarch64] = "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-n32:64-S128" +LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu" +TARGET_ENDIAN[aarch64] = "little" +TARGET_POINTER_WIDTH[aarch64] = "64" +PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed" + +## x86_64-unknown-linux-gnu +DATA_LAYOUT[x86_64] = "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] = "x86_64-unknown-linux-gnu" +TARGET_ENDIAN[x86_64] = "little" +TARGET_POINTER_WIDTH[x86_64] = "64" +PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64" + +## i686-unknown-linux-gnu +DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" +LLVM_TARGET[i686] = "i686-unknown-linux-gnu" +TARGET_ENDIAN[i686] = "little" +TARGET_POINTER_WIDTH[i686] = "32" +PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32" + +## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above +DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32" +LLVM_TARGET[i586] = "i586-unknown-linux-gnu" +TARGET_ENDIAN[i586] = "little" +TARGET_POINTER_WIDTH[i586] = "32" +PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32" + +# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as +# DT_RPATH), which lets LD_LIBRARY_PATH override them +RPATH_LDFLAGS = "-Wl,--enable-new-dtags" +TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" + +# These LDFLAGS have '-L' options in them. We need these to come last so they +# don't screw up the link order and pull in the wrong rust build/version. +# TODO: may want to strip out all the '-L' flags entirely here +TARGET_POST_LINK_ARGS = "${TARGET_LDFLAGS}" +BUILD_POST_LINK_ARGS = "${BUILD_LDFLAGS}" +HOST_POST_LINK_ARGS = "${HOST_LDFLAGS}" + +def arch_for(d, thing): + return d.getVar('{}_ARCH'.format(thing), True) + +def sys_for(d, thing): + return d.getVar('{}_SYS'.format(thing), True) + +def prefix_for(d, thing): + return d.getVar('{}_PREFIX'.format(thing), True) + +## Note: TOOLCHAIN_OPTIONS is set to "" by native.bbclass and cross.bbclass, +## which prevents us from grabbing them when building a cross compiler (native doesn't matter). +## We workaround this in internal-rust-cross.bbclass. +def cflags_for(d, thing): + cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" + flags = d.getVar('{}_CFLAGS'.format(thing), True) or "" + tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" + return ' '.join([cc_arch, flags, tc]) + +def cxxflags_for(d, thing): + cc_arch = d.getVar('{}_CC_ARCH'.format(thing), True) or "" + flags = d.getVar('{}_CXXFLAGS'.format(thing), True) or "" + tc = d.getVar('TOOLCHAIN_OPTIONS', True) or "" + return ' '.join([cc_arch, flags, tc]) + +# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something +# rust's internals won't choke on. +def arch_to_rust_target_arch(arch): + if arch == "i586" or arch == "i686": + return "x86" + else: + return arch + +def as_json(list_): + a = '[' + for e in list_: + if type(e) == str: + a += '"{}",'.format(e) + else: + raise Exception + if len(list_): + a = a[:-1] + a += ']' + return a + +def post_link_args_for(d, thing, arch): + post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split() + post_link_args.extend((d.getVarFlag('POST_LINK_ARGS', arch, True) or "").split()) + return post_link_args + +def pre_link_args_for(d, thing, arch): + ldflags = (d.getVar('{}_PRE_LINK_ARGS'.format(thing), True) or "").split() + ldflags.extend((d.getVarFlag('PRE_LINK_ARGS', arch, True) or "").split()) + return ldflags + +def ldflags_for(d, thing, arch): + a = pre_link_args_for(d, thing, arch) + a.extend(post_link_args_for(d, thing, arch)) + return a + +def rust_gen_target(d, thing, wd): + arch = arch_for(d, thing) + sys = sys_for(d, thing) + prefix = prefix_for(d, thing) + o = open(wd + sys + '.json', 'w') + + data_layout = d.getVarFlag('DATA_LAYOUT', arch, True) + if not data_layout: + bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing)) + llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) + target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) + endian = d.getVarFlag('TARGET_ENDIAN', arch, True) + prefix = d.getVar('{}_PREFIX'.format(thing), True) + ccache = d.getVar('CCACHE', True) + linker = "{}{}gcc".format(ccache, prefix) + objcopy = "{}objcopy".format(prefix) + features = d.getVarFlag('FEATURES', arch, True) or "" + + pre_link_args = pre_link_args_for(d, thing, arch) + post_link_args = post_link_args_for(d, thing, arch) + + o.write('''{{ + "data-layout": "{}", + "llvm-target": "{}", + "target-endian": "{}", + "target-word-size": "{}", + "target-pointer-width": "{}", + "arch": "{}", + "os": "linux", + "linker": "{}", + "objcopy": "{}", + "features": "{}", + "dynamic-linking": true, + "executables": true, + "morestack": true, + "linker-is-gnu": true, + "has-rpath": true, + "position-independent-executables": true, + "pre-link-args": {}, + "post-link-args": {} + }}'''.format( + data_layout, + llvm_target, + endian, + target_pointer_width, + target_pointer_width, + arch_to_rust_target_arch(arch), + linker, + objcopy, + features, + as_json(pre_link_args), + as_json(post_link_args), + )) + o.close() + +python do_rust_gen_targets () { + wd = d.getVar('WORKDIR', True) + '/targets/' + try: + os.makedirs(wd) + except OSError as e: + if e.errno != 17: + raise e + for thing in ['BUILD', 'HOST', 'TARGET']: + bb.debug(1, "rust_gen_target for " + thing) + rust_gen_target(d, thing, wd) +} +addtask rust_gen_targets after do_patch before do_compile + +def rust_gen_mk_cfg(d, thing): + '''' + Rust's build system adds support for new archs via 2 things: + 1. a file in mk/cfg which defines how the runtime libraries are built + 2. and rustc arch definition either built into the compiler or supplied as a .json file + + This generates a new #1 for the given 'thing' (one of HOST, TARGET, BUILD) + using a "similar" config that rust already supplies as a template. + + Note that the configure process also depends on the existence of #1, so we + have to run this before do_configure + ''' + + import shutil, subprocess + + import errno + import os + + def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise + + rust_base_sys = rust_base_triple(d, thing) + arch = arch_for(d, thing) + sys = sys_for(d, thing) + prefix = prefix_for(d, thing) + llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) + ldflags = ' '.join(ldflags_for(d, thing, arch)) + + b = d.getVar('B', True) + '/mk-cfg/' + mkdir_p(b) + o = open(b + sys_for(d, thing) + '.mk', 'w') + i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r') + + r = subprocess.call(['sed', + # update all triplets to the new one + '-e', 's/{}/{}/g'.format(rust_base_sys, sys), + + # Replace tools with our own (CROSS_PREFIX is appended to all tools + # by rust's build system). We delete and then insert this because not + # all targets define it. + '-e', 's/^CROSS_PREFIX_{}.*$//'.format(sys), + '-e', '2 a CROSS_PREFIX_{} := {}'.format(sys, prefix), + '-e', 's/^CFG_LLVM_TARGET_.*$//', + '-e', '2 a CFG_LLVM_TARGET_{} := {}'.format(sys, llvm_target), + '-e', 's/^CC_{}=.*$/CC_{} := gcc/'.format(sys, sys), + '-e', 's/^CXX_{}.*$/CXX_{} := g++/'.format(sys, sys), + '-e', 's/^CPP_{}.*$/CPP_{} := gcc -E/'.format(sys, sys), + '-e', 's/^AR_{}.*$/AR_{} := ar/'.format(sys, sys), + + # Some targets don't have LINK even though it is required to build. + '-e', 's/^LINK_{}.*$//'.format(sys), + '-e', '2 a LINK_{} := gcc'.format(sys), + + # Append our flags to the existing ones + '-e', '/^CFG_JEMALLOC_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), + '-e', '/^CFG_GCCISH_CFLAGS/ s;$; {};'.format(cflags_for(d, thing)), + '-e', '/^CFG_GCCISH_CXXFLAGS/ s;$; {};'.format(cxxflags_for(d, thing)), + '-e', '/^CFG_GCCISH_LINK_FLAGS/ s;$; {};'.format(ldflags), + + # May need to add: CFG_LLC_FLAGS_{} + ], stdout=o, stdin=i) + if r: + raise Exception + o.write("OBJCOPY_{} := {}objcopy\n".format(sys, prefix)) + o.close() + i.close() + +python do_rust_arch_fixup () { + for thing in ['BUILD', 'HOST', 'TARGET']: + bb.debug(1, "rust_gen_mk_cfg for " + thing) + rust_gen_mk_cfg(d, thing) +} +addtask rust_arch_fixup before do_configure after do_patch +do_rust_arch_fixup[dirs] = "${S}/mk/cfg" + +llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" + +do_configure () { + # FIXME: target_prefix vs prefix, see cross.bbclass + + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just HOST). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS + + # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case + # where we're reinstalling the compiler. May want to try for a real + # path based on bitbake vars + # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. + local_maybe_enable=disable + local_rust_root=/not/set/do/not/use + if which rustc >/dev/null 2>&1; then + local_rustc=$(which rustc) + if [ -n "$local_rustc" ]; then + local_rust_root=$(dirname $(dirname $local_rustc)) + if [ -e "$local_rust_root/bin/rustc" ]; then + local_maybe_enable=enable + fi + fi + fi + + # - rpath is required otherwise rustc fails to resolve symbols + # - submodule management is done by bitbake's fetching + ${S}/configure \ + "--enable-rpath" \ + "--disable-docs" \ + "--disable-manage-submodules" \ + "--disable-debug" \ + "--enable-debuginfo" \ + "--enable-optimize" \ + "--enable-optimize-cxx" \ + "--disable-llvm-version-check" \ + "--llvm-root=${llvmdir}" \ + "--enable-optimize-tests" \ + "--prefix=${prefix}" \ + "--target=${TARGET_SYS}" \ + "--host=${HOST_SYS}" \ + "--build=${BUILD_SYS}" \ + "--localstatedir=${localstatedir}" \ + "--sysconfdir=${sysconfdir}" \ + "--datadir=${datadir}" \ + "--infodir=${infodir}" \ + "--mandir=${mandir}" \ + "--libdir=${libdir}" \ + "--bindir=${bindir}" \ + "--platform-cfg=${B}/mk-cfg/" \ + ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ + ${EXTRA_OECONF} +} + +rust_runmake () { + echo "COMPILE ${PN}" "$@" + env + + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just TARGET). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS + + oe_runmake "VERBOSE=1" "$@" +} + +do_compile () { + if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then + mkdir -p dl + cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl + fi + rust_runmake +} + +rust_do_install () { + rust_runmake DESTDIR="${D}" install + + # Rust's install.sh doesn't mark executables as executable because + # we're using a custom bindir, do it ourselves. + chmod +x "${D}/${bindir}/rustc" + chmod +x "${D}/${bindir}/rustdoc" + chmod +x "${D}/${bindir}/rust-gdb" + + # Install our custom target.json files + local td="${D}${libdir}/rustlib/" + install -d "$td" + for tgt in "${WORKDIR}/targets/"* ; do + install -m 0644 "$tgt" "$td" + done + + ## rust will complain about multiple providers of the runtime libs + ## (libstd, libsync, etc.) without this. + (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) +} + +do_install () { + rust_do_install +} + From 55ab1927d719144ed914c621c5611cc22c4b1981 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Tue, 16 Feb 2016 10:43:29 -0500 Subject: [PATCH 37/47] rust: better llvm feature choice based on TUNE_FEATURES --- recipes/rust/rust.inc | 111 +++++++++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 24 deletions(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index e6d495d..a04d795 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -31,6 +31,65 @@ export RUST_TARGET_PATH="${WORKDIR}/targets/" export FORCE_CRATE_HASH="${BB_TASKHASH}" +# Right now this is focused on arm-specific tune features. +# We get away with this for now as one can only use x86-64 as the build host +# (not arm). +# Note that TUNE_FEATURES is _always_ refering to the target, so we really +# don't want to use this for the host/build. +def llvm_features_from_tune(d): + f = [] + feat = d.getVar('TUNE_FEATURES', True) + if not feat: + return "" + feat = frozenset(feat.split()) + + if 'vfpv4' in feat: + f += "+vfp4" + if 'vfpv3' in feat: + f += "+vfp3" + if 'vfpv3d16' in feat: + f += "+d16" + if 'vfpv2' in feat: + f += "+vfp2" + + if 'neon' in feat: + f += "+neon" + + if 'aarch64' in feat: + f += "+v8" + + v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve']) + if not feat.isdisjoint(v7): + f += "+v7" + if 'armv6' in feat: + f += "+v6" + + if 'dsp' in feat: + f += "+dsp" + + if d.getVar('ARM_THUMB_OPT', True) is "thumb": + if not feat.isdisjoint(v7): + f += "+thumb2" + f += "thumb-mode" + + if 'cortexa5' in feat: + f += "+a5" + if 'cortexa7' in feat: + f += "+a7" + if 'cortexa9' in feat: + f += "+a9" + if 'cortexa15' in feat: + f += "+a15" + if 'cortexa17' in feat: + f += "+a17" + + # Seems like it could be infered by the lack of vfp options, but we'll + # include it anyhow + if 'soft' in feat: + f += "+soft-float" + + return ','.join(f) + ## arm-unknown-linux-gnueabihf DATA_LAYOUT[arm] = "e-p:32:32:32-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:64:128-a0:0:64-n32" LLVM_TARGET[arm] = "${RUST_TARGET_SYS}" @@ -139,6 +198,13 @@ def ldflags_for(d, thing, arch): a.extend(post_link_args_for(d, thing, arch)) return a +TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)}" +TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)}" + +# class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real +# (original) target. +TARGET_LLVM_FEATURES_class-native = "" + def rust_gen_target(d, thing, wd): arch = arch_for(d, thing) sys = sys_for(d, thing) @@ -155,7 +221,11 @@ def rust_gen_target(d, thing, wd): ccache = d.getVar('CCACHE', True) linker = "{}{}gcc".format(ccache, prefix) objcopy = "{}objcopy".format(prefix) - features = d.getVarFlag('FEATURES', arch, True) or "" + + features = "" + if thing is "TARGET": + features = d.getVar('TARGET_LLVM_FEATURES', True) or "" + features = features or d.getVarFlag('FEATURES', arch, True) or "" pre_link_args = pre_link_args_for(d, thing, arch) post_link_args = post_link_args_for(d, thing, arch) @@ -196,16 +266,15 @@ def rust_gen_target(d, thing, wd): python do_rust_gen_targets () { wd = d.getVar('WORKDIR', True) + '/targets/' - try: - os.makedirs(wd) - except OSError as e: - if e.errno != 17: - raise e + # It is important 'TARGET' is last here so that it overrides our less + # informed choices for BUILD & HOST if TARGET happens to be the same as + # either of them. for thing in ['BUILD', 'HOST', 'TARGET']: bb.debug(1, "rust_gen_target for " + thing) rust_gen_target(d, thing, wd) } addtask rust_gen_targets after do_patch before do_compile +do_rust_gen_targets[dirs] += "${WORKDIR}/targets" def rust_gen_mk_cfg(d, thing): '''' @@ -219,20 +288,7 @@ def rust_gen_mk_cfg(d, thing): Note that the configure process also depends on the existence of #1, so we have to run this before do_configure ''' - - import shutil, subprocess - - import errno - import os - - def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(path): - pass - else: - raise + import subprocess rust_base_sys = rust_base_triple(d, thing) arch = arch_for(d, thing) @@ -241,8 +297,7 @@ def rust_gen_mk_cfg(d, thing): llvm_target = d.getVarFlag('LLVM_TARGET', arch, True) ldflags = ' '.join(ldflags_for(d, thing, arch)) - b = d.getVar('B', True) + '/mk-cfg/' - mkdir_p(b) + b = d.getVar('WORKDIR', True) + '/mk-cfg/' o = open(b + sys_for(d, thing) + '.mk', 'w') i = open(d.getVar('S', True) + '/mk/cfg/' + rust_base_sys + '.mk', 'r') @@ -286,11 +341,19 @@ python do_rust_arch_fixup () { rust_gen_mk_cfg(d, thing) } addtask rust_arch_fixup before do_configure after do_patch -do_rust_arch_fixup[dirs] = "${S}/mk/cfg" +do_rust_arch_fixup[dirs] += "${WORKDIR}/mk-cfg" llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" do_configure () { + # Note: when we adjust the generated targets, rust doesn't rebuild (even + # when it should), so for now we need to remove the build dir to keep + # things in sync. + cd "${WORKDIR}" + rm -rf "${B}/" + mkdir -p "${B}/" + cd "${B}" + # FIXME: target_prefix vs prefix, see cross.bbclass # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a @@ -341,7 +404,7 @@ do_configure () { "--mandir=${mandir}" \ "--libdir=${libdir}" \ "--bindir=${bindir}" \ - "--platform-cfg=${B}/mk-cfg/" \ + "--platform-cfg=${WORKDIR}/mk-cfg/" \ ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ ${EXTRA_OECONF} } From 4b03af4190ab7130aa1a695cbee307dc77fe1cde Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 17 Feb 2016 21:14:00 -0500 Subject: [PATCH 38/47] security-flags: remove now defunct un-suffixed rust-cross package reference --- conf/distro/include/rust_security_flags.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/distro/include/rust_security_flags.inc b/conf/distro/include/rust_security_flags.inc index 91f3e2a..d90535e 100644 --- a/conf/distro/include/rust_security_flags.inc +++ b/conf/distro/include/rust_security_flags.inc @@ -1,6 +1,5 @@ # Build errors with PIE options enabled SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}" -SECURITY_CFLAGS_pn-rust-cross = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}" SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}" From fa53e7a70dda652362e2c8e7fc4c70c51aaeb027 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 17 Feb 2016 21:20:32 -0500 Subject: [PATCH 39/47] rust.inc: normalize to expanded 4 space tabs I had previously mixed using hard tabs, 8 spaces, and 4 spaces (due to editor defaulting to hard tabs and the occasional change to 4 spaces to work on python code). Try to avoid that with a vim modeline --- recipes/rust/rust.inc | 159 +++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index a04d795..e2a9ed8 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -1,3 +1,4 @@ +# ex: sts=4 et sw=4 ts=8 inherit rust inherit rust-installer require rust-shared-source.inc @@ -354,106 +355,106 @@ do_configure () { mkdir -p "${B}/" cd "${B}" - # FIXME: target_prefix vs prefix, see cross.bbclass + # FIXME: target_prefix vs prefix, see cross.bbclass - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just HOST). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just HOST). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS - # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case - # where we're reinstalling the compiler. May want to try for a real - # path based on bitbake vars - # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. - local_maybe_enable=disable - local_rust_root=/not/set/do/not/use - if which rustc >/dev/null 2>&1; then - local_rustc=$(which rustc) - if [ -n "$local_rustc" ]; then - local_rust_root=$(dirname $(dirname $local_rustc)) - if [ -e "$local_rust_root/bin/rustc" ]; then - local_maybe_enable=enable - fi + # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case + # where we're reinstalling the compiler. May want to try for a real + # path based on bitbake vars + # Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'. + local_maybe_enable=disable + local_rust_root=/not/set/do/not/use + if which rustc >/dev/null 2>&1; then + local_rustc=$(which rustc) + if [ -n "$local_rustc" ]; then + local_rust_root=$(dirname $(dirname $local_rustc)) + if [ -e "$local_rust_root/bin/rustc" ]; then + local_maybe_enable=enable fi fi + fi - # - rpath is required otherwise rustc fails to resolve symbols - # - submodule management is done by bitbake's fetching - ${S}/configure \ - "--enable-rpath" \ - "--disable-docs" \ - "--disable-manage-submodules" \ - "--disable-debug" \ - "--enable-debuginfo" \ - "--enable-optimize" \ - "--enable-optimize-cxx" \ - "--disable-llvm-version-check" \ - "--llvm-root=${llvmdir}" \ - "--enable-optimize-tests" \ - "--prefix=${prefix}" \ - "--target=${TARGET_SYS}" \ - "--host=${HOST_SYS}" \ - "--build=${BUILD_SYS}" \ - "--localstatedir=${localstatedir}" \ - "--sysconfdir=${sysconfdir}" \ - "--datadir=${datadir}" \ - "--infodir=${infodir}" \ - "--mandir=${mandir}" \ - "--libdir=${libdir}" \ - "--bindir=${bindir}" \ - "--platform-cfg=${WORKDIR}/mk-cfg/" \ - ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ - ${EXTRA_OECONF} + # - rpath is required otherwise rustc fails to resolve symbols + # - submodule management is done by bitbake's fetching + ${S}/configure \ + "--enable-rpath" \ + "--disable-docs" \ + "--disable-manage-submodules" \ + "--disable-debug" \ + "--enable-debuginfo" \ + "--enable-optimize" \ + "--enable-optimize-cxx" \ + "--disable-llvm-version-check" \ + "--llvm-root=${llvmdir}" \ + "--enable-optimize-tests" \ + "--prefix=${prefix}" \ + "--target=${TARGET_SYS}" \ + "--host=${HOST_SYS}" \ + "--build=${BUILD_SYS}" \ + "--localstatedir=${localstatedir}" \ + "--sysconfdir=${sysconfdir}" \ + "--datadir=${datadir}" \ + "--infodir=${infodir}" \ + "--mandir=${mandir}" \ + "--libdir=${libdir}" \ + "--bindir=${bindir}" \ + "--platform-cfg=${WORKDIR}/mk-cfg/" \ + ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \ + ${EXTRA_OECONF} } rust_runmake () { - echo "COMPILE ${PN}" "$@" - env + echo "COMPILE ${PN}" "$@" + env - # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a - # wide range of targets (not just TARGET). Yocto's settings for them will - # be inappropriate, avoid using. - unset CFLAGS - unset LDFLAGS - unset CXXFLAGS - unset CPPFLAGS + # CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a + # wide range of targets (not just TARGET). Yocto's settings for them will + # be inappropriate, avoid using. + unset CFLAGS + unset LDFLAGS + unset CXXFLAGS + unset CPPFLAGS - oe_runmake "VERBOSE=1" "$@" + oe_runmake "VERBOSE=1" "$@" } do_compile () { - if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then - mkdir -p dl - cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl - fi - rust_runmake + if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then + mkdir -p dl + cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl + fi + rust_runmake } rust_do_install () { - rust_runmake DESTDIR="${D}" install + rust_runmake DESTDIR="${D}" install - # Rust's install.sh doesn't mark executables as executable because - # we're using a custom bindir, do it ourselves. - chmod +x "${D}/${bindir}/rustc" - chmod +x "${D}/${bindir}/rustdoc" - chmod +x "${D}/${bindir}/rust-gdb" + # Rust's install.sh doesn't mark executables as executable because + # we're using a custom bindir, do it ourselves. + chmod +x "${D}/${bindir}/rustc" + chmod +x "${D}/${bindir}/rustdoc" + chmod +x "${D}/${bindir}/rust-gdb" - # Install our custom target.json files - local td="${D}${libdir}/rustlib/" - install -d "$td" - for tgt in "${WORKDIR}/targets/"* ; do - install -m 0644 "$tgt" "$td" - done + # Install our custom target.json files + local td="${D}${libdir}/rustlib/" + install -d "$td" + for tgt in "${WORKDIR}/targets/"* ; do + install -m 0644 "$tgt" "$td" + done - ## rust will complain about multiple providers of the runtime libs - ## (libstd, libsync, etc.) without this. - (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) + ## rust will complain about multiple providers of the runtime libs + ## (libstd, libsync, etc.) without this. + (cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .) } do_install () { - rust_do_install + rust_do_install } From 898efb793c703901691b263bd76b9727777f32ee Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Wed, 17 Feb 2016 21:50:42 -0500 Subject: [PATCH 40/47] rust: llvm_features: += does string concat, use .append() --- recipes/rust/rust.inc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index e2a9ed8..0d388cb 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -45,49 +45,49 @@ def llvm_features_from_tune(d): feat = frozenset(feat.split()) if 'vfpv4' in feat: - f += "+vfp4" + f.append("+vfp4") if 'vfpv3' in feat: - f += "+vfp3" + f.append("+vfp3") if 'vfpv3d16' in feat: - f += "+d16" + f.append("+d16") if 'vfpv2' in feat: - f += "+vfp2" + f.append("+vfp2") if 'neon' in feat: - f += "+neon" + f.append("+neon") if 'aarch64' in feat: - f += "+v8" + f.append("+v8") v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve']) if not feat.isdisjoint(v7): - f += "+v7" + f.append("+v7") if 'armv6' in feat: - f += "+v6" + f.append("+v6") if 'dsp' in feat: - f += "+dsp" + f.append("+dsp") if d.getVar('ARM_THUMB_OPT', True) is "thumb": if not feat.isdisjoint(v7): - f += "+thumb2" - f += "thumb-mode" + f.append("+thumb2") + f.append("thumb-mode") if 'cortexa5' in feat: - f += "+a5" + f.append("+a5") if 'cortexa7' in feat: - f += "+a7" + f.append("+a7") if 'cortexa9' in feat: - f += "+a9" + f.append("+a9") if 'cortexa15' in feat: - f += "+a15" + f.append("+a15") if 'cortexa17' in feat: - f += "+a17" + f.append("+a17") # Seems like it could be infered by the lack of vfp options, but we'll # include it anyhow if 'soft' in feat: - f += "+soft-float" + f.append("+soft-float") return ','.join(f) From 38c950b0a167ee54468827cf7c2d636ef523fc88 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 18 Feb 2016 00:32:38 -0500 Subject: [PATCH 41/47] rust/tune: treat vfp as vfpv2 --- recipes/rust/rust.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 0d388cb..b053d02 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -50,7 +50,8 @@ def llvm_features_from_tune(d): f.append("+vfp3") if 'vfpv3d16' in feat: f.append("+d16") - if 'vfpv2' in feat: + + if 'vfpv2' in feat or 'vfp' in feat: f.append("+vfp2") if 'neon' in feat: From 2eafa1892d1a735d0c978359f7b49552c03b7aca Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Thu, 18 Feb 2016 00:35:42 -0500 Subject: [PATCH 42/47] rust/tune: add missing + --- recipes/rust/rust.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index b053d02..6c4bf8c 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -72,7 +72,7 @@ def llvm_features_from_tune(d): if d.getVar('ARM_THUMB_OPT', True) is "thumb": if not feat.isdisjoint(v7): f.append("+thumb2") - f.append("thumb-mode") + f.append("+thumb-mode") if 'cortexa5' in feat: f.append("+a5") From 78e51cd7f4d7d1e7ecbf65709253eb041e3525a3 Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Thu, 18 Feb 2016 13:24:43 -0500 Subject: [PATCH 43/47] Address parse errors while using getVar to calculate dependency information --- classes/cargo.bbclass | 2 +- classes/rust-bin.bbclass | 2 +- classes/rust.bbclass | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 254e5b3..184d3e0 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -5,7 +5,7 @@ export CARGO_HOME = "${WORKDIR}/cargo_home" def cargo_base_dep(d): deps = "" - if not d.getVar('INHIBIT_DEFAULT_DEPS') and not d.getVar('INHIBIT_CARGO_DEP'): + if not d.getVar('INHIBIT_DEFAULT_DEPS', True) and not d.getVar('INHIBIT_CARGO_DEP', True): deps += " cargo-native" return deps diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index 4221fed..b5d239b 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -23,7 +23,7 @@ OVERLAP_LIBS = "\ rand \ " def get_overlap_deps(d): - deps = d.getVar("DEPENDS").split() + deps = d.getVar("DEPENDS", True).split() overlap_deps = [] for o in d.getVar("OVERLAP_LIBS", True).split(): l = len([o for dep in deps if (o + '-rs' in dep)]) diff --git a/classes/rust.bbclass b/classes/rust.bbclass index 5270fc5..030f1ed 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -7,7 +7,7 @@ def rust_base_dep(d): # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to # use rust instead of gcc deps = "" - if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS'): + if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS', True): if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)): deps += " virtual/${TARGET_PREFIX}rust" else: From 99bb5f6e55ac7f19068c6c4711d46f06a1d76491 Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Thu, 18 Feb 2016 14:43:31 -0500 Subject: [PATCH 44/47] Use the shared source mechanism for the llvm patch --- .../files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch | 4 ++-- recipes/rust/rust-llvm.inc | 2 -- recipes/rust/rust-source.bb | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch b/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch index 43c52d7..66d7078 100644 --- a/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch +++ b/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch @@ -1,5 +1,5 @@ -lude/llvm/CodeGen/CommandFlags.h.orig 2016-01-18 19:18:03.847470845 +0000 -+++ llvm/include/llvm/CodeGen/CommandFlags.h 2016-01-18 19:18:11.211408270 +0000 ++++ llvm/src/llvm/include/llvm/CodeGen/CommandFlags.h.orig 2016-01-18 19:18:03.847470845 +0000 ++++ llvm/src/llvm/include/llvm/CodeGen/CommandFlags.h 2016-01-18 19:18:11.211408270 +0000 @@ -21,7 +21,7 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" diff --git a/recipes/rust/rust-llvm.inc b/recipes/rust/rust-llvm.inc index 15a8ddc..0ed6096 100644 --- a/recipes/rust/rust-llvm.inc +++ b/recipes/rust/rust-llvm.inc @@ -5,8 +5,6 @@ LICENSE = "NCSA" S .= "/src/llvm" -SRC_URI_append = "file://rust-llvm/0000-rust-llvm-remove-extra-slash.patch" - inherit autotools EXTRA_OECONF += "--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc" diff --git a/recipes/rust/rust-source.bb b/recipes/rust/rust-source.bb index 63d3792..e0a2185 100644 --- a/recipes/rust/rust-source.bb +++ b/recipes/rust/rust-source.bb @@ -26,6 +26,6 @@ SRC_URI_append = "\ file://rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch \ file://rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ file://rust/0013-mk-allow-changing-the-platform-configuration-source-.patch \ -\ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ + file://rust-llvm/0000-rust-llvm-remove-extra-slash.patch \ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ " From a4d6b55448d5c101c2373bb3f442d7e38750b180 Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Thu, 18 Feb 2016 14:55:24 -0500 Subject: [PATCH 45/47] Allow the fetch to complete before attempting to patch Signed-off-by: Derek Straka --- classes/shared-source-use.bbclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/classes/shared-source-use.bbclass b/classes/shared-source-use.bbclass index 7df9916..a209430 100644 --- a/classes/shared-source-use.bbclass +++ b/classes/shared-source-use.bbclass @@ -1,4 +1,3 @@ S = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" -do_configure[depends] += "${SOURCE_NAME}-source-${PV}:do_patch" -do_populate_lic[depends] += "${SOURCE_NAME}-source-${PV}:do_unpack" +do_unpack[depends] += "${SOURCE_NAME}-source-${PV}:do_patch" From 94daa39193b3184baa2445acd8b983b8bc006d7f Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Fri, 19 Feb 2016 10:34:00 -0500 Subject: [PATCH 46/47] Remove the '--disable-static' in the EXTRA_OECONF for all rust-like recipes --- classes/rust.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/rust.bbclass b/classes/rust.bbclass index 030f1ed..0e92991 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -82,3 +82,5 @@ HOST_LDFLAGS ?= "${LDFLAGS}" HOST_CFLAGS ?= "${CFLAGS}" HOST_CXXFLAGS ?= "${CXXFLAGS}" HOST_CPPFLAGS ?= "${CPPFLAGS}" + +EXTRA_OECONF_remove = "--disable-static" From e76332d73222e6a65f326932375efdffea22f40e Mon Sep 17 00:00:00 2001 From: Derek Straka Date: Fri, 19 Feb 2016 19:10:12 -0500 Subject: [PATCH 47/47] Move the cargo and rust recipes from 'recipes' to 'recipes-devtools' --- conf/layer.conf | 2 +- {recipes => recipes-devtools}/cargo/cargo-snapshot.inc | 0 {recipes => recipes-devtools}/cargo/cargo.inc | 0 {recipes => recipes-devtools}/cargo/cargo_0.7.0.bb | 0 .../cargo/files/0001-disable-cargo-snapshot-fetch.patch | 0 .../0001-curl-sys-avoid-explicitly-linking-in-openssl.patch | 0 .../curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch | 0 .../files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch | 0 .../0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch | 0 .../files/tar-rs/0001-update-to-new-io-FileType-enum.patch | 0 .../0001-add-option-to-disable-rewriting-of-install-paths.patch | 0 .../files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch | 0 .../files/rust/0001-platform.mk-avoid-choking-on-i586.patch | 0 ...2-Target-add-default-target.json-path-libdir-rust-targ.patch | 0 ...3-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch | 0 .../files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch | 0 ...5-configure-support-bindir-and-extend-libdir-to-non-bl.patch | 0 ...0006-std-thread_local-workaround-for-NULL-__dso_handle.patch | 0 .../files/rust/0007-mk-install-use-disable-rewrite-paths.patch | 0 .../rust/files/rust/0008-install-disable-ldconfig.patch | 0 .../rust/0009-Remove-crate-metadata-from-symbol-hashing.patch | 0 ...0-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch | 0 .../0011-Allow-overriding-crate_hash-with-C-crate_hash.patch | 0 .../rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch | 0 ...3-mk-allow-changing-the-platform-configuration-source-.patch | 0 {recipes => recipes-devtools}/rust/rust-cross.bb | 0 {recipes => recipes-devtools}/rust/rust-llvm.bb | 0 {recipes => recipes-devtools}/rust/rust-llvm.inc | 0 {recipes => recipes-devtools}/rust/rust-release.inc | 0 {recipes => recipes-devtools}/rust/rust-shared-source.inc | 0 {recipes => recipes-devtools}/rust/rust-snapshot-2015-08-11.inc | 0 {recipes => recipes-devtools}/rust/rust-source.bb | 0 {recipes => recipes-devtools}/rust/rust-version.inc | 0 {recipes => recipes-devtools}/rust/rust.bb | 0 {recipes => recipes-devtools}/rust/rust.inc | 0 {recipes => recipes-devtools}/rust/rustlib.bb | 0 36 files changed, 1 insertion(+), 1 deletion(-) rename {recipes => recipes-devtools}/cargo/cargo-snapshot.inc (100%) rename {recipes => recipes-devtools}/cargo/cargo.inc (100%) rename {recipes => recipes-devtools}/cargo/cargo_0.7.0.bb (100%) rename {recipes => recipes-devtools}/cargo/files/0001-disable-cargo-snapshot-fetch.patch (100%) rename {recipes => recipes-devtools}/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch (100%) rename {recipes => recipes-devtools}/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch (100%) rename {recipes => recipes-devtools}/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch (100%) rename {recipes => recipes-devtools}/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch (100%) rename {recipes => recipes-devtools}/cargo/files/tar-rs/0001-update-to-new-io-FileType-enum.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0008-install-disable-ldconfig.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch (100%) rename {recipes => recipes-devtools}/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch (100%) rename {recipes => recipes-devtools}/rust/rust-cross.bb (100%) rename {recipes => recipes-devtools}/rust/rust-llvm.bb (100%) rename {recipes => recipes-devtools}/rust/rust-llvm.inc (100%) rename {recipes => recipes-devtools}/rust/rust-release.inc (100%) rename {recipes => recipes-devtools}/rust/rust-shared-source.inc (100%) rename {recipes => recipes-devtools}/rust/rust-snapshot-2015-08-11.inc (100%) rename {recipes => recipes-devtools}/rust/rust-source.bb (100%) rename {recipes => recipes-devtools}/rust/rust-version.inc (100%) rename {recipes => recipes-devtools}/rust/rust.bb (100%) rename {recipes => recipes-devtools}/rust/rust.inc (100%) rename {recipes => recipes-devtools}/rust/rustlib.bb (100%) diff --git a/conf/layer.conf b/conf/layer.conf index 56e1381..ee72806 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -2,7 +2,7 @@ BBPATH .= ":${LAYERDIR}" # We have a recipes directory, add to BBFILES -BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "rust-layer" BBFILE_PATTERN_rust-layer := "^${LAYERDIR}/" diff --git a/recipes/cargo/cargo-snapshot.inc b/recipes-devtools/cargo/cargo-snapshot.inc similarity index 100% rename from recipes/cargo/cargo-snapshot.inc rename to recipes-devtools/cargo/cargo-snapshot.inc diff --git a/recipes/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc similarity index 100% rename from recipes/cargo/cargo.inc rename to recipes-devtools/cargo/cargo.inc diff --git a/recipes/cargo/cargo_0.7.0.bb b/recipes-devtools/cargo/cargo_0.7.0.bb similarity index 100% rename from recipes/cargo/cargo_0.7.0.bb rename to recipes-devtools/cargo/cargo_0.7.0.bb diff --git a/recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch b/recipes-devtools/cargo/files/0001-disable-cargo-snapshot-fetch.patch similarity index 100% rename from recipes/cargo/files/0001-disable-cargo-snapshot-fetch.patch rename to recipes-devtools/cargo/files/0001-disable-cargo-snapshot-fetch.patch diff --git a/recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch b/recipes-devtools/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch similarity index 100% rename from recipes/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch rename to recipes-devtools/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.patch diff --git a/recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch b/recipes-devtools/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch similarity index 100% rename from recipes/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch rename to recipes-devtools/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch diff --git a/recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch b/recipes-devtools/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch similarity index 100% rename from recipes/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch rename to recipes-devtools/cargo/files/git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch diff --git a/recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch b/recipes-devtools/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch similarity index 100% rename from recipes/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch rename to recipes-devtools/cargo/files/ssh2-rs/0001-libssh2-sys-avoid-explicitly-linking-in-openssl.patch diff --git a/recipes/cargo/files/tar-rs/0001-update-to-new-io-FileType-enum.patch b/recipes-devtools/cargo/files/tar-rs/0001-update-to-new-io-FileType-enum.patch similarity index 100% rename from recipes/cargo/files/tar-rs/0001-update-to-new-io-FileType-enum.patch rename to recipes-devtools/cargo/files/tar-rs/0001-update-to-new-io-FileType-enum.patch diff --git a/recipes/rust/files/rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch b/recipes-devtools/rust/files/rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch similarity index 100% rename from recipes/rust/files/rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch rename to recipes-devtools/rust/files/rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch diff --git a/recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch b/recipes-devtools/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch similarity index 100% rename from recipes/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch rename to recipes-devtools/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch diff --git a/recipes/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch b/recipes-devtools/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch similarity index 100% rename from recipes/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch rename to recipes-devtools/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch diff --git a/recipes/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch b/recipes-devtools/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch similarity index 100% rename from recipes/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch rename to recipes-devtools/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch diff --git a/recipes/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch b/recipes-devtools/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch similarity index 100% rename from recipes/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch rename to recipes-devtools/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch diff --git a/recipes/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch b/recipes-devtools/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch similarity index 100% rename from recipes/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch rename to recipes-devtools/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch diff --git a/recipes/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch b/recipes-devtools/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch similarity index 100% rename from recipes/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch rename to recipes-devtools/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch diff --git a/recipes/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch b/recipes-devtools/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch similarity index 100% rename from recipes/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch rename to recipes-devtools/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch diff --git a/recipes/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch b/recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch similarity index 100% rename from recipes/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch rename to recipes-devtools/rust/files/rust/0007-mk-install-use-disable-rewrite-paths.patch diff --git a/recipes/rust/files/rust/0008-install-disable-ldconfig.patch b/recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch similarity index 100% rename from recipes/rust/files/rust/0008-install-disable-ldconfig.patch rename to recipes-devtools/rust/files/rust/0008-install-disable-ldconfig.patch diff --git a/recipes/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch b/recipes-devtools/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch similarity index 100% rename from recipes/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch rename to recipes-devtools/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch diff --git a/recipes/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch b/recipes-devtools/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch similarity index 100% rename from recipes/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch rename to recipes-devtools/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch diff --git a/recipes/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch b/recipes-devtools/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch similarity index 100% rename from recipes/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch rename to recipes-devtools/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch diff --git a/recipes/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch b/recipes-devtools/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch similarity index 100% rename from recipes/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch rename to recipes-devtools/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch diff --git a/recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch b/recipes-devtools/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch similarity index 100% rename from recipes/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch rename to recipes-devtools/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch diff --git a/recipes/rust/rust-cross.bb b/recipes-devtools/rust/rust-cross.bb similarity index 100% rename from recipes/rust/rust-cross.bb rename to recipes-devtools/rust/rust-cross.bb diff --git a/recipes/rust/rust-llvm.bb b/recipes-devtools/rust/rust-llvm.bb similarity index 100% rename from recipes/rust/rust-llvm.bb rename to recipes-devtools/rust/rust-llvm.bb diff --git a/recipes/rust/rust-llvm.inc b/recipes-devtools/rust/rust-llvm.inc similarity index 100% rename from recipes/rust/rust-llvm.inc rename to recipes-devtools/rust/rust-llvm.inc diff --git a/recipes/rust/rust-release.inc b/recipes-devtools/rust/rust-release.inc similarity index 100% rename from recipes/rust/rust-release.inc rename to recipes-devtools/rust/rust-release.inc diff --git a/recipes/rust/rust-shared-source.inc b/recipes-devtools/rust/rust-shared-source.inc similarity index 100% rename from recipes/rust/rust-shared-source.inc rename to recipes-devtools/rust/rust-shared-source.inc diff --git a/recipes/rust/rust-snapshot-2015-08-11.inc b/recipes-devtools/rust/rust-snapshot-2015-08-11.inc similarity index 100% rename from recipes/rust/rust-snapshot-2015-08-11.inc rename to recipes-devtools/rust/rust-snapshot-2015-08-11.inc diff --git a/recipes/rust/rust-source.bb b/recipes-devtools/rust/rust-source.bb similarity index 100% rename from recipes/rust/rust-source.bb rename to recipes-devtools/rust/rust-source.bb diff --git a/recipes/rust/rust-version.inc b/recipes-devtools/rust/rust-version.inc similarity index 100% rename from recipes/rust/rust-version.inc rename to recipes-devtools/rust/rust-version.inc diff --git a/recipes/rust/rust.bb b/recipes-devtools/rust/rust.bb similarity index 100% rename from recipes/rust/rust.bb rename to recipes-devtools/rust/rust.bb diff --git a/recipes/rust/rust.inc b/recipes-devtools/rust/rust.inc similarity index 100% rename from recipes/rust/rust.inc rename to recipes-devtools/rust/rust.inc diff --git a/recipes/rust/rustlib.bb b/recipes-devtools/rust/rustlib.bb similarity index 100% rename from recipes/rust/rustlib.bb rename to recipes-devtools/rust/rustlib.bb