Skip to content

Commit

Permalink
Merge pull request #44 from starlab-io/rust-1.7.0
Browse files Browse the repository at this point in the history
Update rust to version 1.7.0
  • Loading branch information
codyps committed Mar 24, 2016
2 parents d47b157 + 61d0ab2 commit f13ac9d
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 234 deletions.
2 changes: 2 additions & 0 deletions conf/distro/include/rust_security_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}"

SECURITY_LDFLAGS_pn-rust-cross-arm = " -lssp_nonshared -lssp"
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ SRC_URI += " \
file://0001-disable-cargo-snapshot-fetch.patch \
git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${BP}/src/rust-installer \
"
SRC_URI[cargo.md5sum] = "2089790a4a48de7f8f3cb1afcfa9ec74"
SRC_URI[cargo.sha256sum] = "b1067d710e64b66a197294df2fa3dd4fb1d645171eaa517b93d42678bb687338"
SRC_URI[cargo.md5sum] = "c3002e297f125ad40b2e0279219163bc"
SRC_URI[cargo.sha256sum] = "4cadc436be442505851f3a8e9ffff1ef10b6379101a7f8e0afa9fa80f5198f89"

SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499"

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 632d71477fdecb18852812d86b8e2ee1e33c521b Mon Sep 17 00:00:00 2001
From 3237afb78f960c015025186166f1c0998c00c6a6 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/9] Target: add default target.json path:
Expand All @@ -7,14 +7,14 @@ Subject: [PATCH 2/9] Target: add default target.json path:
---
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(-)
src/librustc_back/target/mod.rs | 13 +++++++++++--
3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 7e8104d..ecb38d4 100644
index c4697eb..4cc059b 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -36,7 +36,7 @@ use getopts;
@@ -35,7 +35,7 @@ use getopts;
use std::collections::HashMap;
use std::env;
use std::fmt;
Expand All @@ -23,24 +23,24 @@ index 7e8104d..ecb38d4 100644

use llvm;

@@ -653,8 +653,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
@@ -711,8 +711,8 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
v
}

-pub fn build_target_config(opts: &Options, sp: &SpanHandler) -> Config {
-pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
- let target = match Target::search(&opts.target_triple) {
+pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &SpanHandler) -> Config {
+pub fn build_target_config(sysroot: &Path, opts: &Options, sp: &Handler) -> Config {
+ let target = match Target::search(sysroot, &opts.target_triple[..]) {
Ok(t) => t,
Err(e) => {
sp.handler().fatal(&format!("Error loading target specification: {}", e));
panic!(sp.fatal(&format!("Error loading target specification: {}", e)));
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 0a1df25..ad223d5 100644
index 2f3af1c..6424cff 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -412,14 +412,18 @@ pub fn build_session_(sopts: config::Options,
local_crate_source_file: Option<PathBuf>,
span_diagnostic: diagnostic::SpanHandler)
@@ -429,13 +429,17 @@ pub fn build_session_(sopts: config::Options,
codemap: Rc<codemap::CodeMap>,
cstore: Rc<for<'a> CrateStore<'a>>)
-> Session {
- let host = match Target::search(config::host_triple()) {
+ let sysroot = match sopts.maybe_sysroot {
Expand All @@ -50,29 +50,28 @@ index 0a1df25..ad223d5 100644
+ let host = match Target::search(&sysroot, config::host_triple()) {
Ok(t) => t,
Err(e) => {
span_diagnostic.handler()
.fatal(&format!("Error loading host specification: {}", e));
panic!(span_diagnostic.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 p_s = parse::ParseSess::with_span_handler(span_diagnostic, codemap);
let default_sysroot = match sopts.maybe_sysroot {
Some(_) => None,
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 6ae7435..3ffa484 100644
index 5114910..636a1aa 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 syntax::abi;
+use std::borrow::ToOwned;
+use std::path::Path;

mod android_base;
mod apple_base;
@@ -346,12 +348,13 @@ impl Target {
@@ -366,12 +368,13 @@ impl Target {
///
/// The error string could come from any of the APIs called, including
/// filesystem access and JSON decoding.
Expand All @@ -87,11 +86,10 @@ index 6ae7435..3ffa484 100644

fn load_file(path: &Path) -> Result<Target, String> {
let mut f = try!(File::open(path).map_err(|e| e.to_string()));
@@ -447,9 +450,14 @@ impl Target {
let target_path = env::var_os("RUST_TARGET_PATH")
@@ -470,8 +473,14 @@ impl Target {
.unwrap_or(OsString::new());

- // FIXME 16351: add a sane default search path?
// 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");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b544f5bfa38d5932db23214e168988d05cbc5620 Mon Sep 17 00:00:00 2001
From 3254ad1d84b177eb960219c2bce26f8980a511e1 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/9] mk: for stage0, use RUSTFLAGS to override target libs dir
Expand All @@ -8,29 +8,41 @@ 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(-)
mk/main.mk | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/mk/main.mk b/mk/main.mk
index 34f8247..896c1df 100644
index 963c12f..04b3e25 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -376,21 +376,22 @@ define SREQ
# Destinations of artifacts for the host compiler
@@ -383,32 +383,26 @@ define SREQ
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)
-# On Windows we always store host runtime libraries in the 'bin' directory because
-# there's no rpath. Target libraries go under $CFG_LIBDIR_RELATIVE (usually 'lib').
-HLIB_RELATIVE$(1)_H_$(3) = bin
-TROOT$(1)_T_$(2)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)/rustlib/$(2)
-# Remove the next 3 lines after a snapshot
-ifeq ($(1),0)
-RUSTFLAGS_STAGE0 += -L $$(TROOT$(1)_T_$(2)_H_$(3))/lib
-endif
-
-else
-
-ifeq ($(1),0)
-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
-HLIB_RELATIVE$(1)_H_$(3) = lib
-else
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
HLIB_RELATIVE$(1)_H_$(3) = $$(CFG_LIBDIR_RELATIVE)
-endif
+
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)

-endif
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(HLIB_RELATIVE$(1)_H_$(3))

# 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

Expand All @@ -42,19 +54,20 @@ index 34f8247..896c1df 100644
+RUSTFLAGS_S_$(1)_T_$(2)_H_$(3) += --sysroot "$$(HROOT$(1)_H_$(3))" \
+ -L "$$(TLIB$(1)_T_$(2)_H_$(3))"
+endif
+
+
# Preqrequisites for using the stageN compiler
ifeq ($(1),0)
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
@@ -502,6 +503,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
@@ -520,6 +514,7 @@ STAGE$(1)_T_$(2)_H_$(3) := \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
+ $$(RUSTFLAGS_S_$(1)_T_$(2)_H_$(3)) \
$$(RUSTC_FLAGS_$(2))

PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -510,6 +512,7 @@ PERF_STAGE$(1)_T_$(2)_H_$(3) := \
@@ -528,6 +523,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)) \
Expand Down

0 comments on commit f13ac9d

Please sign in to comment.