19 Commits

Author SHA1 Message Date
Jonathan Creekmore
a4797129e2 Remove Rust 1.24.0 in favor of 1.24.1
The Rust maintainers released 1.24.1 because several minor regressions
were found in the 1.24.0 release that collectively merited an updated
release.
2018-03-06 13:34:43 -05:00
Adam Schwalm
48334bec1d Add 1.24.0 for rocko 2018-03-06 13:34:01 -05:00
Andrei Gherzan
5b0492fd4c libstd-rs: Set SONAME for libstd.so
When yocto is searching for lib dependencies it uses SONAMES and RPATHS to find
the right one. When we compile a rust package which dynamically links to rust's
libstd, yocto will not be able to find the matching dependency in shlib and
will complain with a warning. Even worse, if you have compiled go-runtime, the
build will find go-runtime as provider of libstd and will complain that you
missed a RDEPENDS to go-runtime - this is completely wrong obviously.

This patch adds SONAME to rust's stdlib. In this way yocto will create the
required provider and packages dynamically linking to it will be able to find
libstd-rs as a provider of stdlib.

Signed-off-by: Andrei Gherzan <andrei@resin.io>
2018-02-27 07:55:28 -05:00
Derek Straka
357f11b517 Jenkinsfile: Update to for the newly created rocko branch
Signed-off-by: Derek Straka <derek@asterius.io>
2018-02-02 09:03:24 -05:00
Derek Straka
17cc34c9c8 Merge pull request #185 from tylerwhall/panic-strategy
rust: allow configuring panic-strategy
2018-01-27 09:46:35 -05:00
Derek Straka
a19993c804 Merge branch 'master' into panic-strategy 2018-01-26 08:28:06 -05:00
Tyler Hall
03c0338cab Merge pull request #184 from bkylerussell/rm-do-compile
rust-llvm: remove custom do_compile
2018-01-24 13:45:24 -05:00
Tyler Hall
52ea673a8f rust: allow configuring panic-strategy
This defaults to "unwind" if not set, so this alone has no effect.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2018-01-23 17:54:15 -05:00
Kyle Russell
4c7cbf6a60 rust-llvm: remove custom do_compile
This works out in recent poky releases because cmake_do_compile ends up
in oe_runmake via base_do_compile, but this changed recently to allow
cmake's generic `cmake --build` feature to call the appropriate
generator instead of always assuming make.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=579d17ba5f722edb9fe79682480c4a9508ad0ed4
2018-01-23 17:31:43 -05:00
Derek Straka
8f46fe3e97 Merge pull request #182 from Fulkerson/master
Add support for the mips32 architecture
2017-12-03 14:43:32 -05:00
Johan Anderholm
c65375f14f Jenkinsfile: Add qemumips machine 2017-12-02 08:39:09 +01:00
Johan Anderholm
f02df59eea Add support for the mips32 architecture
Support for mips32 big (mips) and little endian (mipsel) for mips32
and mips32r2 cpus. The big endian target can be verified with the
qemumips machine.
2017-12-01 19:36:15 +01:00
Johan Anderholm
141177fbf9 rust: specify target-c-int-width
The "target_c_int_width field is added to librustc_back since rust
1.22.0 because not all rust targets (e.g. msp430-none-elf, avr)
have 32-bit int types any more.
2017-11-27 15:48:54 -06:00
Steven Walter
fa4f4f9c1a Merge pull request #180 from srwalter/stable-sstate-hashes
Make rustc output reproducible
2017-11-08 10:17:21 -05:00
Steven Walter
7f7156b664 Merge branch 'master' into stable-sstate-hashes 2017-11-08 09:42:06 -05:00
Derek Straka
af5491692e Merge pull request #179 from meta-rust/add-debug-to-build-script
Add debug information to troubleshoot jenkins issues
2017-11-03 16:00:43 -04:00
Tyler Hall
e5230147f6 Remap source paths
This is needed for reproducible builds.
2017-11-03 12:41:51 -04:00
Tyler Hall
528a34206b rustc: always allow unstable options 2017-11-03 12:41:51 -04:00
Tyler Hall
434f7851f5 Fix path substitution 2017-11-03 12:41:51 -04:00
17 changed files with 1124 additions and 22 deletions

6
Jenkinsfile vendored
View File

@@ -1,4 +1,4 @@
def targets = [ 'qemux86', 'qemux86-64', 'qemuarm', 'qemuarm64' ]
def targets = [ 'qemux86', 'qemux86-64', 'qemuarm', 'qemuarm64', 'qemumips' ]
def machine_builds = [:]
@@ -15,7 +15,7 @@ for (int i = 0; i < targets.size(); i++) {
sh "./scripts/setup-env.sh"
}
stage("fetch $machine") {
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh master"
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh rocko"
}
stage("build $machine") {
sh "MACHINE=${machine} ./scripts/build.sh"
@@ -25,7 +25,7 @@ for (int i = 0; i < targets.size(); i++) {
throw e
} finally {
stage("push build cache $machine") {
sh "./scripts/publish-build-cache.sh master"
sh "./scripts/publish-build-cache.sh rocko"
}
stage("cleanup $machine") {
sh "./scripts/cleanup-env.sh"

View File

@@ -5,9 +5,11 @@ FILES_${PN}-dev += "${rustlibdir}/*.rlib"
FILES_${PN}-dbg += "${rustlibdir}/.debug"
RUSTLIB = "-L ${STAGING_LIBDIR}/rust"
RUSTFLAGS += "${RUSTLIB}"
RUST_DEBUG_REMAP = "-Zremap-path-prefix-from=${WORKDIR} -Zremap-path-prefix-to=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
RUSTLIB_DEP ?= "libstd-rs"
RUST_TARGET_PATH = "${STAGING_LIBDIR_NATIVE}/rustlib"
RUST_PANIC_STRATEGY ?= "unwind"
# Responsible for taking Yocto triples and converting it to Rust triples

View File

@@ -0,0 +1,12 @@
CARGO_SNAPSHOT = "cargo-0.24.0-${RUST_BUILD_SYS}"
SRC_URI[cargo-snapshot.md5sum] = "830041cfc8627d3f7187954993449cf9"
SRC_URI[cargo-snapshot.sha256sum] = "ff8a454104aba20426ea898ed7515ec5da7de07d11733cdda17462455beb76e8"
SRC_URI += "\
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot \
"
# When building cargo-native we don't have a built cargo to use so we must use
# the snapshot to bootstrap the build of cargo
CARGO_class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/cargo/bin/cargo"

View File

@@ -0,0 +1,167 @@
# Auto-Generated by cargo-bitbake 0.3.10-pre
#
inherit cargo
# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"
# how to get cargo could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/cargo/0.25.0"
SRC_URI += "git://github.com/rust-lang/cargo;protocol=http;branch=rust-1.24.0"
SRCREV = "8c93e089536467783957fec23b0f2627bb6ce357"
S = "${WORKDIR}/git"
CARGO_SRC_DIR=""
# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
crate://crates.io/advapi32-sys/0.2.0 \
crate://crates.io/aho-corasick/0.5.3 \
crate://crates.io/aho-corasick/0.6.4 \
crate://crates.io/atty/0.2.6 \
crate://crates.io/backtrace-sys/0.1.16 \
crate://crates.io/backtrace/0.3.5 \
crate://crates.io/bitflags/0.9.1 \
crate://crates.io/bitflags/1.0.1 \
crate://crates.io/bufstream/0.1.3 \
crate://crates.io/cc/1.0.4 \
crate://crates.io/cfg-if/0.1.2 \
crate://crates.io/cmake/0.1.29 \
crate://crates.io/commoncrypto-sys/0.2.0 \
crate://crates.io/commoncrypto/0.2.0 \
crate://crates.io/core-foundation-sys/0.4.6 \
crate://crates.io/core-foundation/0.4.6 \
crate://crates.io/crossbeam/0.2.12 \
crate://crates.io/crossbeam/0.3.2 \
crate://crates.io/crypto-hash/0.3.0 \
crate://crates.io/curl-sys/0.4.1 \
crate://crates.io/curl/0.4.11 \
crate://crates.io/docopt/0.8.3 \
crate://crates.io/dtoa/0.4.2 \
crate://crates.io/env_logger/0.4.3 \
crate://crates.io/failure/0.1.1 \
crate://crates.io/failure_derive/0.1.1 \
crate://crates.io/filetime/0.1.15 \
crate://crates.io/flate2/1.0.1 \
crate://crates.io/fnv/1.0.6 \
crate://crates.io/foreign-types-shared/0.1.1 \
crate://crates.io/foreign-types/0.3.2 \
crate://crates.io/fs2/0.4.3 \
crate://crates.io/fuchsia-zircon-sys/0.3.3 \
crate://crates.io/fuchsia-zircon/0.3.3 \
crate://crates.io/git2-curl/0.7.0 \
crate://crates.io/git2/0.6.11 \
crate://crates.io/glob/0.2.11 \
crate://crates.io/globset/0.2.1 \
crate://crates.io/hamcrest/0.1.1 \
crate://crates.io/hex/0.2.0 \
crate://crates.io/home/0.3.0 \
crate://crates.io/idna/0.1.4 \
crate://crates.io/ignore/0.2.2 \
crate://crates.io/itoa/0.3.4 \
crate://crates.io/jobserver/0.1.9 \
crate://crates.io/kernel32-sys/0.2.2 \
crate://crates.io/lazy_static/0.2.11 \
crate://crates.io/lazy_static/1.0.0 \
crate://crates.io/libc/0.2.36 \
crate://crates.io/libgit2-sys/0.6.19 \
crate://crates.io/libssh2-sys/0.2.6 \
crate://crates.io/libz-sys/1.0.18 \
crate://crates.io/log/0.3.9 \
crate://crates.io/log/0.4.1 \
crate://crates.io/matches/0.1.6 \
crate://crates.io/memchr/0.1.11 \
crate://crates.io/memchr/1.0.2 \
crate://crates.io/memchr/2.0.1 \
crate://crates.io/miniz-sys/0.1.10 \
crate://crates.io/miow/0.2.1 \
crate://crates.io/net2/0.2.31 \
crate://crates.io/num-bigint/0.1.43 \
crate://crates.io/num-complex/0.1.42 \
crate://crates.io/num-integer/0.1.36 \
crate://crates.io/num-iter/0.1.35 \
crate://crates.io/num-rational/0.1.42 \
crate://crates.io/num-traits/0.1.43 \
crate://crates.io/num-traits/0.2.0 \
crate://crates.io/num/0.1.42 \
crate://crates.io/num_cpus/1.8.0 \
crate://crates.io/openssl-probe/0.1.2 \
crate://crates.io/openssl-sys/0.9.26 \
crate://crates.io/openssl/0.9.24 \
crate://crates.io/percent-encoding/1.0.1 \
crate://crates.io/pkg-config/0.3.9 \
crate://crates.io/psapi-sys/0.1.1 \
crate://crates.io/quote/0.3.15 \
crate://crates.io/rand/0.3.22 \
crate://crates.io/rand/0.4.2 \
crate://crates.io/redox_syscall/0.1.37 \
crate://crates.io/redox_termios/0.1.1 \
crate://crates.io/regex-syntax/0.3.9 \
crate://crates.io/regex-syntax/0.4.2 \
crate://crates.io/regex/0.1.80 \
crate://crates.io/regex/0.2.6 \
crate://crates.io/remove_dir_all/0.3.0 \
crate://crates.io/rustc-demangle/0.1.6 \
crate://crates.io/rustc-serialize/0.3.24 \
crate://crates.io/same-file/0.1.3 \
crate://crates.io/schannel/0.1.10 \
crate://crates.io/scoped-tls/0.1.0 \
crate://crates.io/scopeguard/0.1.2 \
crate://crates.io/semver-parser/0.7.0 \
crate://crates.io/semver/0.8.0 \
crate://crates.io/serde/1.0.27 \
crate://crates.io/serde_derive/1.0.27 \
crate://crates.io/serde_derive_internals/0.19.0 \
crate://crates.io/serde_ignored/0.0.4 \
crate://crates.io/serde_json/1.0.9 \
crate://crates.io/shell-escape/0.1.3 \
crate://crates.io/socket2/0.3.1 \
crate://crates.io/strsim/0.6.0 \
crate://crates.io/syn/0.11.11 \
crate://crates.io/synom/0.11.3 \
crate://crates.io/synstructure/0.6.1 \
crate://crates.io/tar/0.4.14 \
crate://crates.io/tempdir/0.3.6 \
crate://crates.io/termcolor/0.3.4 \
crate://crates.io/termion/1.5.1 \
crate://crates.io/thread-id/2.0.0 \
crate://crates.io/thread_local/0.2.7 \
crate://crates.io/thread_local/0.3.5 \
crate://crates.io/toml/0.4.5 \
crate://crates.io/unicode-bidi/0.3.4 \
crate://crates.io/unicode-normalization/0.1.5 \
crate://crates.io/unicode-xid/0.0.4 \
crate://crates.io/unreachable/1.0.0 \
crate://crates.io/url/1.6.0 \
crate://crates.io/userenv-sys/0.2.0 \
crate://crates.io/utf8-ranges/0.1.3 \
crate://crates.io/utf8-ranges/1.0.0 \
crate://crates.io/vcpkg/0.2.2 \
crate://crates.io/void/1.0.2 \
crate://crates.io/walkdir/1.0.7 \
crate://crates.io/winapi-build/0.1.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.2.8 \
crate://crates.io/winapi/0.3.4 \
crate://crates.io/wincolor/0.1.6 \
crate://crates.io/ws2_32-sys/0.2.1 \
"
# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM=" \
file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
"
SUMMARY = "Cargo, a package manager for Rust."
HOMEPAGE = "https://crates.io"
LICENSE = "MIT | Apache-2.0"
# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include cargo-${PV}.inc
include cargo.inc

View File

@@ -0,0 +1,245 @@
From a0714f06eb1df66a206e1d0fadccf175276b753b Mon Sep 17 00:00:00 2001
From: Philip Craig <philipjcraig@gmail.com>
Date: Sat, 30 Sep 2017 16:28:48 +1000
Subject: [PATCH] Don't use remapped path when loading modules and include
files
---
src/librustc/ich/impls_syntax.rs | 1 +
src/librustc/session/mod.rs | 4 +---
src/libsyntax/codemap.rs | 14 +++++++++++++-
src/libsyntax/ext/expand.rs | 6 ++----
src/libsyntax/ext/source_util.rs | 2 +-
src/libsyntax/parse/parser.rs | 2 +-
src/libsyntax_pos/lib.rs | 6 ++++++
src/test/codegen/remap_path_prefix/aux_mod.rs | 16 ++++++++++++++++
src/test/codegen/remap_path_prefix/main.rs | 7 +++++++
9 files changed, 48 insertions(+), 10 deletions(-)
create mode 100644 src/test/codegen/remap_path_prefix/aux_mod.rs
diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs
index b827284271..489fd9b5b7 100644
--- a/src/librustc/ich/impls_syntax.rs
+++ b/src/librustc/ich/impls_syntax.rs
@@ -332,6 +332,7 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for FileMa
let FileMap {
ref name,
name_was_remapped,
+ path: _,
crate_of_origin,
// Do not hash the source as it is not encoded
src: _,
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 7ff9d202c1..619ae81506 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -72,8 +72,7 @@ pub struct Session {
pub derive_registrar_fn: Cell<Option<ast::NodeId>>,
pub default_sysroot: Option<PathBuf>,
// The name of the root source file of the crate, in the local file system.
- // The path is always expected to be absolute. `None` means that there is no
- // source file.
+ // `None` means that there is no source file.
pub local_crate_source_file: Option<String>,
// The directory the compiler has been executed in plus a flag indicating
// if the value stored here has been affected by path remapping.
@@ -707,7 +706,6 @@ pub fn build_session_(sopts: config::Options,
let file_path_mapping = sopts.file_path_mapping();
- // Make the path absolute, if necessary
let local_crate_source_file = local_crate_source_file.map(|path| {
file_path_mapping.map_prefix(path.to_string_lossy().into_owned()).0
});
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 30ae7df935..e8cfa51ee2 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -162,9 +162,16 @@ impl CodeMap {
let start_pos = self.next_start_pos();
let mut files = self.files.borrow_mut();
+ // The path is used to determine the directory for loading submodules and
+ // include files, so it must be before remapping.
+ // Note that filename may not be a valid path, eg it may be `<anon>` etc,
+ // but this is okay because the directory determined by `path.pop()` will
+ // be empty, so the working directory will be used.
+ let path = PathBuf::from(filename.clone());
+
let (filename, was_remapped) = self.path_mapping.map_prefix(filename);
let filemap =
- Rc::new(FileMap::new(filename, was_remapped, src, Pos::from_usize(start_pos)));
+ Rc::new(FileMap::new(filename, was_remapped, path, src, Pos::from_usize(start_pos)));
files.push(filemap.clone());
@@ -216,6 +223,7 @@ impl CodeMap {
let filemap = Rc::new(FileMap {
name: filename,
name_was_remapped,
+ path: PathBuf::new(),
crate_of_origin,
src: None,
src_hash,
@@ -351,6 +359,10 @@ impl CodeMap {
self.lookup_char_pos(sp.lo).file.name.to_string()
}
+ pub fn span_to_path(&self, sp: Span) -> PathBuf {
+ self.lookup_char_pos(sp.lo).file.path.clone()
+ }
+
pub fn span_to_lines(&self, sp: Span) -> FileLinesResult {
debug!("span_to_lines(sp={:?})", sp);
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 171b0a22e9..8db8c83ef4 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -35,7 +35,6 @@ use visit::Visitor;
use std::collections::HashMap;
use std::mem;
-use std::path::PathBuf;
use std::rc::Rc;
macro_rules! expansions {
@@ -200,7 +199,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
self.cx.crate_root = std_inject::injected_crate_name(&krate);
let mut module = ModuleData {
mod_path: vec![Ident::from_str(&self.cx.ecfg.crate_name)],
- directory: PathBuf::from(self.cx.codemap().span_to_filename(krate.span)),
+ directory: self.cx.codemap().span_to_path(krate.span),
};
module.directory.pop();
self.cx.current_expansion.module = Rc::new(module);
@@ -902,8 +901,7 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
module.directory.push(&*item.ident.name.as_str());
}
} else {
- let mut path =
- PathBuf::from(self.cx.parse_sess.codemap().span_to_filename(inner));
+ let mut path = self.cx.parse_sess.codemap().span_to_path(inner);
let directory_ownership = match path.file_name().unwrap().to_str() {
Some("mod.rs") => DirectoryOwnership::Owned,
_ => DirectoryOwnership::UnownedViaMod(false),
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 95fe41be12..17a18256b3 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -197,7 +197,7 @@ fn res_rel_file(cx: &mut ExtCtxt, sp: syntax_pos::Span, arg: &Path) -> PathBuf {
// after macro expansion (that is, they are unhygienic).
if !arg.is_absolute() {
let callsite = sp.source_callsite();
- let mut path = PathBuf::from(&cx.codemap().span_to_filename(callsite));
+ let mut path = cx.codemap().span_to_path(callsite);
path.pop();
path.push(arg);
path
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 90a635fdf4..8c443e8b27 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -519,7 +519,7 @@ impl<'a> Parser<'a> {
if let Some(directory) = directory {
parser.directory = directory;
} else if parser.span != syntax_pos::DUMMY_SP {
- parser.directory.path = PathBuf::from(sess.codemap().span_to_filename(parser.span));
+ parser.directory.path = sess.codemap().span_to_path(parser.span);
parser.directory.path.pop();
}
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index d34dcfa3ed..b0db4edc30 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -32,6 +32,7 @@ use std::cmp;
use std::fmt;
use std::hash::Hasher;
use std::ops::{Add, Sub};
+use std::path::PathBuf;
use std::rc::Rc;
use rustc_data_structures::stable_hasher::StableHasher;
@@ -441,6 +442,8 @@ pub struct FileMap {
pub name: FileName,
/// True if the `name` field above has been modified by -Zremap-path-prefix
pub name_was_remapped: bool,
+ /// The path of the file that the source came from.
+ pub path: PathBuf,
/// Indicates which crate this FileMap was imported from.
pub crate_of_origin: u32,
/// The complete source code
@@ -566,6 +569,7 @@ impl Decodable for FileMap {
Ok(FileMap {
name,
name_was_remapped,
+ path: PathBuf::new(),
// `crate_of_origin` has to be set by the importer.
// This value matches up with rustc::hir::def_id::INVALID_CRATE.
// That constant is not available here unfortunately :(
@@ -591,6 +595,7 @@ impl fmt::Debug for FileMap {
impl FileMap {
pub fn new(name: FileName,
name_was_remapped: bool,
+ path: PathBuf,
mut src: String,
start_pos: BytePos) -> FileMap {
remove_bom(&mut src);
@@ -604,6 +609,7 @@ impl FileMap {
FileMap {
name,
name_was_remapped,
+ path,
crate_of_origin: 0,
src: Some(Rc::new(src)),
src_hash,
diff --git a/src/test/codegen/remap_path_prefix/aux_mod.rs b/src/test/codegen/remap_path_prefix/aux_mod.rs
new file mode 100644
index 0000000000..2a7019957a
--- /dev/null
+++ b/src/test/codegen/remap_path_prefix/aux_mod.rs
@@ -0,0 +1,16 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// ignore-test: this is not a test
+
+#[inline]
+pub fn some_aux_mod_function() -> i32 {
+ 1234
+}
diff --git a/src/test/codegen/remap_path_prefix/main.rs b/src/test/codegen/remap_path_prefix/main.rs
index eb00c91ba5..c73739bb76 100644
--- a/src/test/codegen/remap_path_prefix/main.rs
+++ b/src/test/codegen/remap_path_prefix/main.rs
@@ -16,12 +16,19 @@
extern crate remap_path_prefix_aux;
+// Here we check that submodules and include files are found using the path without
+// remapping. This test requires that rustc is called with an absolute path.
+mod aux_mod;
+include!("aux_mod.rs");
+
// Here we check that the expansion of the file!() macro is mapped.
// CHECK: internal constant [34 x i8] c"/the/src/remap_path_prefix/main.rs"
pub static FILE_PATH: &'static str = file!();
fn main() {
remap_path_prefix_aux::some_aux_function();
+ aux_mod::some_aux_mod_function();
+ some_aux_mod_function();
}
// Here we check that local debuginfo is mapped correctly.
--
2.14.3

View File

@@ -0,0 +1,43 @@
From 6a82f31d21ac7b85211e580585cc73ab2bdb0bc9 Mon Sep 17 00:00:00 2001
From: Tyler Hall <tyler.hall@lexmark.com>
Date: Sun, 29 Oct 2017 16:29:03 -0400
Subject: [PATCH] librustc: always allow unstable options
---
src/librustc/session/config.rs | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 4b41572c1a..97381bc05c 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1703,8 +1703,6 @@ pub mod nightly_options {
pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]) {
let has_z_unstable_option = matches.opt_strs("Z").iter().any(|x| *x == "unstable-options");
- let really_allows_unstable_options = UnstableFeatures::from_environment()
- .is_nightly_build();
for opt in flags.iter() {
if opt.stability == OptionStability::Stable {
@@ -1719,17 +1717,6 @@ pub mod nightly_options {
the flag `{}`",
opt.name));
}
- if really_allows_unstable_options {
- continue
- }
- match opt.stability {
- OptionStability::Unstable => {
- let msg = format!("the option `{}` is only accepted on the \
- nightly compiler", opt.name);
- early_error(ErrorOutputType::default(), &msg);
- }
- OptionStability::Stable => {}
- }
}
}
}
--
2.14.2

View File

@@ -0,0 +1,43 @@
From 6a82f31d21ac7b85211e580585cc73ab2bdb0bc9 Mon Sep 17 00:00:00 2001
From: Tyler Hall <tyler.hall@lexmark.com>
Date: Sun, 29 Oct 2017 16:29:03 -0400
Subject: [PATCH] librustc: always allow unstable options
---
src/librustc/session/config.rs | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 4b41572c1a..97381bc05c 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1703,8 +1703,6 @@ pub mod nightly_options {
pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]) {
let has_z_unstable_option = matches.opt_strs("Z").iter().any(|x| *x == "unstable-options");
- let really_allows_unstable_options = UnstableFeatures::from_environment()
- .is_nightly_build();
for opt in flags.iter() {
if opt.stability == OptionStability::Stable {
@@ -1719,17 +1717,6 @@ pub mod nightly_options {
the flag `{}`",
opt.name));
}
- if really_allows_unstable_options {
- continue
- }
- match opt.stability {
- OptionStability::Unstable => {
- let msg = format!("the option `{}` is only accepted on the \
- nightly compiler", opt.name);
- early_error(ErrorOutputType::default(), &msg);
- }
- OptionStability::Stable => {}
- }
}
}
}
--
2.14.2

View File

@@ -7,7 +7,7 @@ RUSTLIB_DEP = ""
inherit cargo
# Needed so cargo can find libbacktrace
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
S = "${RUSTSRC}/src/libstd"
@@ -20,5 +20,9 @@ do_compile_prepend () {
do_install () {
mkdir -p ${D}${rustlibdir}
# With the incremental build support added in 1.24, the libstd deps directory also includes dependency
# files that get installed. Those are really only needed to incrementally rebuild the libstd library
# itself and don't need to be installed.
rm ${B}/${TARGET_SYS}/release/deps/*.d
cp ${B}/${TARGET_SYS}/release/deps/* ${D}${rustlibdir}
}

View File

@@ -0,0 +1,235 @@
require rust-source-${PV}.inc
require libstd-rs.inc
LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=c709a09d1b062d9a908e3631c1e1cdf5"
# Don't use jemalloc as it doesn't work for many targets.
# https://github.com/rust-lang/rust/pull/37392
CARGO_BUILD_FLAGS += "--features 'panic-unwind'"
# These are taken from src/libstd/Cargo.toml via cargo-bitbake
SRC_URI += " \
crate://crates.io/advapi32-sys/0.2.0 \
crate://crates.io/aho-corasick/0.5.3 \
crate://crates.io/aho-corasick/0.6.4 \
crate://crates.io/ansi_term/0.10.2 \
crate://crates.io/ar/0.3.1 \
crate://crates.io/atty/0.2.3 \
crate://crates.io/backtrace-sys/0.1.16 \
crate://crates.io/backtrace/0.3.4 \
crate://crates.io/bitflags/0.7.0 \
crate://crates.io/bitflags/0.9.1 \
crate://crates.io/bitflags/1.0.1 \
crate://crates.io/bufstream/0.1.3 \
crate://crates.io/byteorder/1.2.1 \
crate://crates.io/cargo_metadata/0.2.3 \
crate://crates.io/cargo_metadata/0.4.0 \
crate://crates.io/cc/1.0.3 \
crate://crates.io/cfg-if/0.1.2 \
crate://crates.io/clap/2.29.0 \
crate://crates.io/cmake/0.1.29 \
crate://crates.io/coco/0.1.1 \
crate://crates.io/commoncrypto-sys/0.2.0 \
crate://crates.io/commoncrypto/0.2.0 \
crate://crates.io/compiletest_rs/0.3.3 \
crate://crates.io/core-foundation-sys/0.4.6 \
crate://crates.io/core-foundation/0.4.6 \
crate://crates.io/crossbeam/0.2.10 \
crate://crates.io/crossbeam/0.3.0 \
crate://crates.io/crypto-hash/0.3.0 \
crate://crates.io/cssparser-macros/0.3.0 \
crate://crates.io/cssparser/0.13.7 \
crate://crates.io/curl-sys/0.3.15 \
crate://crates.io/curl/0.4.8 \
crate://crates.io/dbghelp-sys/0.2.0 \
crate://crates.io/debug_unreachable/0.1.1 \
crate://crates.io/derive-new/0.5.0 \
crate://crates.io/diff/0.1.11 \
crate://crates.io/docopt/0.8.1 \
crate://crates.io/dtoa/0.4.2 \
crate://crates.io/duct/0.8.2 \
crate://crates.io/either/1.4.0 \
crate://crates.io/endian-type/0.1.2 \
crate://crates.io/enum_primitive/0.1.1 \
crate://crates.io/env_logger/0.3.5 \
crate://crates.io/env_logger/0.4.3 \
crate://crates.io/error-chain/0.11.0 \
crate://crates.io/error-chain/0.8.1 \
crate://crates.io/failure/0.1.1 \
crate://crates.io/failure_derive/0.1.1 \
crate://crates.io/filetime/0.1.14 \
crate://crates.io/flate2/1.0.1 \
crate://crates.io/fnv/1.0.6 \
crate://crates.io/foreign-types-shared/0.1.1 \
crate://crates.io/foreign-types/0.3.2 \
crate://crates.io/fs2/0.4.2 \
crate://crates.io/fuchsia-zircon-sys/0.3.2 \
crate://crates.io/fuchsia-zircon/0.3.2 \
crate://crates.io/futf/0.1.3 \
crate://crates.io/futures/0.1.17 \
crate://crates.io/getopts/0.2.15 \
crate://crates.io/git2-curl/0.7.0 \
crate://crates.io/git2/0.6.10 \
crate://crates.io/glob/0.2.11 \
crate://crates.io/globset/0.2.1 \
crate://crates.io/hamcrest/0.1.1 \
crate://crates.io/handlebars/0.29.1 \
crate://crates.io/hex/0.2.0 \
crate://crates.io/home/0.3.0 \
crate://crates.io/html-diff/0.0.5 \
crate://crates.io/html5ever/0.20.0 \
crate://crates.io/idna/0.1.4 \
crate://crates.io/if_chain/0.1.2 \
crate://crates.io/ignore/0.2.2 \
crate://crates.io/itertools/0.6.5 \
crate://crates.io/itoa/0.3.4 \
crate://crates.io/jobserver/0.1.8 \
crate://crates.io/json/0.11.12 \
crate://crates.io/jsonrpc-core/8.0.1 \
crate://crates.io/kernel32-sys/0.2.2 \
crate://crates.io/kuchiki/0.6.0 \
crate://crates.io/languageserver-types/0.16.0 \
crate://crates.io/lazy_static/0.2.11 \
crate://crates.io/lazy_static/1.0.0 \
crate://crates.io/lazycell/0.5.1 \
crate://crates.io/libc/0.2.34 \
crate://crates.io/libgit2-sys/0.6.18 \
crate://crates.io/libssh2-sys/0.2.6 \
crate://crates.io/libz-sys/1.0.18 \
crate://crates.io/log/0.3.9 \
crate://crates.io/log/0.4.1 \
crate://crates.io/log_settings/0.1.1 \
crate://crates.io/lzma-sys/0.1.9 \
crate://crates.io/mac/0.1.1 \
crate://crates.io/markup5ever/0.5.0 \
crate://crates.io/matches/0.1.6 \
crate://crates.io/mdbook/0.0.26 \
crate://crates.io/memchr/0.1.11 \
crate://crates.io/memchr/1.0.2 \
crate://crates.io/memchr/2.0.1 \
crate://crates.io/miniz-sys/0.1.10 \
crate://crates.io/miow/0.2.1 \
crate://crates.io/net2/0.2.31 \
crate://crates.io/nibble_vec/0.0.3 \
crate://crates.io/nix/0.8.1 \
crate://crates.io/num-bigint/0.1.41 \
crate://crates.io/num-complex/0.1.41 \
crate://crates.io/num-integer/0.1.35 \
crate://crates.io/num-iter/0.1.34 \
crate://crates.io/num-rational/0.1.40 \
crate://crates.io/num-traits/0.1.41 \
crate://crates.io/num/0.1.41 \
crate://crates.io/num_cpus/1.7.0 \
crate://crates.io/open/1.2.1 \
crate://crates.io/openssl-probe/0.1.2 \
crate://crates.io/openssl-sys/0.9.23 \
crate://crates.io/openssl/0.9.23 \
crate://crates.io/os_pipe/0.5.1 \
crate://crates.io/owning_ref/0.3.3 \
crate://crates.io/parking_lot/0.5.3 \
crate://crates.io/parking_lot_core/0.2.9 \
crate://crates.io/percent-encoding/1.0.1 \
crate://crates.io/pest/0.3.3 \
crate://crates.io/phf/0.7.21 \
crate://crates.io/phf_codegen/0.7.21 \
crate://crates.io/phf_generator/0.7.21 \
crate://crates.io/phf_shared/0.7.21 \
crate://crates.io/pkg-config/0.3.9 \
crate://crates.io/precomputed-hash/0.1.1 \
crate://crates.io/procedural-masquerade/0.1.5 \
crate://crates.io/psapi-sys/0.1.1 \
crate://crates.io/pulldown-cmark/0.0.15 \
crate://crates.io/pulldown-cmark/0.1.0 \
crate://crates.io/quick-error/1.2.1 \
crate://crates.io/quine-mc_cluskey/0.2.4 \
crate://crates.io/quote/0.3.15 \
crate://crates.io/racer/2.0.12 \
crate://crates.io/radix_trie/0.1.2 \
crate://crates.io/rand/0.3.19 \
crate://crates.io/rayon-core/1.3.0 \
crate://crates.io/rayon/0.9.0 \
crate://crates.io/redox_syscall/0.1.32 \
crate://crates.io/redox_termios/0.1.1 \
crate://crates.io/regex-syntax/0.3.9 \
crate://crates.io/regex-syntax/0.4.1 \
crate://crates.io/regex/0.1.80 \
crate://crates.io/regex/0.2.3 \
crate://crates.io/rls-analysis/0.10.0 \
crate://crates.io/rls-data/0.14.0 \
crate://crates.io/rls-rustc/0.1.1 \
crate://crates.io/rls-span/0.4.0 \
crate://crates.io/rls-vfs/0.4.4 \
crate://crates.io/rustc-demangle/0.1.5 \
crate://crates.io/rustc-serialize/0.3.24 \
crate://crates.io/same-file/0.1.3 \
crate://crates.io/scoped-tls/0.1.0 \
crate://crates.io/scopeguard/0.1.2 \
crate://crates.io/scopeguard/0.3.3 \
crate://crates.io/selectors/0.18.0 \
crate://crates.io/semver-parser/0.7.0 \
crate://crates.io/semver/0.6.0 \
crate://crates.io/semver/0.8.0 \
crate://crates.io/serde/1.0.25 \
crate://crates.io/serde_derive/1.0.25 \
crate://crates.io/serde_derive_internals/0.18.1 \
crate://crates.io/serde_ignored/0.0.4 \
crate://crates.io/serde_json/1.0.8 \
crate://crates.io/shared_child/0.2.1 \
crate://crates.io/shell-escape/0.1.3 \
crate://crates.io/siphasher/0.2.2 \
crate://crates.io/smallvec/0.3.3 \
crate://crates.io/smallvec/0.6.0 \
crate://crates.io/socket2/0.2.4 \
crate://crates.io/stable_deref_trait/1.0.0 \
crate://crates.io/string_cache/0.6.2 \
crate://crates.io/string_cache_codegen/0.4.0 \
crate://crates.io/string_cache_shared/0.3.0 \
crate://crates.io/strsim/0.6.0 \
crate://crates.io/syn/0.11.11 \
crate://crates.io/synom/0.11.3 \
crate://crates.io/synstructure/0.6.1 \
crate://crates.io/syntex_errors/0.52.0 \
crate://crates.io/syntex_pos/0.52.0 \
crate://crates.io/syntex_syntax/0.52.0 \
crate://crates.io/tar/0.4.14 \
crate://crates.io/tempdir/0.3.5 \
crate://crates.io/tendril/0.4.0 \
crate://crates.io/term/0.4.6 \
crate://crates.io/termcolor/0.3.3 \
crate://crates.io/termion/1.5.1 \
crate://crates.io/textwrap/0.9.0 \
crate://crates.io/thread-id/2.0.0 \
crate://crates.io/thread_local/0.2.7 \
crate://crates.io/thread_local/0.3.5 \
crate://crates.io/time/0.1.39 \
crate://crates.io/toml/0.2.1 \
crate://crates.io/toml/0.4.5 \
crate://crates.io/unicode-bidi/0.3.4 \
crate://crates.io/unicode-normalization/0.1.5 \
crate://crates.io/unicode-segmentation/1.2.0 \
crate://crates.io/unicode-width/0.1.4 \
crate://crates.io/unicode-xid/0.0.3 \
crate://crates.io/unicode-xid/0.0.4 \
crate://crates.io/unreachable/0.1.1 \
crate://crates.io/unreachable/1.0.0 \
crate://crates.io/url/1.6.0 \
crate://crates.io/url_serde/0.2.0 \
crate://crates.io/userenv-sys/0.2.0 \
crate://crates.io/utf-8/0.7.1 \
crate://crates.io/utf8-ranges/0.1.3 \
crate://crates.io/utf8-ranges/1.0.0 \
crate://crates.io/vcpkg/0.2.2 \
crate://crates.io/vec_map/0.8.0 \
crate://crates.io/void/1.0.2 \
crate://crates.io/walkdir/1.0.7 \
crate://crates.io/winapi-build/0.1.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.2.8 \
crate://crates.io/winapi/0.3.4 \
crate://crates.io/wincolor/0.1.4 \
crate://crates.io/ws2_32-sys/0.2.1 \
crate://crates.io/xattr/0.1.11 \
crate://crates.io/xz2/0.1.3 \
crate://crates.io/yaml-rust/0.3.5 \
"

View File

@@ -0,0 +1,4 @@
require rust-cross.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc

View File

@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
inherit cmake pythonnative
EXTRA_OECMAKE = " \
-DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC' \
-DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;Mips' \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
@@ -35,10 +35,6 @@ do_compile_prepend_class-target() {
sed -i 's:/lib\>:/${baselib}:g' ${S}/tools/llvm-config/llvm-config.cpp
}
do_compile() {
oe_runmake
}
do_install_append_class-target() {
# Disable checks on the native tools, since these should came from the native recipe
sed -i -e 's/\(.*APPEND.*_IMPORT_CHECK_FILES_FOR_.*{_IMPORT_PREFIX}\/bin\/.*\)/#\1/' ${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake

View File

@@ -0,0 +1,16 @@
require rust-source-${PV}.inc
require rust-llvm.inc
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=e825e017edc35cfd58e26116e5251771"
do_install_prepend () {
# the install does a sed on this without installing the file
# we don't need it for anything
mkdir -p "${D}/usr/share/llvm/cmake"
touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
}
do_install_append () {
# we don't need any of this stuff to build Rust
rm -rf "${D}/usr/lib/cmake"
}

View File

@@ -0,0 +1,26 @@
# Specifics for Rust 1.24.0
## This is information on the rust-snapshot (binary) used to build our current release.
## snapshot info is taken from rust/src/stage0.txt
## TODO: find a way to add additional SRC_URIs based on the contents of an
## earlier SRC_URI.
RS_VERSION = "1.23.0"
RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${RUST_BUILD_SYS}"
RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_SYS}"
CARGO_VERSION = "0.24.0"
CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${RUST_BUILD_SYS}"
SRC_URI += " \
https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot;subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot;subdir=rust-snapshot-components \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot;subdir=rust-snapshot-components \
"
# These are x86_64-unknown-linux-gnu hashes, how can we add more?
SRC_URI[rustc-snapshot.md5sum] = "068fc6566772c4ce165cc547151f514c"
SRC_URI[rustc-snapshot.sha256sum] = "27b124fd0d94c082978ff81e45f7b7c37e91d64714587829bf828d64d76524ee"
SRC_URI[rust-std-snapshot.md5sum] = "f9f89caf41e3f9c092118272ceb5bf6b"
SRC_URI[rust-std-snapshot.sha256sum] = "83c7351bdc4326caf785c208cff86682825dad4a89ccee705fa05f55ce7bd25b"
SRC_URI[cargo-snapshot.md5sum] = "830041cfc8627d3f7187954993449cf9"
SRC_URI[cargo-snapshot.sha256sum] = "ff8a454104aba20426ea898ed7515ec5da7de07d11733cdda17462455beb76e8"

View File

@@ -0,0 +1,18 @@
# Specifics for Rust 1.24.1
SRC_URI += " \
https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \
"
SRC_URI[md5sum] = "50639bf359e658fcd713787d5898628d"
SRC_URI[sha256sum] = "3ea53d45e8d2e9a41afb3340cf54b9745f845b552d802d607707cf04450761ef"
SRC_URI[rust.md5sum] = "50639bf359e658fcd713787d5898628d"
SRC_URI[rust.sha256sum] = "3ea53d45e8d2e9a41afb3340cf54b9745f845b552d802d607707cf04450761ef"
# later versions of rust change the directory that they unextract to
RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
# set this as our default
S = "${RUSTSRC}"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=c709a09d1b062d9a908e3631c1e1cdf5"

View File

@@ -33,7 +33,7 @@ def llvm_features_from_tune(d):
f = []
feat = d.getVar('TUNE_FEATURES')
if not feat:
return ""
return []
feat = frozenset(feat.split())
if 'vfpv4' in feat:
@@ -52,6 +52,12 @@ def llvm_features_from_tune(d):
if 'aarch64' in feat:
f.append("+v8")
if 'mips32' in feat:
f.append("+mips32")
if 'mips32r2' in feat:
f.append("+mips32r2")
v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve'])
if not feat.isdisjoint(v7):
f.append("+v7")
@@ -77,12 +83,7 @@ def llvm_features_from_tune(d):
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)
return f
# TARGET_CC_ARCH changes from build/cross/target so it'll do the right thing
# this should go away when https://github.com/rust-lang/rust/pull/31709 is
@@ -91,7 +92,7 @@ def llvm_features_from_cc_arch(d):
f = []
feat = d.getVar('TARGET_CC_ARCH')
if not feat:
return ""
return []
feat = frozenset(feat.split())
if '-mmmx' in feat:
@@ -115,13 +116,26 @@ def llvm_features_from_cc_arch(d):
if '-mavx2' in feat:
f.append("+avx2")
return ','.join(f)
return f
def llvm_features_from_target_fpu(d):
# TARGET_FPU can be hard or soft. +soft-float tell llvm to use soft float
# ABI. There is no option for hard.
fpu = d.getVar('TARGET_FPU', True)
return ["+soft-float"] if fpu == "soft" else []
def llvm_features(d):
return ','.join(llvm_features_from_tune(d) +
llvm_features_from_cc_arch(d) +
llvm_features_from_target_fpu(d))
## arm-unknown-linux-gnueabihf
DATA_LAYOUT[arm] = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
LLVM_TARGET[arm] = "${RUST_TARGET_SYS}"
TARGET_ENDIAN[arm] = "little"
TARGET_POINTER_WIDTH[arm] = "32"
TARGET_C_INT_WIDTH[arm] = "32"
MAX_ATOMIC_WIDTH[arm] = "64"
FEATURES[arm] = "+v6,+vfp2"
@@ -130,6 +144,7 @@ DATA_LAYOUT[aarch64] = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu"
TARGET_ENDIAN[aarch64] = "little"
TARGET_POINTER_WIDTH[aarch64] = "64"
TARGET_C_INT_WIDTH[aarch64] = "64"
MAX_ATOMIC_WIDTH[aarch64] = "128"
## x86_64-unknown-linux-gnu
@@ -137,6 +152,7 @@ DATA_LAYOUT[x86_64] = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
LLVM_TARGET[x86_64] = "x86_64-unknown-linux-gnu"
TARGET_ENDIAN[x86_64] = "little"
TARGET_POINTER_WIDTH[x86_64] = "64"
TARGET_C_INT_WIDTH[x86_64] = "64"
MAX_ATOMIC_WIDTH[x86_64] = "64"
## i686-unknown-linux-gnu
@@ -144,6 +160,7 @@ DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
LLVM_TARGET[i686] = "i686-unknown-linux-gnu"
TARGET_ENDIAN[i686] = "little"
TARGET_POINTER_WIDTH[i686] = "32"
TARGET_C_INT_WIDTH[i686] = "32"
MAX_ATOMIC_WIDTH[i686] = "64"
## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above
@@ -151,8 +168,25 @@ DATA_LAYOUT[i586] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
LLVM_TARGET[i586] = "i586-unknown-linux-gnu"
TARGET_ENDIAN[i586] = "little"
TARGET_POINTER_WIDTH[i586] = "32"
TARGET_C_INT_WIDTH[i586] = "32"
MAX_ATOMIC_WIDTH[i586] = "64"
## mips-unknown-linux-gnu
DATA_LAYOUT[mips] = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
LLVM_TARGET[mips] = "${RUST_TARGET_SYS}"
TARGET_ENDIAN[mips] = "big"
TARGET_POINTER_WIDTH[mips] = "32"
TARGET_C_INT_WIDTH[mips] = "32"
MAX_ATOMIC_WIDTH[mips] = "32"
## mipsel-unknown-linux-gnu
DATA_LAYOUT[mipsel] = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
LLVM_TARGET[mipsel] = "${RUST_TARGET_SYS}"
TARGET_ENDIAN[mipsel] = "little"
TARGET_POINTER_WIDTH[mipsel] = "32"
TARGET_C_INT_WIDTH[mipsel] = "32"
MAX_ATOMIC_WIDTH[mipsel] = "32"
def arch_for(d, thing):
return d.getVar('{}_ARCH'.format(thing))
@@ -167,6 +201,8 @@ def prefix_for(d, thing):
def arch_to_rust_target_arch(arch):
if arch == "i586" or arch == "i686":
return "x86"
elif arch == "mipsel":
return "mips"
else:
return arch
@@ -182,17 +218,26 @@ def llvm_cpu(d):
trans['i686'] = "i686"
trans['i586'] = "i586"
if target in ["mips", "mipsel"]:
feat = frozenset(d.getVar('TUNE_FEATURES').split())
if "mips32r2" in feat:
trans['mipsel'] = "mips32r2"
trans['mips'] = "mips32r2"
elif "mips32" in feat:
trans['mipsel'] = "mips32"
trans['mips'] = "mips32"
try:
return trans[cpu]
except:
return trans.get(target, "generic")
TARGET_LLVM_CPU="${@llvm_cpu(d)}"
TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)} ${@llvm_features_from_cc_arch(d)}"
TARGET_LLVM_FEATURES = "${@llvm_features(d)}"
# class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real
# (original) target.
TARGET_LLVM_FEATURES_class-native = "${@llvm_features_from_cc_arch(d)}"
TARGET_LLVM_FEATURES_class-native = "${@','.join(llvm_features_from_cc_arch(d))}"
def rust_gen_target(d, thing, wd):
import json
@@ -215,6 +260,7 @@ def rust_gen_target(d, thing, wd):
tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch)
tspec['max-atomic-width'] = d.getVarFlag('MAX_ATOMIC_WIDTH', arch)
tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch)
tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch)
tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch)
tspec['arch'] = arch_to_rust_target_arch(arch)
tspec['os'] = "linux"
@@ -233,6 +279,7 @@ def rust_gen_target(d, thing, wd):
tspec['has-rpath'] = True
tspec['has-elf-tls'] = True
tspec['position-independent-executables'] = True
tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
# Don't use jemalloc as it doesn't work for many targets.
# https://github.com/rust-lang/rust/pull/37392
@@ -267,7 +314,7 @@ do_rust_setup_snapshot () {
# Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo
# and fail without it there.
mkdir -p ${RUSTSRC}/build/${BUILD_SYS}
ln -s ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0
ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0
}
addtask rust_setup_snapshot after do_unpack before do_configure
do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"

View File

@@ -2,6 +2,9 @@ require rust.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc
SRC_URI += "file://rust-${PV}/0001-librustc-always-allow-unstable-options.patch"
SRC_URI += "file://rust-${PV}/0001-Don-t-use-remapped-path-when-loading-modules-and-inc.patch"
# These are extracted from rustc/src/bootstrap/Cargo.toml via cargo-bitbake
SRC_URI += " \
crate://crates.io/advapi32-sys/0.2.0 \

View File

@@ -0,0 +1,241 @@
require rust.inc
require rust-source-${PV}.inc
require rust-snapshot-${PV}.inc
SRC_URI += "file://rust-${PV}/0001-librustc-always-allow-unstable-options.patch"
# These are extracted from rustc/src/bootstrap/Cargo.toml via cargo-bitbake
SRC_URI += " \
crate://crates.io/advapi32-sys/0.2.0 \
crate://crates.io/aho-corasick/0.5.3 \
crate://crates.io/aho-corasick/0.6.4 \
crate://crates.io/ansi_term/0.10.2 \
crate://crates.io/ar/0.3.1 \
crate://crates.io/atty/0.2.3 \
crate://crates.io/backtrace-sys/0.1.16 \
crate://crates.io/backtrace/0.3.4 \
crate://crates.io/bitflags/0.7.0 \
crate://crates.io/bitflags/0.9.1 \
crate://crates.io/bitflags/1.0.1 \
crate://crates.io/bufstream/0.1.3 \
crate://crates.io/byteorder/1.2.1 \
crate://crates.io/cargo_metadata/0.2.3 \
crate://crates.io/cargo_metadata/0.4.0 \
crate://crates.io/cc/1.0.3 \
crate://crates.io/cfg-if/0.1.2 \
crate://crates.io/clap/2.29.0 \
crate://crates.io/cmake/0.1.29 \
crate://crates.io/coco/0.1.1 \
crate://crates.io/commoncrypto-sys/0.2.0 \
crate://crates.io/commoncrypto/0.2.0 \
crate://crates.io/compiletest_rs/0.3.3 \
crate://crates.io/core-foundation-sys/0.4.6 \
crate://crates.io/core-foundation/0.4.6 \
crate://crates.io/crossbeam/0.2.10 \
crate://crates.io/crossbeam/0.3.0 \
crate://crates.io/crypto-hash/0.3.0 \
crate://crates.io/cssparser-macros/0.3.0 \
crate://crates.io/cssparser/0.13.7 \
crate://crates.io/curl-sys/0.3.15 \
crate://crates.io/curl/0.4.8 \
crate://crates.io/dbghelp-sys/0.2.0 \
crate://crates.io/debug_unreachable/0.1.1 \
crate://crates.io/derive-new/0.5.0 \
crate://crates.io/diff/0.1.11 \
crate://crates.io/docopt/0.8.1 \
crate://crates.io/dtoa/0.4.2 \
crate://crates.io/duct/0.8.2 \
crate://crates.io/either/1.4.0 \
crate://crates.io/endian-type/0.1.2 \
crate://crates.io/enum_primitive/0.1.1 \
crate://crates.io/env_logger/0.3.5 \
crate://crates.io/env_logger/0.4.3 \
crate://crates.io/error-chain/0.11.0 \
crate://crates.io/error-chain/0.8.1 \
crate://crates.io/failure/0.1.1 \
crate://crates.io/failure_derive/0.1.1 \
crate://crates.io/filetime/0.1.14 \
crate://crates.io/flate2/1.0.1 \
crate://crates.io/fnv/1.0.6 \
crate://crates.io/foreign-types-shared/0.1.1 \
crate://crates.io/foreign-types/0.3.2 \
crate://crates.io/fs2/0.4.2 \
crate://crates.io/fuchsia-zircon-sys/0.3.2 \
crate://crates.io/fuchsia-zircon/0.3.2 \
crate://crates.io/futf/0.1.3 \
crate://crates.io/futures/0.1.17 \
crate://crates.io/getopts/0.2.15 \
crate://crates.io/git2-curl/0.7.0 \
crate://crates.io/git2/0.6.10 \
crate://crates.io/glob/0.2.11 \
crate://crates.io/globset/0.2.1 \
crate://crates.io/hamcrest/0.1.1 \
crate://crates.io/handlebars/0.29.1 \
crate://crates.io/hex/0.2.0 \
crate://crates.io/home/0.3.0 \
crate://crates.io/html-diff/0.0.5 \
crate://crates.io/html5ever/0.20.0 \
crate://crates.io/idna/0.1.4 \
crate://crates.io/if_chain/0.1.2 \
crate://crates.io/ignore/0.2.2 \
crate://crates.io/itertools/0.6.5 \
crate://crates.io/itoa/0.3.4 \
crate://crates.io/jobserver/0.1.8 \
crate://crates.io/json/0.11.12 \
crate://crates.io/jsonrpc-core/8.0.1 \
crate://crates.io/kernel32-sys/0.2.2 \
crate://crates.io/kuchiki/0.6.0 \
crate://crates.io/languageserver-types/0.16.0 \
crate://crates.io/lazy_static/0.2.11 \
crate://crates.io/lazy_static/1.0.0 \
crate://crates.io/lazycell/0.5.1 \
crate://crates.io/libc/0.2.34 \
crate://crates.io/libgit2-sys/0.6.18 \
crate://crates.io/libssh2-sys/0.2.6 \
crate://crates.io/libz-sys/1.0.18 \
crate://crates.io/log/0.3.9 \
crate://crates.io/log/0.4.1 \
crate://crates.io/log_settings/0.1.1 \
crate://crates.io/lzma-sys/0.1.9 \
crate://crates.io/mac/0.1.1 \
crate://crates.io/markup5ever/0.5.0 \
crate://crates.io/matches/0.1.6 \
crate://crates.io/mdbook/0.0.26 \
crate://crates.io/memchr/0.1.11 \
crate://crates.io/memchr/1.0.2 \
crate://crates.io/memchr/2.0.1 \
crate://crates.io/miniz-sys/0.1.10 \
crate://crates.io/miow/0.2.1 \
crate://crates.io/net2/0.2.31 \
crate://crates.io/nibble_vec/0.0.3 \
crate://crates.io/nix/0.8.1 \
crate://crates.io/num-bigint/0.1.41 \
crate://crates.io/num-complex/0.1.41 \
crate://crates.io/num-integer/0.1.35 \
crate://crates.io/num-iter/0.1.34 \
crate://crates.io/num-rational/0.1.40 \
crate://crates.io/num-traits/0.1.41 \
crate://crates.io/num/0.1.41 \
crate://crates.io/num_cpus/1.7.0 \
crate://crates.io/open/1.2.1 \
crate://crates.io/openssl-probe/0.1.2 \
crate://crates.io/openssl-sys/0.9.23 \
crate://crates.io/openssl/0.9.23 \
crate://crates.io/os_pipe/0.5.1 \
crate://crates.io/owning_ref/0.3.3 \
crate://crates.io/parking_lot/0.5.3 \
crate://crates.io/parking_lot_core/0.2.9 \
crate://crates.io/percent-encoding/1.0.1 \
crate://crates.io/pest/0.3.3 \
crate://crates.io/phf/0.7.21 \
crate://crates.io/phf_codegen/0.7.21 \
crate://crates.io/phf_generator/0.7.21 \
crate://crates.io/phf_shared/0.7.21 \
crate://crates.io/pkg-config/0.3.9 \
crate://crates.io/precomputed-hash/0.1.1 \
crate://crates.io/procedural-masquerade/0.1.5 \
crate://crates.io/psapi-sys/0.1.1 \
crate://crates.io/pulldown-cmark/0.0.15 \
crate://crates.io/pulldown-cmark/0.1.0 \
crate://crates.io/quick-error/1.2.1 \
crate://crates.io/quine-mc_cluskey/0.2.4 \
crate://crates.io/quote/0.3.15 \
crate://crates.io/racer/2.0.12 \
crate://crates.io/radix_trie/0.1.2 \
crate://crates.io/rand/0.3.19 \
crate://crates.io/rayon-core/1.3.0 \
crate://crates.io/rayon/0.9.0 \
crate://crates.io/redox_syscall/0.1.32 \
crate://crates.io/redox_termios/0.1.1 \
crate://crates.io/regex-syntax/0.3.9 \
crate://crates.io/regex-syntax/0.4.1 \
crate://crates.io/regex/0.1.80 \
crate://crates.io/regex/0.2.3 \
crate://crates.io/rls-analysis/0.10.0 \
crate://crates.io/rls-data/0.14.0 \
crate://crates.io/rls-rustc/0.1.1 \
crate://crates.io/rls-span/0.4.0 \
crate://crates.io/rls-vfs/0.4.4 \
crate://crates.io/rustc-demangle/0.1.5 \
crate://crates.io/rustc-serialize/0.3.24 \
crate://crates.io/same-file/0.1.3 \
crate://crates.io/scoped-tls/0.1.0 \
crate://crates.io/scopeguard/0.1.2 \
crate://crates.io/scopeguard/0.3.3 \
crate://crates.io/selectors/0.18.0 \
crate://crates.io/semver-parser/0.7.0 \
crate://crates.io/semver/0.6.0 \
crate://crates.io/semver/0.8.0 \
crate://crates.io/serde/1.0.25 \
crate://crates.io/serde_derive/1.0.25 \
crate://crates.io/serde_derive_internals/0.18.1 \
crate://crates.io/serde_ignored/0.0.4 \
crate://crates.io/serde_json/1.0.8 \
crate://crates.io/shared_child/0.2.1 \
crate://crates.io/shell-escape/0.1.3 \
crate://crates.io/siphasher/0.2.2 \
crate://crates.io/smallvec/0.3.3 \
crate://crates.io/smallvec/0.6.0 \
crate://crates.io/socket2/0.2.4 \
crate://crates.io/stable_deref_trait/1.0.0 \
crate://crates.io/string_cache/0.6.2 \
crate://crates.io/string_cache_codegen/0.4.0 \
crate://crates.io/string_cache_shared/0.3.0 \
crate://crates.io/strsim/0.6.0 \
crate://crates.io/syn/0.11.11 \
crate://crates.io/synom/0.11.3 \
crate://crates.io/synstructure/0.6.1 \
crate://crates.io/syntex_errors/0.52.0 \
crate://crates.io/syntex_pos/0.52.0 \
crate://crates.io/syntex_syntax/0.52.0 \
crate://crates.io/tar/0.4.14 \
crate://crates.io/tempdir/0.3.5 \
crate://crates.io/tendril/0.4.0 \
crate://crates.io/term/0.4.6 \
crate://crates.io/termcolor/0.3.3 \
crate://crates.io/termion/1.5.1 \
crate://crates.io/textwrap/0.9.0 \
crate://crates.io/thread-id/2.0.0 \
crate://crates.io/thread_local/0.2.7 \
crate://crates.io/thread_local/0.3.5 \
crate://crates.io/time/0.1.39 \
crate://crates.io/toml/0.2.1 \
crate://crates.io/toml/0.4.5 \
crate://crates.io/unicode-bidi/0.3.4 \
crate://crates.io/unicode-normalization/0.1.5 \
crate://crates.io/unicode-segmentation/1.2.0 \
crate://crates.io/unicode-width/0.1.4 \
crate://crates.io/unicode-xid/0.0.3 \
crate://crates.io/unicode-xid/0.0.4 \
crate://crates.io/unreachable/0.1.1 \
crate://crates.io/unreachable/1.0.0 \
crate://crates.io/url/1.6.0 \
crate://crates.io/url_serde/0.2.0 \
crate://crates.io/userenv-sys/0.2.0 \
crate://crates.io/utf-8/0.7.1 \
crate://crates.io/utf8-ranges/0.1.3 \
crate://crates.io/utf8-ranges/1.0.0 \
crate://crates.io/vcpkg/0.2.2 \
crate://crates.io/vec_map/0.8.0 \
crate://crates.io/void/1.0.2 \
crate://crates.io/walkdir/1.0.7 \
crate://crates.io/winapi-build/0.1.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.2.8 \
crate://crates.io/winapi/0.3.4 \
crate://crates.io/wincolor/0.1.4 \
crate://crates.io/ws2_32-sys/0.2.1 \
crate://crates.io/xattr/0.1.11 \
crate://crates.io/xz2/0.1.3 \
crate://crates.io/yaml-rust/0.3.5 \
"
DEPENDS += "rust-llvm (=${PV})"
# 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"