Merge remote-tracking branch 'upstream/master' into merge-upstream
Conflicts: conf/distro/include/rust_security_flags.inc conf/layer.conf recipes-devtools/cargo/cargo_git.bb recipes-devtools/cargo/files/0001-update-Rust.patch recipes-devtools/cargo/files/0001-update-pkg-versions.patch recipes-devtools/cargo/files/curl-rust/0001-curl-sys-avoid-explicitly-linking-in-openssl.-If-it-.patch recipes-devtools/cargo/files/curl-rust/0002-remove-per-triple-deps-on-openssl-sys.patch recipes-devtools/cargo/files/git2-rs/0001-Add-generic-openssl-sys-dep.patch recipes-devtools/cargo/files/git2-rs/0002-libgit2-sys-avoid-the-build-script-it-is-a-disaster.patch recipes-devtools/cargo/files/git2-rs/0003-bump-libssh2-to-fix-build-with-nightly.patch recipes-devtools/cargo/files/ssh2-rs/0001-Unconditionally-depend-on-openssl-sys.patch recipes-devtools/rust/files/rust-1.3.0/0001-platform.mk-avoid-choking-on-i586.patch recipes-devtools/rust/files/rust-1.3.0/0002-Target-add-default-target.json-path-libdir-rust-targ.patch recipes-devtools/rust/files/rust-1.3.0/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch recipes-devtools/rust/files/rust-1.3.0/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch recipes-devtools/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch recipes-devtools/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch recipes-devtools/rust/files/rust-1.3.0/0007-mk-install-use-disable-rewrite-paths.patch recipes-devtools/rust/files/rust-1.3.0/0008-install-disable-ldconfig.patch recipes-devtools/rust/files/rust-1.3.0/0009-Remove-crate-metadata-from-symbol-hashing.patch recipes-devtools/rust/files/rust-1.3.0/0010-mk-tell-rustc-that-we-re-only-looking-for-native-lib.patch recipes-devtools/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch recipes-devtools/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch recipes-devtools/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch recipes-devtools/rust/files/rust-git/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch recipes-devtools/rust/files/rust-git/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch recipes-devtools/rust/files/rust-git/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch recipes-devtools/rust/files/rust-git/0007-mk-install-use-disable-rewrite-paths.patch recipes-devtools/rust/files/rust-git/0008-install-disable-ldconfig.patch recipes-devtools/rust/files/rust/0001-platform.mk-avoid-choking-on-i586.patch recipes-devtools/rust/files/rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch recipes-devtools/rust/files/rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch recipes-devtools/rust/files/rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch recipes-devtools/rust/files/rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch recipes-devtools/rust/files/rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch recipes-devtools/rust/files/rust/0009-Remove-crate-metadata-from-symbol-hashing.patch recipes-devtools/rust/rust-1.3.0.inc recipes-devtools/rust/rust-git.inc recipes-devtools/rust/rust-llvm_1.3.0.bb recipes-devtools/rust/rust.inc recipes-devtools/rust/rust_1.3.0.bb recipes-devtools/rust/rust_git.bb recipes/rust/files/rust-1.3.0/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch recipes/rust/files/rust-1.3.0/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch recipes/rust/files/rust-git/0001-platform.mk-avoid-choking-on-i586.patch recipes/rust/files/rust-git/0002-Target-add-default-target.json-path-libdir-rust-targ.patch recipes/rust/files/rust-git/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
From 6d0905573f38d0fbdde74848c0cd7cdbb603c238 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 15 Nov 2014 20:12:48 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
From e9d46f8cb10eec1f8ee19ed2aab385d17ec85757 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 01:40:21 -0500
|
||||
Subject: [PATCH 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<PathBuf>,
|
||||
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<Target, String> {
|
||||
+ pub fn search(sysroot: &Path, target: &str) -> Result<Target, String> {
|
||||
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<Target, String> {
|
||||
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
|
||||
|
||||
-68
@@ -1,68 +0,0 @@
|
||||
From e468926e5e331dc6a68be5d0731a331940bd0199 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 14:52:56 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 977954fbe5a3c9d0b89652f852b174aa9ac0e0a4 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 13:48:14 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
From 564742fb9c94f9b8e7f6ad4ec34fd2254c337a09 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 2 Mar 2015 13:34:59 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
From 24fc19c57309b0c23c34f22b87796bb8aee4efa7 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
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
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
From 053afad02e46b0cb62569018f07f7430ebf9afc5 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
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
|
||||
|
||||
-362
@@ -1,362 +0,0 @@
|
||||
From 64dcf50a8a0f3aaf37ec6e4fe6143d0832592c05 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 24 Nov 2014 13:10:15 -0500
|
||||
Subject: [PATCH 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<PathBuf> {
|
||||
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<PathBuf>) -> Option<PathBuf> {
|
||||
@@ -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<PathBuf> {
|
||||
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
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
From fb56f1fa6d0bdc62f7fd0c480446255698dc1635 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Wed, 3 Dec 2014 19:15:19 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
From de01acf6395a4c7f7d5c9d7ba251d9f2af570127 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 2 Mar 2015 13:34:59 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
From 8b87c3e5a7181f828dee1c8c0598b1bafa9dd4cc Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
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
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
+++ 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"
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
From 237f665afaf7ec35f067ede4c09a013e86ad12c4 Mon Sep 17 00:00:00 2001
|
||||
From af2eaed835d3b717552ea83e75f4c5e86e614979 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Sat, 15 Nov 2014 20:12:48 -0500
|
||||
Subject: [PATCH 1/8] platform.mk: avoid choking on i586
|
||||
Subject: [PATCH 1/9] platform.mk: avoid choking on i586
|
||||
|
||||
---
|
||||
mk/platform.mk | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mk/platform.mk b/mk/platform.mk
|
||||
index 8a5e58c..e2c3d8f 100644
|
||||
index 856a22d..0c90632 100644
|
||||
--- a/mk/platform.mk
|
||||
+++ b/mk/platform.mk
|
||||
@@ -14,7 +14,9 @@
|
||||
@@ -23,5 +23,5 @@ index 8a5e58c..e2c3d8f 100644
|
||||
$(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
|
||||
2.4.10
|
||||
|
||||
+11
-11
@@ -1,7 +1,7 @@
|
||||
From 221ff5acf7b3b176882908d2f7010784614005e8 Mon Sep 17 00:00:00 2001
|
||||
From 632d71477fdecb18852812d86b8e2ee1e33c521b Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 01:40:21 -0500
|
||||
Subject: [PATCH 2/8] Target: add default target.json path:
|
||||
Subject: [PATCH 2/9] Target: add default target.json path:
|
||||
$libdir/rust/targets
|
||||
|
||||
---
|
||||
@@ -11,10 +11,10 @@ Subject: [PATCH 2/8] Target: add default target.json path:
|
||||
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
|
||||
index 7e8104d..ecb38d4 100644
|
||||
--- a/src/librustc/session/config.rs
|
||||
+++ b/src/librustc/session/config.rs
|
||||
@@ -38,7 +38,7 @@ use getopts;
|
||||
@@ -36,7 +36,7 @@ use getopts;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fmt;
|
||||
@@ -23,7 +23,7 @@ index c6ce3a2..51152c7 100644
|
||||
|
||||
use llvm;
|
||||
|
||||
@@ -651,8 +651,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
|
||||
@@ -653,8 +653,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
|
||||
v
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ index c6ce3a2..51152c7 100644
|
||||
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
|
||||
index 0a1df25..ad223d5 100644
|
||||
--- a/src/librustc/session/mod.rs
|
||||
+++ b/src/librustc/session/mod.rs
|
||||
@@ -381,14 +381,18 @@ pub fn build_session_(sopts: config::Options,
|
||||
@@ -412,14 +412,18 @@ pub fn build_session_(sopts: config::Options,
|
||||
local_crate_source_file: Option<PathBuf>,
|
||||
span_diagnostic: diagnostic::SpanHandler)
|
||||
-> Session {
|
||||
@@ -60,7 +60,7 @@ index 6b5f587..4432440 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 402fbcd..a211b84 100644
|
||||
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;
|
||||
@@ -72,7 +72,7 @@ index 402fbcd..a211b84 100644
|
||||
|
||||
mod android_base;
|
||||
mod apple_base;
|
||||
@@ -306,12 +308,13 @@ impl Target {
|
||||
@@ -346,12 +348,13 @@ impl Target {
|
||||
///
|
||||
/// The error string could come from any of the APIs called, including
|
||||
/// filesystem access and JSON decoding.
|
||||
@@ -87,7 +87,7 @@ index 402fbcd..a211b84 100644
|
||||
|
||||
fn load_file(path: &Path) -> Result<Target, String> {
|
||||
let mut f = try!(File::open(path).map_err(|e| e.to_string()));
|
||||
@@ -400,9 +403,14 @@ impl Target {
|
||||
@@ -447,9 +450,14 @@ impl Target {
|
||||
let target_path = env::var_os("RUST_TARGET_PATH")
|
||||
.unwrap_or(OsString::new());
|
||||
|
||||
@@ -105,5 +105,5 @@ index 402fbcd..a211b84 100644
|
||||
if p.is_file() {
|
||||
return load_file(&p);
|
||||
--
|
||||
2.4.3
|
||||
2.4.10
|
||||
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
From 057d6be30ff1437a53132175720c96fa93826a08 Mon Sep 17 00:00:00 2001
|
||||
From b544f5bfa38d5932db23214e168988d05cbc5620 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 14:52:56 -0500
|
||||
Subject: [PATCH 3/8] mk: for stage0, use RUSTFLAGS to override target libs dir
|
||||
Subject: [PATCH 3/9] mk: for stage0, use RUSTFLAGS to override target libs dir
|
||||
|
||||
Setting HLIB specially for stage0 (and even more specially for windows)
|
||||
also affects the location we place TLIB. To keep the TLIBs we build in
|
||||
@@ -12,10 +12,10 @@ stage0-rustc at the appropriate location.
|
||||
1 file changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/mk/main.mk b/mk/main.mk
|
||||
index 3926119..165afc3 100644
|
||||
index 34f8247..896c1df 100644
|
||||
--- a/mk/main.mk
|
||||
+++ b/mk/main.mk
|
||||
@@ -370,21 +370,22 @@ define SREQ
|
||||
@@ -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
|
||||
@@ -46,7 +46,7 @@ index 3926119..165afc3 100644
|
||||
# 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) := \
|
||||
@@ -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)) \
|
||||
@@ -54,7 +54,7 @@ index 3926119..165afc3 100644
|
||||
$$(RUSTC_FLAGS_$(2))
|
||||
|
||||
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
|
||||
@@ -504,6 +506,7 @@ 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)) \
|
||||
@@ -63,5 +63,5 @@ index 3926119..165afc3 100644
|
||||
|
||||
endef
|
||||
--
|
||||
2.4.3
|
||||
2.4.10
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
From af95f47a39a91a3e4a58b1df6c48bc4e010520c6 Mon Sep 17 00:00:00 2001
|
||||
From 004ddead436887fe99bfa9d0d25f6cdaf9f6148b Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Tue, 18 Nov 2014 13:48:14 -0500
|
||||
Subject: [PATCH 4/8] mk: add missing CFG_LIBDIR_RELATIVE
|
||||
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
|
||||
index 0d527bd..926f247 100644
|
||||
--- a/mk/grammar.mk
|
||||
+++ b/mk/grammar.mk
|
||||
@@ -11,8 +11,8 @@
|
||||
@@ -23,5 +23,5 @@ index d9c66e2..585206d 100644
|
||||
ifeq ($(CFG_OSTYPE),apple-darwin)
|
||||
FLEX_LDFLAGS=-ll
|
||||
--
|
||||
2.4.3
|
||||
2.4.10
|
||||
|
||||
+23
-23
@@ -1,7 +1,7 @@
|
||||
From 08aecf1062fd85207e9b5c688b84def523eb05a0 Mon Sep 17 00:00:00 2001
|
||||
From 1197d6ec82df147e8bbe0d42017fe1ee75804369 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 24 Nov 2014 13:10:15 -0500
|
||||
Subject: [PATCH 05/10] configure: support --bindir, and extend libdir to
|
||||
Subject: [PATCH 5/9] configure: support --bindir, and extend libdir to
|
||||
non-blessed dirs
|
||||
|
||||
Adds --bindir, and:
|
||||
@@ -23,7 +23,7 @@ windows platforms
|
||||
7 files changed, 90 insertions(+), 71 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 2c8d785..d214382 100755
|
||||
index 60d3661..01c447b 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -334,6 +334,31 @@ enable_if_not_disabled() {
|
||||
@@ -58,7 +58,7 @@ index 2c8d785..d214382 100755
|
||||
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.
|
||||
@@ -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)
|
||||
|
||||
@@ -67,7 +67,7 @@ index 2c8d785..d214382 100755
|
||||
# On windows we just store the libraries in the bin directory because
|
||||
# there's no rpath. This is where the build system itself puts libraries;
|
||||
# --libdir is used to configure the installation directory.
|
||||
@@ -633,24 +660,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
|
||||
@@ -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
|
||||
@@ -101,7 +101,7 @@ index 2c8d785..d214382 100755
|
||||
fi
|
||||
|
||||
if [ $HELP -eq 1 ]
|
||||
@@ -1685,6 +1709,7 @@ putvar CFG_PREFIX
|
||||
@@ -1733,6 +1757,7 @@ putvar CFG_PREFIX
|
||||
putvar CFG_HOST
|
||||
putvar CFG_TARGET
|
||||
putvar CFG_LIBDIR_RELATIVE
|
||||
@@ -129,10 +129,10 @@ index 59a0095..b8e8345 100644
|
||||
|
||||
endef
|
||||
diff --git a/mk/main.mk b/mk/main.mk
|
||||
index d907628..6782bed 100644
|
||||
index 896c1df..ab12166 100644
|
||||
--- a/mk/main.mk
|
||||
+++ b/mk/main.mk
|
||||
@@ -338,7 +338,9 @@ export CFG_RELEASE_CHANNEL
|
||||
@@ -345,7 +345,9 @@ export CFG_RELEASE_CHANNEL
|
||||
export CFG_LLVM_ROOT
|
||||
export CFG_PREFIX
|
||||
export CFG_LIBDIR
|
||||
@@ -142,7 +142,7 @@ index d907628..6782bed 100644
|
||||
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
|
||||
@@ -375,7 +377,16 @@ define SREQ
|
||||
|
||||
# Destinations of artifacts for the host compiler
|
||||
HROOT$(1)_H_$(3) = $(3)/stage$(1)
|
||||
@@ -180,22 +180,22 @@ index 16cbaab..f8a354c 100644
|
||||
endif
|
||||
|
||||
diff --git a/mk/prepare.mk b/mk/prepare.mk
|
||||
index fe619cc..b8aa0cb 100644
|
||||
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
|
||||
prepare-base-$(1): prepare-everything-$(1)
|
||||
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
|
||||
@@ -341,10 +341,10 @@ index 311ab1c..1b03b1a 100644
|
||||
// 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
|
||||
index 6171ff1..32f41ff 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,
|
||||
@@ -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 {
|
||||
@@ -358,5 +358,5 @@ index 5bdc76b..25dd2e6 100644
|
||||
path.push(&tlib);
|
||||
|
||||
--
|
||||
2.5.1
|
||||
2.4.10
|
||||
|
||||
+5
-5
@@ -1,17 +1,17 @@
|
||||
From 1aebe22b98f797765293bafc1f5e8990a742b291 Mon Sep 17 00:00:00 2001
|
||||
From 68662f758244a476b64b0772d93c7a1731e9d1ad Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Wed, 3 Dec 2014 19:15:19 -0500
|
||||
Subject: [PATCH 06/10] std/thread_local: workaround for NULL __dso_handle
|
||||
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 9a6d68a..37a0ea0 100644
|
||||
index c204f79..b2f6f1d 100644
|
||||
--- a/src/libstd/thread/local.rs
|
||||
+++ b/src/libstd/thread/local.rs
|
||||
@@ -337,7 +337,7 @@ mod imp {
|
||||
@@ -338,7 +338,7 @@ mod imp {
|
||||
#[linkage = "extern_weak"]
|
||||
static __cxa_thread_atexit_impl: *const libc::c_void;
|
||||
}
|
||||
@@ -21,5 +21,5 @@ index 9a6d68a..37a0ea0 100644
|
||||
arg: *mut u8,
|
||||
dso_handle: *mut u8) -> libc::c_int;
|
||||
--
|
||||
2.5.1
|
||||
2.4.10
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From be3663fcd9ae11a207b3c1649917bfff3c69b1c4 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
Date: Mon, 2 Mar 2015 13:34:59 -0500
|
||||
Subject: [PATCH 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
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From d7aa5e6824e8658c01f702259eebac02553fb7b8 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
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
|
||||
|
||||
+6
-6
@@ -1,17 +1,17 @@
|
||||
From ffacbea82a7e03fadc05d31313e2bbd3e10388fb Mon Sep 17 00:00:00 2001
|
||||
From e6888f9b888911bdbd52e2ee7c37914ee4cee0e2 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
Date: Tue, 7 Jul 2015 14:57:42 -0400
|
||||
Subject: [PATCH 09/10] Remove crate metadata from symbol hashing
|
||||
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 25dd2e6..d203d07 100644
|
||||
index 32f41ff..2a87cd7 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>,
|
||||
@@ -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("-");
|
||||
@@ -20,9 +20,9 @@ index 25dd2e6..d203d07 100644
|
||||
- symbol_hasher.input_str(&meta[..]);
|
||||
- }
|
||||
- symbol_hasher.input_str("-");
|
||||
symbol_hasher.input_str(&encoder::encoded_ty(tcx, t));
|
||||
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.5.1
|
||||
2.4.10
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
From 1bd3ab55ce24b2a54e021ba471a5f934b3b9ad6b Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
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<String> = (None, parse_opt_string,
|
||||
"tool to assemble archives with"),
|
||||
+ objcopy: Option<String> = (None, parse_opt_string,
|
||||
+ "system objcopy for manipulating objects"),
|
||||
linker: Option<String> = (None, parse_opt_string,
|
||||
"system linker to link outputs with"),
|
||||
link_args: Option<Vec<String>> = (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<String>,
|
||||
pub post_link_objects: Vec<String>,
|
||||
+ /// 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
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
From 128a81ede6b188637743a37a582b2267a49d0a32 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
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<String> = (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
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
From d0fa41075317425b01262dd539c01e87e2eaf5f4 Mon Sep 17 00:00:00 2001
|
||||
From: Steven Walter <swalter@lexmark.com>
|
||||
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
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
From 1fbfa088007054c655741e547bb3e72f1d5f1746 Mon Sep 17 00:00:00 2001
|
||||
From: Cody P Schafer <dev@codyps.com>
|
||||
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
|
||||
|
||||
@@ -1,15 +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"
|
||||
@@ -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"
|
||||
@@ -1,7 +0,0 @@
|
||||
SRC_URI = "\
|
||||
gitsm://github.com/rust-lang/rust.git;protocol=https \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
PV .= "+git${SRCPV}"
|
||||
require rust.inc
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
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}"
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -11,17 +12,30 @@ 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"
|
||||
EXTRA_OECONF += "--disable-terminfo"
|
||||
EXTRA_OECONF += "--disable-zlib"
|
||||
EXTRA_OECONF += "--disable-libffi"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
require rust-release.inc
|
||||
require rust-${PV}.inc
|
||||
require rust-llvm.inc
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
|
||||
@@ -0,0 +1,3 @@
|
||||
inherit shared-source-use
|
||||
require rust-version.inc
|
||||
S .= "/rustc-${PV}"
|
||||
@@ -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"
|
||||
|
||||
@@ -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-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 \
|
||||
"
|
||||
@@ -0,0 +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"
|
||||
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
@@ -0,0 +1,10 @@
|
||||
require rust.inc
|
||||
|
||||
DEPENDS += "rust-llvm"
|
||||
|
||||
# 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"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
+182
-151
@@ -1,20 +1,22 @@
|
||||
# ex: sts=4 et sw=4 ts=8
|
||||
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"
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
DEPENDS += "rust-llvm"
|
||||
DEPENDS += "file-native"
|
||||
|
||||
# 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.
|
||||
@@ -28,6 +30,68 @@ 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}"
|
||||
|
||||
# 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.append("+vfp4")
|
||||
if 'vfpv3' in feat:
|
||||
f.append("+vfp3")
|
||||
if 'vfpv3d16' in feat:
|
||||
f.append("+d16")
|
||||
|
||||
if 'vfpv2' in feat or 'vfp' in feat:
|
||||
f.append("+vfp2")
|
||||
|
||||
if 'neon' in feat:
|
||||
f.append("+neon")
|
||||
|
||||
if 'aarch64' in feat:
|
||||
f.append("+v8")
|
||||
|
||||
v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve'])
|
||||
if not feat.isdisjoint(v7):
|
||||
f.append("+v7")
|
||||
if 'armv6' in feat:
|
||||
f.append("+v6")
|
||||
|
||||
if 'dsp' in feat:
|
||||
f.append("+dsp")
|
||||
|
||||
if d.getVar('ARM_THUMB_OPT', True) is "thumb":
|
||||
if not feat.isdisjoint(v7):
|
||||
f.append("+thumb2")
|
||||
f.append("+thumb-mode")
|
||||
|
||||
if 'cortexa5' in feat:
|
||||
f.append("+a5")
|
||||
if 'cortexa7' in feat:
|
||||
f.append("+a7")
|
||||
if 'cortexa9' in feat:
|
||||
f.append("+a9")
|
||||
if 'cortexa15' in feat:
|
||||
f.append("+a15")
|
||||
if 'cortexa17' in feat:
|
||||
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.append("+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}"
|
||||
@@ -136,6 +200,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)
|
||||
@@ -151,7 +222,12 @@ def rust_gen_target(d, thing, wd):
|
||||
prefix = d.getVar('{}_PREFIX'.format(thing), True)
|
||||
ccache = d.getVar('CCACHE', True)
|
||||
linker = "{}{}gcc".format(ccache, prefix)
|
||||
features = d.getVarFlag('FEATURES', arch, True) or ""
|
||||
objcopy = "{}objcopy".format(prefix)
|
||||
|
||||
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)
|
||||
@@ -165,6 +241,7 @@ def rust_gen_target(d, thing, wd):
|
||||
"arch": "{}",
|
||||
"os": "linux",
|
||||
"linker": "{}",
|
||||
"objcopy": "{}",
|
||||
"features": "{}",
|
||||
"dynamic-linking": true,
|
||||
"executables": true,
|
||||
@@ -182,6 +259,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),
|
||||
@@ -190,16 +268,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):
|
||||
''''
|
||||
@@ -213,8 +290,8 @@ 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 subprocess
|
||||
|
||||
import shutil, subprocess
|
||||
rust_base_sys = rust_base_triple(d, thing)
|
||||
arch = arch_for(d, thing)
|
||||
sys = sys_for(d, thing)
|
||||
@@ -222,10 +299,9 @@ def rust_gen_mk_cfg(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')
|
||||
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')
|
||||
|
||||
r = subprocess.call(['sed',
|
||||
# update all triplets to the new one
|
||||
@@ -257,6 +333,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']:
|
||||
@@ -264,167 +343,119 @@ 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 () {
|
||||
# FIXME: target_prefix vs prefix, see cross.bbclass
|
||||
# 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}"
|
||||
|
||||
# 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: target_prefix vs prefix, see cross.bbclass
|
||||
|
||||
# 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
|
||||
# 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}
|
||||
# - 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
|
||||
}
|
||||
|
||||
## {{{ 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"
|
||||
|
||||
@@ -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 \
|
||||
"
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user