diff --git a/recipes-core/memchr/memchr-rs_0.1.3.bb b/recipes-core/memchr/memchr-rs_0.1.11.bb similarity index 88% rename from recipes-core/memchr/memchr-rs_0.1.3.bb rename to recipes-core/memchr/memchr-rs_0.1.11.bb index b216cfd..b624ff2 100644 --- a/recipes-core/memchr/memchr-rs_0.1.3.bb +++ b/recipes-core/memchr/memchr-rs_0.1.11.bb @@ -7,7 +7,7 @@ DEPENDS = "libc-rs" inherit rust-bin SRC_URI = "git://github.com/BurntSushi/rust-memchr.git;protocol=https" -SRCREV = "a91e63378bf6f4bba5c7d88f4fe98efdcb432c99" +SRCREV = "4f9a13f95e6e00f2847c093c56b41b9c1d58d3c4" S = "${WORKDIR}/git" diff --git a/recipes-core/rand/rand-rs_0.3.8.bb b/recipes-core/rand/rand-rs_0.3.14.bb similarity index 90% rename from recipes-core/rand/rand-rs_0.3.8.bb rename to recipes-core/rand/rand-rs_0.3.14.bb index 566cac9..a8c31c7 100644 --- a/recipes-core/rand/rand-rs_0.3.8.bb +++ b/recipes-core/rand/rand-rs_0.3.14.bb @@ -10,7 +10,7 @@ DEPENDS = "libc-rs" inherit rust-bin SRC_URI = "git://github.com/rust-lang/rand.git;protocol=https" -SRCREV = "164659b01e6fdb4d9a8e52b7a7451e8174e91821" +SRCREV = "f872fda5fb8fb899a837ee9eee0332076a8f5300" S = "${WORKDIR}/git" diff --git a/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.19.bb similarity index 90% rename from recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb rename to recipes-core/rustc-serialize/rustc-serialize-rs_0.3.19.bb index 87835dc..ac0813f 100644 --- a/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb +++ b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.19.bb @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "\ inherit rust-bin SRC_URI = "git://github.com/rust-lang/rustc-serialize.git;protocol=https" -SRCREV = "376f43a4b94dbe411bd9534ab83f02fbcb5a3b04" +SRCREV = "64b38a1f31a9af6eabf2894437aa5ccc3e457e68" S = "${WORKDIR}/git" diff --git a/recipes-devtools/cargo/cargo_0.10.0.bb b/recipes-devtools/cargo/cargo_0.11.0.bb similarity index 76% rename from recipes-devtools/cargo/cargo_0.10.0.bb rename to recipes-devtools/cargo/cargo_0.11.0.bb index 0c57945..f977673 100644 --- a/recipes-devtools/cargo/cargo_0.10.0.bb +++ b/recipes-devtools/cargo/cargo_0.11.0.bb @@ -2,16 +2,17 @@ require cargo-snapshot.inc require cargo.inc SRC_URI += " \ - https://github.com/rust-lang/cargo/archive/${PV}.tar.gz;name=cargo \ + git://github.com/rust-lang/cargo.git;protocol=https;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 \ + git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${S}/src/rust-installer \ " -SRC_URI[cargo.md5sum] = "98ab2a422634d447152380898a974b08" -SRC_URI[cargo.sha256sum] = "1e73c038681fe308195427b71322a6350c65d3b8cbea199e45c7b672b4754e0e" +# Compatible with Rust 1.10.0 +# https://static.rust-lang.org/dist/channel-rust-1.10.0.toml +SRCREV_cargo = "259324cd8f9bb6e1068a3a2b77685e90fda3e3b6" SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499" -S = "${WORKDIR}/${BP}" +S = "${WORKDIR}/git" LIC_FILES_CHKSUM ="\ file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ @@ -26,8 +27,8 @@ SRC_URI += "\ 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" +# 0.2.19 / -sys 0.1.34 +SRCREV_curl-rust = "45b8cb56fbed45f828f96bdd8c286b2b3a8a26cb" SRCREV_FORMAT .= "_curl-rust" EXTRA_OECARGO_PATHS += "${WORKDIR}/curl-rust" @@ -50,8 +51,8 @@ SRC_URI += "\ file://git2-rs/0001-libgit2-sys-avoid-blessed-triples.patch;patchdir=../git2-rs \ " -# 0.3.3 / -sys 0.3.8 -SRCREV_git2-rs = "19b6873c1fad7dc93c9c2dac4cba339dacf16efa" +# 0.4.3 / -sys 0.4.2 +SRCREV_git2-rs = "cd14fc7801e70d3b26a4e7e5d94785af1f7e9e58" SRCREV_FORMAT .= "_git2-rs" EXTRA_OECARGO_PATHS += "${WORKDIR}/git2-rs" diff --git a/recipes-devtools/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 index 2e60687..63287db 100644 --- a/recipes-devtools/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 @@ -1,4 +1,4 @@ -From 6d74b6af6a23e195fc54c81a9bbdb21e7d5b6414 Mon Sep 17 00:00:00 2001 +From 8f82cc69e50e7c8e48a2e20b7061483a28bd0d7f 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 @@ -6,22 +6,27 @@ 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/Cargo.toml | 38 -------------------------------------- curl-sys/lib.rs | 2 -- - 2 files changed, 28 deletions(-) + 2 files changed, 40 deletions(-) diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml -index bf994bf..f153039 100644 +index 24bc4fa..dd56209 100644 --- a/curl-sys/Cargo.toml +++ b/curl-sys/Cargo.toml -@@ -19,29 +19,3 @@ path = "lib.rs" +@@ -19,42 +19,4 @@ path = "lib.rs" [dependencies] libz-sys = ">= 0" libc = "0.2" - +-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies] +-openssl-sys = ">= 0" +- -# Unix platforms use OpenSSL for now to provide SSL functionality -[target.i686-unknown-linux-gnu.dependencies] -openssl-sys = ">= 0" +-[target.i586-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" -[target.i686-linux-android.dependencies] -openssl-sys = ">= 0" -[target.x86_64-unknown-linux-gnu.dependencies] @@ -30,10 +35,18 @@ index bf994bf..f153039 100644 -openssl-sys = ">= 0" -[target.arm-unknown-linux-gnueabihf.dependencies] -openssl-sys = ">= 0" +-[target.armv7-unknown-linux-gnueabihf.dependencies] + openssl-sys = "0.7.0" -[target.arm-linux-androideabi.dependencies] -openssl-sys = ">= 0" -[target.aarch64-unknown-linux-gnu.dependencies] -openssl-sys = ">= 0" +-[target.powerpc-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.powerpc64-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" +-[target.powerpc64le-unknown-linux-gnu.dependencies] +-openssl-sys = ">= 0" -[target.i686-unknown-freebsd.dependencies] -openssl-sys = ">= 0" -[target.x86_64-unknown-freebsd.dependencies] @@ -45,7 +58,7 @@ index bf994bf..f153039 100644 -[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 +index 7990bd6..eb6c27a 100644 --- a/curl-sys/lib.rs +++ b/curl-sys/lib.rs @@ -3,8 +3,6 @@ @@ -58,5 +71,5 @@ index be80469..b53b445 100644 use libc::{c_void, c_int, c_char, c_uint, c_long}; -- -2.4.10 +2.9.2 diff --git a/recipes-devtools/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 index 2b2b865..1a455d9 100644 --- a/recipes-devtools/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 @@ -1,17 +1,17 @@ -From 445289f4eacc5c048e4a455bb6d6a6a2b9995e88 Mon Sep 17 00:00:00 2001 +From eb23b1b6f749102e3db92b73a5e55ec6ad688524 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sat, 12 Dec 2015 22:40:33 -0500 Subject: [PATCH 2/2] remove per triple deps on openssl-sys --- - Cargo.toml | 27 +-------------------------- - 1 file changed, 1 insertion(+), 26 deletions(-) + Cargo.toml | 40 +--------------------------------------- + 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml -index 74f63c8..28aa1fa 100644 +index 5f6cf87..0c87156 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -12,36 +12,11 @@ url = "0.2.0" +@@ -12,49 +12,11 @@ url = ">= 0.5, < 2.0" log = "0.3.0" libc = "0.2" curl-sys = { path = "curl-sys", version = "0.1.0" } @@ -21,8 +21,13 @@ index 74f63c8..28aa1fa 100644 env_logger = "0.3.0" -# Unix platforms use OpenSSL for now to provide SSL functionality +-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies] +-openssl-sys = "0.7.0" +- -[target.i686-unknown-linux-gnu.dependencies] -openssl-sys = "0.7.0" +-[target.i586-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" -[target.i686-linux-android.dependencies] -openssl-sys = "0.7.0" -[target.x86_64-unknown-linux-gnu.dependencies] @@ -31,10 +36,18 @@ index 74f63c8..28aa1fa 100644 -openssl-sys = "0.7.0" -[target.arm-unknown-linux-gnueabihf.dependencies] -openssl-sys = "0.7.0" +-[target.armv7-unknown-linux-gnueabihf.dependencies] +-openssl-sys = "0.7.0" -[target.arm-linux-androideabi.dependencies] -openssl-sys = "0.7.0" -[target.aarch64-unknown-linux-gnu.dependencies] -openssl-sys = "0.7.0" +-[target.powerpc-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.powerpc64-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.powerpc64le-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" -[target.i686-unknown-freebsd.dependencies] -openssl-sys = "0.7.0" -[target.x86_64-unknown-freebsd.dependencies] @@ -50,5 +63,5 @@ index 74f63c8..28aa1fa 100644 name = "test" -- -2.4.10 +2.9.2 diff --git a/recipes-devtools/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 index a525607..4a1b448 100644 --- a/recipes-devtools/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 @@ -1,17 +1,17 @@ -From 95709b3f5b1495a57043975d7100461feed46b2f Mon Sep 17 00:00:00 2001 +From 308fd350907fba13f68dcdb8e48040582466cae6 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(-) + libgit2-sys/Cargo.toml | 33 +-------------------------------- + 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml -index 15b28d8..3590878 100644 +index 2395314..29000ef 100644 --- a/libgit2-sys/Cargo.toml +++ b/libgit2-sys/Cargo.toml -@@ -17,32 +17,12 @@ path = "lib.rs" +@@ -17,44 +17,13 @@ path = "lib.rs" libssh2-sys = { version = ">= 0", optional = true } libc = "0.2" libz-sys = ">= 0" @@ -20,17 +20,29 @@ index 15b28d8..3590878 100644 [build-dependencies] pkg-config = "0.3" cmake = "0.1.2" + gcc = "0.3" +-[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies] +-openssl-sys = "0.7.0" +- -[target.i686-unknown-linux-gnu.dependencies] -openssl-sys = "0.7.0" +-[target.i586-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.powerpc64-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" +-[target.powerpc64le-unknown-linux-gnu.dependencies] +-openssl-sys = "0.7.0" -[target.arm-unknown-linux-gnueabihf.dependencies] -openssl-sys = "0.7.0" +-[target.armv7-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] @@ -46,5 +58,5 @@ index 15b28d8..3590878 100644 ssh = ["libssh2-sys"] https = [] -- -2.4.10 +2.9.2 diff --git a/recipes-devtools/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 deleted file mode 100644 index 66d7078..0000000 --- a/recipes-devtools/rust/files/rust-llvm/0000-rust-llvm-remove-extra-slash.patch +++ /dev/null @@ -1,11 +0,0 @@ -+++ 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" - #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-devtools/rust/files/rust-llvm/0001-Don-t-build-unittests.patch b/recipes-devtools/rust/files/rust-llvm/0001-Don-t-build-unittests.patch new file mode 100644 index 0000000..7a297d3 --- /dev/null +++ b/recipes-devtools/rust/files/rust-llvm/0001-Don-t-build-unittests.patch @@ -0,0 +1,34 @@ +From eee79cc95f57434c4b530da96c88494e9b5d056b Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Sat, 27 Aug 2016 13:20:48 -0400 +Subject: [PATCH] Don't build unittests + +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 2b9468a..2bb30f6 100644 +--- a/Makefile ++++ b/Makefile +@@ -31,7 +31,7 @@ ifeq ($(BUILD_DIRS_ONLY),1) + OPTIONAL_DIRS := tools/clang/utils/TableGen + else + DIRS := lib/Support lib/TableGen utils lib/IR lib tools/llvm-shlib \ +- tools/llvm-config tools docs cmake unittests ++ tools/llvm-config tools docs cmake + OPTIONAL_DIRS := projects bindings + endif + +@@ -39,7 +39,7 @@ ifeq ($(BUILD_EXAMPLES),1) + OPTIONAL_DIRS += examples + endif + +-EXTRA_DIST := test unittests llvm.spec include win32 Xcode ++EXTRA_DIST := test llvm.spec include win32 Xcode + + include $(LEVEL)/Makefile.config + +-- +2.7.4 + diff --git a/recipes-devtools/rust/files/rust/0001-Add-config-for-musl-based-arm-builds.patch b/recipes-devtools/rust/files/rust/0001-Add-config-for-musl-based-arm-builds.patch index 29d896e..d8459c0 100644 --- a/recipes-devtools/rust/files/rust/0001-Add-config-for-musl-based-arm-builds.patch +++ b/recipes-devtools/rust/files/rust/0001-Add-config-for-musl-based-arm-builds.patch @@ -1,7 +1,7 @@ -From 185c77dbb5708bed7c916b8e01ff867b6c215bfb Mon Sep 17 00:00:00 2001 +From 69b65762ccdf459143fc273a39b0a0e0c6d8fe3e Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Mon, 2 May 2016 19:57:46 -0400 -Subject: [PATCH] Add config for musl-based arm builds +Subject: [PATCH 01/11] Add config for musl-based arm builds --- mk/cfg/arm-unknown-linux-musleabi.mk | 26 ++++++++++++++++++++++++++ diff --git a/recipes-devtools/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 index 14b0d65..eded81d 100644 --- a/recipes-devtools/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 @@ -1,7 +1,7 @@ -From 3237afb78f960c015025186166f1c0998c00c6a6 Mon Sep 17 00:00:00 2001 +From 0535c75086a9c170d8d4d99b3030d9136ea6e2c7 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: +Subject: [PATCH 02/11] Target: add default target.json path: $libdir/rust/targets --- @@ -11,7 +11,7 @@ Subject: [PATCH 2/9] Target: add default target.json path: 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index c4697eb..4cc059b 100644 +index da5555d..6cd0ea9 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -35,7 +35,7 @@ use getopts; @@ -21,9 +21,9 @@ index c4697eb..4cc059b 100644 -use std::path::PathBuf; +use std::path::{Path, PathBuf}; - use llvm; - -@@ -711,8 +711,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig { + pub struct Config { + pub target: Target, +@@ -787,8 +787,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig { v } @@ -35,10 +35,10 @@ index c4697eb..4cc059b 100644 Err(e) => { panic!(sp.fatal(&format!("Error loading target specification: {}", e))); diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs -index 2f3af1c..6424cff 100644 +index 907241d..d0e3743 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs -@@ -429,13 +429,17 @@ pub fn build_session_(sopts: config::Options, +@@ -470,13 +470,17 @@ pub fn build_session_(sopts: config::Options, codemap: Rc, cstore: Rc CrateStore<'a>>) -> Session { @@ -59,19 +59,19 @@ index 2f3af1c..6424cff 100644 let default_sysroot = match sopts.maybe_sysroot { Some(_) => None, diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs -index 5114910..636a1aa 100644 +index 2163a8a..38607f0 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs -@@ -49,6 +49,8 @@ use serialize::json::Json; +@@ -48,6 +48,8 @@ use serialize::json::Json; use std::default::Default; use std::io::prelude::*; - use syntax::abi; + use syntax::abi::Abi; +use std::borrow::ToOwned; +use std::path::Path; mod android_base; mod apple_base; -@@ -366,12 +368,13 @@ impl Target { +@@ -477,12 +479,13 @@ impl Target { /// /// The error string could come from any of the APIs called, including /// filesystem access and JSON decoding. @@ -85,8 +85,8 @@ index 5114910..636a1aa 100644 + use std::iter::IntoIterator; fn load_file(path: &Path) -> Result { - let mut f = try!(File::open(path).map_err(|e| e.to_string())); -@@ -470,8 +473,14 @@ impl Target { + let mut f = File::open(path).map_err(|e| e.to_string())?; +@@ -513,8 +516,14 @@ impl Target { .unwrap_or(OsString::new()); // FIXME 16351: add a sane default search path? @@ -103,5 +103,5 @@ index 5114910..636a1aa 100644 if p.is_file() { return load_file(&p); -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/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 index 855c90d..3eb103a 100644 --- a/recipes-devtools/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 @@ -1,21 +1,22 @@ -From 3254ad1d84b177eb960219c2bce26f8980a511e1 Mon Sep 17 00:00:00 2001 +From 4290b8f28222824a558ac4471d26fe88b2889a5b 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 +Subject: [PATCH 03/11] 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 | 30 +++++++++++++----------------- - 1 file changed, 13 insertions(+), 17 deletions(-) + mk/main.mk | 29 ++++++++++++----------------- + 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/mk/main.mk b/mk/main.mk -index 963c12f..04b3e25 100644 +index c47020c..fcf1409 100644 --- a/mk/main.mk +++ b/mk/main.mk -@@ -383,32 +383,26 @@ define SREQ +@@ -403,32 +403,26 @@ define SREQ HROOT$(1)_H_$(3) = $(3)/stage$(1) HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin @@ -59,15 +60,7 @@ index 963c12f..04b3e25 100644 # Preqrequisites for using the stageN compiler ifeq ($(1),0) HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) -@@ -520,6 +514,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) := \ -@@ -528,6 +523,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \ +@@ -536,6 +530,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)) \ @@ -76,5 +69,5 @@ index 963c12f..04b3e25 100644 endef -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/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 index 8985bd1..20f2084 100644 --- a/recipes-devtools/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 @@ -1,7 +1,7 @@ -From 004ddead436887fe99bfa9d0d25f6cdaf9f6148b Mon Sep 17 00:00:00 2001 +From 06b8c4bc8f7056d604d8ef4d699273cc1dd39025 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 +Subject: [PATCH 04/11] mk: add missing CFG_LIBDIR_RELATIVE --- mk/grammar.mk | 4 ++-- @@ -23,5 +23,5 @@ index 0d527bd..926f247 100644 ifeq ($(CFG_OSTYPE),apple-darwin) FLEX_LDFLAGS=-ll -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/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 index 19aa938..6553285 100644 --- a/recipes-devtools/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 @@ -1,7 +1,7 @@ -From 93ef6b8b93c7695280aba7f3541bf8f1ae18c722 Mon Sep 17 00:00:00 2001 +From 0365e3349e373b95fcf4260ba5bcf70ada6328cf 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 +Subject: [PATCH 05/11] configure: support --bindir, and extend libdir to non-blessed dirs Adds --bindir, and: @@ -13,55 +13,61 @@ relative to sysroot, and allows libdir to end in an arbitrary directory Note that this assumes absolute paths start with '/', which may break windows platforms --- - configure | 44 ++++++++++++++++++++----- + configure | 51 ++++++++++++++++++++++++----- mk/host.mk | 6 +++- mk/main.mk | 11 +++++++ - mk/perf.mk | 4 +-- mk/prepare.mk | 27 +++++++--------- src/librustc/session/filesearch.rs | 66 ++++++++++++++++---------------------- src/librustc_trans/back/link.rs | 3 +- - 7 files changed, 94 insertions(+), 67 deletions(-) + 6 files changed, 99 insertions(+), 65 deletions(-) diff --git a/configure b/configure -index 287b7b3..7d53a66 100755 +index d417896..e3b7c20 100755 --- a/configure +++ b/configure -@@ -334,6 +334,32 @@ enable_if_not_disabled() { +@@ -342,6 +342,39 @@ enable_if_not_disabled() { fi } +abspath () { -+ case "$1" in -+ /*) echo "$1" ;; -+ *) echo "$PWD/$1" ;; -+ esac ++ case "$1" in ++ /*) echo "$1" ;; ++ *) echo "$PWD/$1" ;; ++ esac +} + +relpath () { -+ local src=$(abspath "$1") -+ local dst=$(abspath "$2") -+ local common=$src -+ local result= ++ 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 ++ # 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" ++ local down="${dst#"$common"}" ++ result="${result}${down#/}" ++ echo "$result" +} + ++to_llvm_triple() { ++ case $1 in ++ i686-w64-mingw32) echo i686-pc-windows-gnu ;; ++ x86_64-w64-mingw32) echo x86_64-pc-windows-gnu ;; ++ *) echo $1 ;; ++ esac ++} + - to_llvm_triple() { + to_gnu_triple() { case $1 in - i686-w64-mingw32) echo i686-pc-windows-gnu ;; -@@ -652,18 +678,19 @@ 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) + i686-pc-windows-gnu) echo i686-w64-mingw32 ;; +@@ -656,18 +689,19 @@ 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" +CFG_LIBDIR_RELATIVE=lib + @@ -87,7 +93,7 @@ index 287b7b3..7d53a66 100755 if [ $HELP -eq 1 ] then -@@ -1760,6 +1787,7 @@ putvar CFG_PREFIX +@@ -1762,6 +1796,7 @@ putvar CFG_PREFIX putvar CFG_HOST putvar CFG_TARGET putvar CFG_LIBDIR_RELATIVE @@ -96,7 +102,7 @@ index 287b7b3..7d53a66 100755 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 +index d17479b..a95f886 100644 --- a/mk/host.mk +++ b/mk/host.mk @@ -59,9 +59,13 @@ endef @@ -115,10 +121,10 @@ index 59a0095..b8e8345 100644 endef diff --git a/mk/main.mk b/mk/main.mk -index 04b3e25..ba11e5e 100644 +index fcf1409..1c663ee 100644 --- a/mk/main.mk +++ b/mk/main.mk -@@ -351,7 +351,9 @@ export CFG_RELEASE_CHANNEL +@@ -368,7 +368,9 @@ export CFG_RELEASE_CHANNEL export CFG_LLVM_ROOT export CFG_PREFIX export CFG_LIBDIR @@ -128,7 +134,7 @@ index 04b3e25..ba11e5e 100644 export CFG_DISABLE_INJECT_STD_VERSION ifdef CFG_DISABLE_UNSTABLE_FEATURES CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) -@@ -381,7 +383,16 @@ define SREQ +@@ -401,7 +403,16 @@ define SREQ # Destinations of artifacts for the host compiler HROOT$(1)_H_$(3) = $(3)/stage$(1) @@ -145,31 +151,11 @@ index 04b3e25..ba11e5e 100644 HLIB_RELATIVE$(1)_H_$(3) = $$(CFG_LIBDIR_RELATIVE) -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 87a4450..c358bbc 100644 +index 20e20e9..efaec75 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk -@@ -90,8 +90,6 @@ PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS +@@ -90,8 +90,6 @@ PREPARE_TOOLS = $(filter-out compiletest rustbook error_index_generator, $(TOOLS # $(3) is host # $(4) tag define DEF_PREPARE_HOST_TOOL @@ -189,7 +175,7 @@ index 87a4450..c358bbc 100644 +prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR) +prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR) prepare-host-lib-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ - $$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ + $$(foreach dep,$$(RUST_DEPS_$(1)_T_$(3)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ $$(HLIB$(2)_H_$(3))/stamp.$(1) \ @@ -138,14 +134,10 @@ endef # $(4) tag @@ -208,7 +194,7 @@ index 87a4450..c358bbc 100644 +prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(3)/bin +prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \ - $$(foreach crate,$$(TARGET_CRATES), \ + $$(foreach crate,$$(TARGET_CRATES_$(2)), \ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \ @@ -198,9 +190,12 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ @@ -226,10 +212,10 @@ index 87a4450..c358bbc 100644 prepare-base-$(1)-target: prepare-target-$(1) diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs -index 09c6b54..00736c6 100644 +index a3eea32..e5e449d 100644 --- a/src/librustc/session/filesearch.rs +++ b/src/librustc/session/filesearch.rs -@@ -124,7 +124,7 @@ impl<'a> FileSearch<'a> { +@@ -123,7 +123,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); @@ -238,7 +224,7 @@ index 09c6b54..00736c6 100644 p.push(&rustlibdir()); p.push(&self.triple); p.push("bin"); -@@ -132,8 +132,8 @@ impl<'a> FileSearch<'a> { +@@ -131,8 +131,8 @@ impl<'a> FileSearch<'a> { } } @@ -249,7 +235,7 @@ index 09c6b54..00736c6 100644 assert!(p.is_relative()); p.push(&rustlibdir()); p.push(target_triple); -@@ -143,7 +143,19 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf +@@ -142,7 +142,19 @@ pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { @@ -270,7 +256,7 @@ index 09c6b54..00736c6 100644 } pub fn get_or_default_sysroot() -> PathBuf { -@@ -161,44 +173,22 @@ pub fn get_or_default_sysroot() -> PathBuf { +@@ -160,44 +172,22 @@ pub fn get_or_default_sysroot() -> PathBuf { } match canonicalize(env::current_exe().ok()) { @@ -287,7 +273,7 @@ index 09c6b54..00736c6 100644 + } + p + } - None => panic!("can't determine value for sysroot") + None => bug!("can't determine value for sysroot") } } @@ -328,10 +314,10 @@ index 09c6b54..00736c6 100644 // The name of rustc's own place to organize libraries. // Used to be "rustc", now the default is "rustlib" diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs -index ec1383f..670d637 100644 +index 53cc031..222d447 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs -@@ -1042,11 +1042,10 @@ fn link_args(cmd: &mut Linker, +@@ -819,11 +819,10 @@ fn link_args(cmd: &mut Linker, // where extern libraries might live, based on the // addl_lib_search_paths if sess.opts.cg.rpath { @@ -345,5 +331,5 @@ index ec1383f..670d637 100644 path.push(&tlib); -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/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 index bb8a16c..162404f 100644 --- a/recipes-devtools/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 @@ -1,17 +1,17 @@ -From 8b088363a61a627fd8a31318d15164113f081660 Mon Sep 17 00:00:00 2001 +From f7441b3080088d8131d106c59c3543b22c9e8211 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 +Subject: [PATCH 06/11] 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 ca0f103..5851127 100644 +index 6b54ec8..5b41b75 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs -@@ -324,7 +324,7 @@ pub mod elf { +@@ -346,7 +346,7 @@ pub mod elf { #[linkage = "extern_weak"] static __cxa_thread_atexit_impl: *const libc::c_void; } @@ -21,5 +21,5 @@ index ca0f103..5851127 100644 arg: *mut u8, dso_handle: *mut u8) -> libc::c_int; -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/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 index 24135ec..a07d455 100644 --- a/recipes-devtools/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 @@ -1,7 +1,7 @@ -From 1a9ada8070bb9cd293cfb93913721c68ca0b7766 Mon Sep 17 00:00:00 2001 +From a73a748cd73920380ae1f069be91ff833e99d003 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 +Subject: [PATCH 07/11] mk/install: use disable-rewrite-paths This stops the install scripts from doing work we've already handled. @@ -11,7 +11,7 @@ Path rewriting is only useful for prepackaged binary installers. 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mk/install.mk b/mk/install.mk -index af6f3ff..430add7 100644 +index d2e5449..e67650b 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -12,7 +12,9 @@ RUN_INSTALLER = cd tmp/empty_dir && \ @@ -26,5 +26,5 @@ index af6f3ff..430add7 100644 install: ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER))) -- -2.4.10 +2.7.4 diff --git a/recipes-devtools/rust/files/rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch b/recipes-devtools/rust/files/rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch new file mode 100644 index 0000000..858b440 --- /dev/null +++ b/recipes-devtools/rust/files/rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch @@ -0,0 +1,60 @@ +From 042a5df36597c2c6c23900667ae1b4299279092f Mon Sep 17 00:00:00 2001 +From: Steven Walter +Date: Wed, 18 Nov 2015 08:33:26 -0500 +Subject: [PATCH 08/11] 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 | 12 +++++++++++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs +index 6cd0ea9..f90398d 100644 +--- a/src/librustc/session/config.rs ++++ b/src/librustc/session/config.rs +@@ -585,6 +585,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 222d447..e951476 100644 +--- a/src/librustc_trans/back/link.rs ++++ b/src/librustc_trans/back/link.rs +@@ -125,12 +125,22 @@ pub fn find_crate_name(sess: Option<&Session>, + + } + ++use std::hash::{Hasher, SipHasher}; ++use rustc::hir::svh::Svh; ++ + pub fn build_link_meta<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, + name: &str) + -> LinkMeta { ++ let crate_hash = if tcx.sess.opts.cg.crate_hash != "" { ++ let mut state = SipHasher::new(); ++ state.write(tcx.sess.opts.cg.crate_hash.as_bytes()); ++ Svh::new(state.finish()) ++ } else { ++ tcx.calculate_krate_hash() ++ }; + let r = LinkMeta { + crate_name: name.to_owned(), +- crate_hash: tcx.calculate_krate_hash(), ++ crate_hash: crate_hash, + }; + info!("{:?}", r); + return r; +-- +2.7.4 + diff --git a/recipes-devtools/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 deleted file mode 100644 index ff7db6b..0000000 --- a/recipes-devtools/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 8e359ae2b44fe2edd863e460346554c73f460ba7 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 670d637..4e7150e 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -213,11 +213,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(&tcx.sess.cstore.encode_type(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-devtools/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch b/recipes-devtools/rust/files/rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch similarity index 69% rename from recipes-devtools/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch rename to recipes-devtools/rust/files/rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch index 7e86b07..10832d0 100644 --- a/recipes-devtools/rust/files/rust/0012-mk-platform.mk-pass-C-crate_hash-to-builds.patch +++ b/recipes-devtools/rust/files/rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch @@ -1,7 +1,7 @@ -From 7abedc46cad6b52d44badaf88350d41ef907cd4c Mon Sep 17 00:00:00 2001 +From 44ee7a68f44132ebe32ac486355945131c7a2b83 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 +Subject: [PATCH 09/11] mk/platform.mk: pass -C crate_hash to builds bitbake recipe will export FORCE_CRATE_HASH --- @@ -9,17 +9,17 @@ bitbake recipe will export FORCE_CRATE_HASH 1 file changed, 1 insertion(+) diff --git a/mk/platform.mk b/mk/platform.mk -index eb693b8..e6317b5 100644 +index c264462..b959d59 100644 --- a/mk/platform.mk +++ b/mk/platform.mk -@@ -187,6 +187,7 @@ define CFG_MAKE_TOOLCHAIN +@@ -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 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 +2.7.4 diff --git a/recipes-devtools/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch b/recipes-devtools/rust/files/rust/0010-mk-allow-changing-the-platform-configuration-source-.patch similarity index 72% rename from recipes-devtools/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch rename to recipes-devtools/rust/files/rust/0010-mk-allow-changing-the-platform-configuration-source-.patch index 33b127c..e6f8f3c 100644 --- a/recipes-devtools/rust/files/rust/0013-mk-allow-changing-the-platform-configuration-source-.patch +++ b/recipes-devtools/rust/files/rust/0010-mk-allow-changing-the-platform-configuration-source-.patch @@ -1,7 +1,7 @@ -From f3e8bd9ab353d4b3d7432a02e37a22eed24b5e57 Mon Sep 17 00:00:00 2001 +From 8efc27cfdbebcfb0e544ce1b7ee242955af0f68a 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 +Subject: [PATCH 10/11] mk: allow changing the platform configuration source directory --- @@ -10,18 +10,18 @@ Subject: [PATCH] mk: allow changing the platform configuration source 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure -index 7d53a66..5d40516 100755 +index 7747850..f5224ca 100755 --- a/configure +++ b/configure -@@ -671,6 +671,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary" +@@ -663,6 +663,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) -@@ -1127,7 +1128,7 @@ CFG_MANDIR=${CFG_MANDIR%/} + CFG_LIBDIR_RELATIVE=lib + +@@ -1084,7 +1085,7 @@ CFG_MANDIR=${CFG_MANDIR%/} CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')" CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')" CFG_SUPPORTED_TARGET="" @@ -30,7 +30,7 @@ index 7d53a66..5d40516 100755 CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)" done -@@ -1795,6 +1796,7 @@ putvar CFG_I686_LINUX_ANDROID_NDK +@@ -1780,6 +1781,7 @@ putvar CFG_I686_LINUX_ANDROID_NDK putvar CFG_NACL_CROSS_PATH putvar CFG_MANDIR putvar CFG_USING_LIBCPP @@ -39,10 +39,10 @@ index 7d53a66..5d40516 100755 # 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 e6317b5..68a20e1 100644 +index b959d59..bddd203 100644 --- a/mk/platform.mk +++ b/mk/platform.mk -@@ -114,7 +114,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \ +@@ -97,7 +97,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \ CFG_RLIB_GLOB=lib$(1)-*.rlib @@ -52,5 +52,5 @@ index e6317b5..68a20e1 100644 define ADD_INSTALLED_OBJECTS INSTALLED_OBJECTS_$(1) += $$(CFG_INSTALLED_OBJECTS_$(1)) -- -2.7.0 +2.7.4 diff --git a/recipes-devtools/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 deleted file mode 100644 index e45d899..0000000 --- a/recipes-devtools/rust/files/rust/0010-rustc_trans-make-.note.rustc-look-more-like-debug-in.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 04eee951641b9d9c580ee21c481bdf979dc2fe30 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 | 36 ++++++++++++++++++++++++++++++++++++ - src/librustc_trans/trans/base.rs | 3 +++ - 5 files changed, 46 insertions(+) - -diff --git a/mk/platform.mk b/mk/platform.mk -index 5239086..eb693b8 100644 ---- a/mk/platform.mk -+++ b/mk/platform.mk -@@ -186,6 +186,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 4cc059b..600cb4b 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -497,6 +497,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 636a1aa..1b87a7a 100644 ---- a/src/librustc_back/target/mod.rs -+++ b/src/librustc_back/target/mod.rs -@@ -118,6 +118,8 @@ pub struct TargetOptions { - /// Linker arguments that are unconditionally passed *after* any - /// user-defined libraries. - pub post_link_args: Vec, -+ /// Path to objcopy. Defaults to "objcopy". -+ pub objcopy: String, - - /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults - /// to "default". -@@ -213,6 +215,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, -@@ -331,6 +334,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 4e7150e..0d8a125 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -394,6 +394,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(..) => {} -@@ -928,6 +935,32 @@ 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())); -+ } -+ }, -+ Err(exitstatus) => { -+ sess.err(&format!("objcopy failed: {}", exitstatus)); -+ } -+ } -+ sess.abort_if_errors(); -+} -+ - fn link_args(cmd: &mut Linker, - sess: &Session, - dylib: bool, -@@ -960,6 +993,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 4c619f8..2b68767 100644 ---- a/src/librustc_trans/trans/base.rs -+++ b/src/librustc_trans/trans/base.rs -@@ -2924,6 +2924,9 @@ pub fn write_metadata<'a, 'tcx>(cx: &SharedCrateContext<'a, 'tcx>, - }; - unsafe { - llvm::LLVMSetInitializer(llglobal, llconst); -+ llvm::LLVMSetGlobalConstant(llglobal, llvm::True); -+ llvm::LLVMSetUnnamedAddr(llglobal, llvm::True); -+ llvm::SetLinkage(llglobal, llvm::Linkage::PrivateLinkage); - let name = - cx.tcx().sess.cstore.metadata_section_name(&cx.sess().target.target); - let name = CString::new(name).unwrap(); --- -1.9.1 - diff --git a/recipes-devtools/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 deleted file mode 100644 index 2229bdc..0000000 --- a/recipes-devtools/rust/files/rust/0011-Allow-overriding-crate_hash-with-C-crate_hash.patch +++ /dev/null @@ -1,80 +0,0 @@ -From b6805ab1099ca824bb516da4f1825a7e4ce30153 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 | 28 ++++++++++++++++++++++++++-- - 2 files changed, 28 insertions(+), 2 deletions(-) - -diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs -index 600cb4b..3570e78 100644 ---- a/src/librustc/session/config.rs -+++ b/src/librustc/session/config.rs -@@ -537,6 +537,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 0d8a125..9917a1e 100644 ---- a/src/librustc_trans/back/link.rs -+++ b/src/librustc_trans/back/link.rs -@@ -45,7 +45,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; - -@@ -186,9 +186,33 @@ pub fn build_link_meta(sess: &Session, - krate: &hir::Crate, - name: &str) - -> LinkMeta { -+ use std::collections::BTreeMap; -+ 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, -+ item_ids: hir::HirVec::new() -+ }; -+ let dummy_krate = hir::Crate { -+ module: dummy_module, -+ attrs: hir::HirVec::new(), -+ config: hir::CrateConfig::new(), -+ span: dummy_span, -+ exported_macros: hir::HirVec::new(), -+ items: BTreeMap::new() -+ }; -+ -+ 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-devtools/rust/files/rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch b/recipes-devtools/rust/files/rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch new file mode 100644 index 0000000..be4fe58 --- /dev/null +++ b/recipes-devtools/rust/files/rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch @@ -0,0 +1,96 @@ +From 9c76c93de35fb45ed18e75827649e299d8c4e94e Mon Sep 17 00:00:00 2001 +From: Eduard Burtescu +Date: Sun, 14 Aug 2016 11:16:28 +0300 +Subject: [PATCH 11/11] Get rid of the .note interpretation of rustc dylib + metadata. + +--- + src/librustc_metadata/loader.rs | 41 ++++++++++++++++++----------------------- + src/librustc_trans/base.rs | 13 ++++++++++--- + 2 files changed, 28 insertions(+), 26 deletions(-) + +diff --git a/src/librustc_metadata/loader.rs b/src/librustc_metadata/loader.rs +index dc10391..9430b70 100644 +--- a/src/librustc_metadata/loader.rs ++++ b/src/librustc_metadata/loader.rs +@@ -875,34 +875,29 @@ fn get_metadata_section_imp(target: &Target, flavor: CrateFlavor, filename: &Pat + } + + pub fn meta_section_name(target: &Target) -> &'static str { ++ // Historical note: ++ // ++ // When using link.exe it was seen that the section name `.note.rustc` ++ // was getting shortened to `.note.ru`, and according to the PE and COFF ++ // specification: ++ // ++ // > Executable images do not use a string table and do not support ++ // > section names longer than 8 characters ++ // ++ // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx ++ // ++ // As a result, we choose a slightly shorter name! As to why ++ // `.note.rustc` works on MinGW, that's another good question... ++ + if target.options.is_like_osx { +- "__DATA,__note.rustc" +- } else if target.options.is_like_msvc { +- // When using link.exe it was seen that the section name `.note.rustc` +- // was getting shortened to `.note.ru`, and according to the PE and COFF +- // specification: +- // +- // > Executable images do not use a string table and do not support +- // > section names longer than 8 characters +- // +- // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx +- // +- // As a result, we choose a slightly shorter name! As to why +- // `.note.rustc` works on MinGW, that's another good question... +- ".rustc" ++ "__DATA,.rustc" + } else { +- ".note.rustc" ++ ".rustc" + } + } + +-pub fn read_meta_section_name(target: &Target) -> &'static str { +- if target.options.is_like_osx { +- "__note.rustc" +- } else if target.options.is_like_msvc { +- ".rustc" +- } else { +- ".note.rustc" +- } ++pub fn read_meta_section_name(_target: &Target) -> &'static str { ++ ".rustc" + } + + // A diagnostic function for dumping crate metadata to an output stream +diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs +index d4f0786..93c9d1a 100644 +--- a/src/librustc_trans/base.rs ++++ b/src/librustc_trans/base.rs +@@ -2523,10 +2523,17 @@ pub fn write_metadata<'a, 'tcx>(cx: &SharedCrateContext<'a, 'tcx>, + }; + unsafe { + llvm::LLVMSetInitializer(llglobal, llconst); +- let name = ++ let section_name = + cx.tcx().sess.cstore.metadata_section_name(&cx.sess().target.target); +- let name = CString::new(name).unwrap(); +- llvm::LLVMSetSection(llglobal, name.as_ptr()) ++ let name = CString::new(section_name).unwrap(); ++ llvm::LLVMSetSection(llglobal, name.as_ptr()); ++ ++ // Also generate a .section directive to force no ++ // flags, at least for ELF outputs, so that the ++ // metadata doesn't get loaded into memory. ++ let directive = format!(".section {}", section_name); ++ let directive = CString::new(directive).unwrap(); ++ llvm::LLVMSetModuleInlineAsm(cx.metadata_llmod(), directive.as_ptr()) + } + return metadata; + } +-- +2.7.4 + diff --git a/recipes-devtools/rust/files/rust/fix-urandom-during-init.patch b/recipes-devtools/rust/files/rust/fix-urandom-during-init.patch deleted file mode 100644 index 07cc2ac..0000000 --- a/recipes-devtools/rust/files/rust/fix-urandom-during-init.patch +++ /dev/null @@ -1,42 +0,0 @@ -rust: don't block before random pool is initialized - -Upstream-Status: Backport [See https://github.com/rust-lang/rust/pull/33086] - -Signed-off-by: Derek Straka ---- ./src/libstd/rand/os.rs.orig 2016-08-18 13:14:25.908309986 -0400 -+++ ./src/libstd/rand/os.rs 2016-08-18 13:14:11.316560875 -0400 -@@ -46,8 +46,10 @@ - #[cfg(target_arch = "aarch64")] - const NR_GETRANDOM: libc::c_long = 278; - -+ const GRND_NONBLOCK: libc::c_uint = 0x0001; -+ - unsafe { -- libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0) -+ libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), GRND_NONBLOCK) - } - } - -@@ -69,7 +71,20 @@ - let err = errno() as libc::c_int; - if err == libc::EINTR { - continue; -- } else { -+ } else if err == libc::EAGAIN { -+ // if getrandom() returns EAGAIN it would have blocked -+ // because the non-blocking pool (urandom) has not -+ // initialized in the kernel yet due to a lack of entropy -+ // the fallback we do here is to avoid blocking applications -+ // which could depend on this call without ever knowing -+ // they do and don't have a work around. The PRNG of -+ // /dev/urandom will still be used but not over a completely -+ // full entropy pool -+ let reader = File::open("/dev/urandom").expect("Unable to open /dev/urandom"); -+ let mut reader_rng = ReaderRng::new(reader); -+ reader_rng.fill_bytes(& mut v[read..]); -+ read += v.len() as usize; -+ } else { - panic!("unexpected getrandom error: {}", err); - } - } else { - diff --git a/recipes-devtools/rust/rust-snapshot-2015-12-18.inc b/recipes-devtools/rust/rust-snapshot-2015-12-18.inc deleted file mode 100644 index a970791..0000000 --- a/recipes-devtools/rust/rust-snapshot-2015-12-18.inc +++ /dev/null @@ -1,14 +0,0 @@ -## 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-12-18" -RS_SRCHASH = "3391630" -# linux-x86_64 -RS_ARCH = "linux-x86_64" -RS_HASH = "97e2a5eb8904962df8596e95d6e5d9b574d73bf4" - -RUST_SNAPSHOT = "rust-stage0-${RS_DATE}-${RS_SRCHASH}-${RS_ARCH}-${RS_HASH}.tar.bz2" - -SRC_URI[rust-snapshot.md5sum] = "5c29eb06c8b6ce6ff52f544f31efabe1" -SRC_URI[rust-snapshot.sha256sum] = "a8dc5203673ce43f47316beb02ee0c427edb7bbde2ab5fc662a06b52db2950e7" - diff --git a/recipes-devtools/rust/rust-snapshot-2016-05-24.inc b/recipes-devtools/rust/rust-snapshot-2016-05-24.inc new file mode 100644 index 0000000..765daeb --- /dev/null +++ b/recipes-devtools/rust/rust-snapshot-2016-05-24.inc @@ -0,0 +1,13 @@ +## snapshot info taken from rust/src/stage0.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_DATE = "2016-05-24" +RS_VERSION = "1.9.0" +RS_ARCH = "x86_64-unknown-linux-gnu" + +RUST_SNAPSHOT = "rustc-${RS_VERSION}-${RS_ARCH}.tar.gz" +RUST_SNAPSHOT_URI = "https://static.rust-lang.org/dist/${RS_DATE}/${RUST_SNAPSHOT}" + +SRC_URI[rust-snapshot.md5sum] = "f1cf6d2fe15e4be18a08259f1540a4ae" +SRC_URI[rust-snapshot.sha256sum] = "d0704d10237c66c3efafa6f7e5570c59a1d3fe5c6d99487540f90ebb37cd84c4" + diff --git a/recipes-devtools/rust/rust-source.bb b/recipes-devtools/rust/rust-source.bb index 1245601..ebf5eb4 100644 --- a/recipes-devtools/rust/rust-source.bb +++ b/recipes-devtools/rust/rust-source.bb @@ -8,24 +8,22 @@ inherit shared-source-provide require rust-version.inc require rust-release.inc -SRC_URI[rust.md5sum] = "15f1c204580017838301c5c8568e8f3f" -SRC_URI[rust.sha256sum] = "6df96059d87b718676d9cd879672e4e22418b6093396b4ccb5b5b66df37bf13a" +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" SRC_URI_append = "\ + file://rust/0001-Add-config-for-musl-based-arm-builds.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/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-llvm/0000-rust-llvm-remove-extra-slash.patch \ + file://rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch \ + file://rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ + file://rust/0010-mk-allow-changing-the-platform-configuration-source-.patch \ + file://rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch \ + file://rust-llvm/0001-Don-t-build-unittests.patch;patchdir=src/llvm \ file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ - file://rust/0001-Add-config-for-musl-based-arm-builds.patch \ - file://rust/fix-urandom-during-init.patch \ " diff --git a/recipes-devtools/rust/rust-version.inc b/recipes-devtools/rust/rust-version.inc index aa9a1df..53ea335 100644 --- a/recipes-devtools/rust/rust-version.inc +++ b/recipes-devtools/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.7.0" +PV = "1.10.0" LICENSE = "MIT | Apache-2.0" diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index ddbc7ec..3c7d7fa 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -2,9 +2,9 @@ inherit rust inherit rust-installer require rust-shared-source.inc -require rust-snapshot-2015-12-18.inc +require rust-snapshot-2016-05-24.inc -LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=9c5a05eab0ffc3590e50db38c51d1425" +LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8" SUMMARY = "Rust compiler and runtime libaries" HOMEPAGE = "http://www.rust-lang.org" @@ -25,7 +25,9 @@ PACKAGECONFIG ??= "" # 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)}" +FETCH_STAGE0 = "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}" + +SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '', '${RUST_SNAPSHOT_URI};unpack=0;name=rust-snapshot', d)}" # We generate local targets, and need to be able to locate them export RUST_TARGET_PATH="${WORKDIR}/targets/" @@ -126,31 +128,35 @@ def llvm_features_from_cc_arch(d): 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}" TARGET_ENDIAN[arm] = "little" TARGET_POINTER_WIDTH[arm] = "32" FEATURES[arm] = "+v6,+vfp2" PRE_LINK_ARGS[arm] = "-Wl,--as-needed" -## aarch64-unknown-linux-gnu +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" @@ -255,6 +261,7 @@ def rust_gen_target(d, thing, wd): # build tspec tspec = {} tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch, True) + tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch, True) tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True) tspec['target-word-size'] = tspec['target-pointer-width'] tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch, True) @@ -389,15 +396,16 @@ do_configure () { # 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 + if ${FETCH_STAGE0}; then + mkdir -p dl + tar -xf ${WORKDIR}/${RUST_SNAPSHOT} -C dl + ./dl/rustc-${RS_VERSION}-${RS_ARCH}/install.sh --prefix=$PWD/dl + local_rust_root="$PWD/dl" + elif 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 @@ -426,7 +434,7 @@ do_configure () { "--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)} \ + "--enable-local-rust --local-rust-root=$local_rust_root" \ ${EXTRA_OECONF} } @@ -446,10 +454,6 @@ rust_runmake () { } 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 }