65 Commits
pyro ... jethro

Author SHA1 Message Date
Doug Goldstein
343ac47093 rust: strip whitespace from features
This whitespace in here causes rust to not be happy with the features
and throw warnings about a feature such as ' +sse3' being unsupported
when '+sse3' works just fine. Amazingly will cause rustc to abort when
you try to resolve the features to valid configs with the `--print` arg
to rustc.

(cherry picked from commit ce9949725c)
2016-11-08 19:52:32 -06:00
Derek Straka
2198573547 Merge pull request #100 from cardoe/jethro-ci
Jenkins CI
2016-11-01 15:16:26 -04:00
Doug Goldstein
4e5679c303 change Yocto version to jethro 2016-11-01 08:57:02 -05:00
Derek Straka
e8acf1decf add Jenkinsfile to test each PR and branch commits
This includes a basic test that attempts to compile the rustfmt crate.
Ensures that the workspace is always removed at the end of the build. It
utilizes available caches to speed up the build process and parallelizes
the build across i386, x86_64, arm32, and arm64 targets.

Signed-off-by: Derek Straka <derek@asterius.io>
2016-10-31 16:00:11 -05:00
Doug Goldstein
4622bd49e9 rustfmt: an example cargo build package
rustfmt is a Rust package to format Rust code. This package is being
used as an example of building a crate in Yocto with Cargo.
2016-10-31 16:00:06 -05:00
Doug Goldstein
67e3b023a0 add a basic build script for testing
This script can be extended in the future but it uses the containerize
script to ensure we run inside of a working build environment. This
script can be extended to build additional targets for testing.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-31 08:18:11 -05:00
Doug Goldstein
c9dfcf055c add Yocto config files so we can build
So that we can use the meta-rust layer as the final layer with some
configuration (for the purposes of testing). These configs should be not
used by actual end users.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-31 08:17:58 -05:00
Doug Goldstein
b33f5bfdf7 helper script to fetch down dependent layers
meta-rust has some layers it depends on and this script ensures it
fetches them down appropriately so that the poky directory can be used
as the source.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-31 08:17:29 -05:00
Doug Goldstein
7e161e4c0f containerize script for a Yocto build env
The containerize script fetches down a Docker container and wires up the
current directory inside so that you can use a known good environment
for compiling Yocto that has all the dependencies.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-10-31 08:17:11 -05:00
Doug Goldstein
04bfaa151a update case of OpenEmbedded to match upstream
(cherry picked from commit 3b954b38d1)
2016-10-03 08:19:49 -05:00
Cody Schafer
ff7c0827e4 Update README.md
Fixes #55
2016-07-12 09:38:51 -05:00
Doug Goldstein
8dbe667294 libgit2: add a dependency on openssl
If this dependency is missing its possible that openssl won't be built
before libgit2 is built and then we won't have git support over SSL
which leaves out a lot of git repos.
2016-07-12 09:30:09 -05:00
Doug Goldstein
26d862715a Merge pull request #16 from starlab-io/fix-urandom
Fix urandom initialization issues
2016-04-22 10:25:29 -05:00
Derek Straka
f861211e50 rust: remove the symlinks and libs installed directly into libdir (#17)
Signed-off-by: Derek Straka <derek@asterius.io>
2016-04-22 10:25:06 -05:00
Derek Straka
7ef44e8ad8 rust: add a temp fix to use /dev/urandom
Signed-off-by: Derek Straka <derek@asterius.io>
2016-04-18 14:34:42 -04:00
Derek Straka
5eec138324 Merge pull request #13 from starlab-io/fix-rust-build
Fix rust build fox x86 targets
2016-04-11 11:56:41 -04:00
Doug Goldstein
248c0afe62 rust: set our release channel appropriately
We're always building a stable release so we should be setting our
release channel appropriately.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-10 22:56:22 -05:00
Doug Goldstein
07f672a0c3 rust: remove --enable-debuginfo
Without this we cannot set 'eliminate-frame-pointer' in our target spec.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-10 22:54:03 -05:00
Doug Goldstein
42df692ce6 rust: update to the proper snapshot
Rust 1.7.0 uses a snapshot from 2015-12-18 and not 2015-08-11. Without
this change Rust will fetch the snapshot during the build process which
will fail on Yocto builds that disable network outside of the fetch
phase.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-10 22:54:02 -05:00
Doug Goldstein
83ba5f85f4 rust: add missing 'ar' to target spec
We need to make sure we're using the cross compiling ar instead of the
system one.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-10 22:54:02 -05:00
Doug Goldstein
73e05f4b26 rust: add support for x86 features
The existing feature parsing is specific to ARM so we need to add
support for x86. This is a little more generic since the variable we
parse is changed if we're building for the host, cross or actual target.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-10 22:54:02 -05:00
Doug Goldstein
4ed32e53f2 rust: generate an appropriate cpu for targets
This generates an appropriate CPU value for the targets. For ARM it
leaves the default of 'generic' since we build up all the different CPU
differences in the 'features' field but for x86/x86_64 we need to pass
an appropriate CPU value.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-07 09:31:59 -05:00
Doug Goldstein
71ac5fa78e rust: fix target generation add 'has-elf-tls'
This field defaults to false but for all of our targets it should be
true.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-07 08:47:38 -05:00
Doug Goldstein
7ebb23fad9 rust: fix target generation add 'env'
This field defaults to the empty string but for all of our targets it
should be set to GNU.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-07 08:47:18 -05:00
Doug Goldstein
45fefb3296 rust: use Python JSON instead of string handling
The code previously wrote out a JSON file but used basic string handling
instead of the Python JSON library. Its cleaner to use the Python JSON
library.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 15:50:21 -05:00
Doug Goldstein
1a4261c21a rust: drop duplicate variable assignment
prefix_for() and the deleted line are identical.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 14:00:08 -05:00
Doug Goldstein
37328c61c8 rust: use rust-installer's way of disabling ldconfig
Instead of patching in a disable ldconfig argument, just use the way
exposed by the rust-installer scripts to disable running ldconfig.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 13:24:35 -05:00
Doug Goldstein
f0b315d769 rust: fix bad line in patch
This needs to be properly escaped.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 13:24:35 -05:00
Doug Goldstein
218774055f rust: drop adding --enable-new-dtags
--enable-new-dtags is the default since Rust 1.7.0 due to
rust-lang/rust#30378.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 13:24:34 -05:00
Doug Goldstein
edd628c138 rust: drop unnecessary data layout targets
Since Rust 1.3.0
(rust-lang/rust@958d563825) it has been
unnecessary to provide the data layout in targets. Additionally the data
layouts in this repo created LLVM IR on x86_64 that was differing from
other x86_64 builds of Rust.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-06 13:24:33 -05:00
Derek Straka
b9a5ea1a82 Merge pull request #12 from starlab-io/duplication
De-duplication
2016-04-05 11:47:59 -04:00
Doug Goldstein
43aa07a88a rust-llvm: combine do_install_append()
There were two different do_install_append()'s and they didn't check for
errors so this improves that situation.
2016-04-04 16:28:50 -05:00
Doug Goldstein
7585581323 rust-llvm: drop duplicate configure flags
Some of the configure flags are specified multiple times.
2016-04-04 16:16:36 -05:00
Derek Straka
76415fa401 Merge pull request #11 from starlab-io/drop-old-workaround
cargo.bbclass: drop old work around
2016-04-04 12:47:44 -04:00
Doug Goldstein
04cad7a074 cargo.bbclass: drop old work around
This work around was for an old version of cargo that we no longer use.
Newer versions resolve this issue.
2016-03-29 21:40:04 -05:00
Doug Goldstein
4e5fe4f76c Merge pull request #10 from starlab-io/rust_1.7.0
Update rust to version 1.7.0
2016-03-18 14:33:28 -05:00
Derek Straka
fd787ed29e Update the post link flags to include libssp
Signed-off-by: Derek Straka <derek@asterius.io>
2016-03-17 16:28:04 -04:00
Derek Straka
f10ded65c3 Rebase patches for rust version 1.7.0
Signed-off-by: Derek Straka <derek@asterius.io>
2016-03-17 08:28:53 -04:00
Derek Straka
f5a77f1c41 Update rust sources to version 1.7.0
Signed-off-by: Derek Straka <derek@asterius.io>
2016-03-17 08:28:14 -04:00
Derek Straka
948e0fdd5f Remove patch that is no longer required in rust 1.7.0
Signed-off-by: Derek Straka <derek@asterius.io>
2016-03-17 08:27:24 -04:00
Derek Straka
8413216f8c Update cargo to 0.9.0
Signed-off-by: Derek Straka <derek@asterius.io>
2016-03-17 08:23:18 -04:00
Doug Goldstein
1093e6ade6 Merge pull request #9 from starlab-io/merge-upstream
Merge upstream changes into jethro
2016-02-24 08:28:07 -06:00
Derek Straka
961e5935bb 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
2016-02-22 13:18:47 -05:00
Jonathan Creekmore
c132b336bd Merge pull request #8 from starlab-io/add-64-bit-support
Add 64 bit support for ARM
2016-02-03 13:57:10 -06:00
Tyler Hall
d5c83f28bf rust: aarch64 support 2016-02-02 20:13:46 -05:00
Tyler Hall
bfb747de96 rustlib: libdir may be different between build and host
With multilib, we may want to install under lib64 but the rust libraries
get published in the build sysroot under the libdir for the build
machine which is usually just lib. Support these being different.
2016-02-02 20:13:17 -05:00
Doug Goldstein
49ea508249 Merge pull request #7 from starlab-io/arm-strip-fix
rust: inhibit stripping for cross compiler to avoid errors
2016-02-02 17:09:50 -06:00
Cody P Schafer
5a933d0f08 rust: inhibit stripping for cross compiler to avoid errors 2016-02-02 18:07:30 -05:00
Doug Goldstein
67d821913e rust-llvm: fix linking issues
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-01-21 21:36:50 -06:00
Jonathan Creekmore
3a3381b8d0 Merge pull request #5 from starlab-io/cleanup
drop older versions and rename to recipes-devtools
2015-12-11 15:25:10 -06:00
Doug Goldstein
9a1f1aad8d move recipes/{rust,cargo} to recipes-devtools
This better matches where upstream puts compilers and development
utilities.
2015-12-11 00:43:18 -06:00
Doug Goldstein
0653dc1572 remove Rust 1.2.0 2015-12-11 00:41:23 -06:00
Doug Goldstein
be7e8c8ee6 remove Rust 1.1.0 2015-12-11 00:40:35 -06:00
Jonathan Creekmore
344a19bafb Merge pull request #4 from starlab-io/fix-cross-build
Fix security flags for rust-cross
2015-11-17 10:14:52 -06:00
Doug Goldstein
640b962181 Fix security flags for rust-cross 2015-11-17 10:09:12 -06:00
Jonathan Creekmore
d19f3cb6cf Merge pull request #3 from starlab-io/misc-updates
Move license files and update debug message
2015-11-17 09:56:26 -06:00
Doug Goldstein
a526e7a435 move licenses to top level 2015-11-17 09:23:22 -06:00
Doug Goldstein
6ae148d342 cargo.bbclass: update debug message
Hopefully this makes a bit more clear when you see this outputted.
2015-11-16 15:34:44 -06:00
Doug Goldstein
ff13d3319d Merge pull request #2 from starlab-io/fix_sstate_cargo
Updates to rust build recipes
2015-11-16 11:31:26 -06:00
Derek Straka
a018f9586b Add no PIE to rust-llvm 2015-11-15 07:44:29 -06:00
Derek Straka
3406a2920c Update PR number and pack sstate correctly 2015-11-15 07:44:03 -06:00
Doug Goldstein
559214fceb Merge pull request #1 from starlab-io/update-cargo-native
Use the pre-packaged version of cargo for the native packager.

While this is not how we really want to do things, this does let us move forward for right now.
2015-11-13 08:42:02 -06:00
Derek Straka
8702fd31f7 Use the pre-packaged version of cargo for the native packager 2015-11-12 17:40:14 -06:00
Doug Goldstein
1280c29fa7 Merge branch 'security-flags' into fido 2015-11-10 07:48:04 -06:00
Doug Goldstein
2f703c9f1f fix LICENSE_PATH location
The path in LICENSE_PATH was not the correct path to where the licenses
are located in this repo.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2015-11-06 10:19:07 -06:00
34 changed files with 834 additions and 369 deletions

36
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,36 @@
def targets = [ 'qemux86', 'qemux86-64', 'qemuarm', 'qemuarm64' ]
def machine_builds = [:]
for (int i = 0; i < targets.size(); i++) {
def machine = targets.get(i)
machine_builds["$machine"] = {
node {
try {
stage('Checkout') {
checkout scm
}
stage('Setup Environment') {
sh "./scripts/setup-env.sh"
}
stage('Yocto Fetch') {
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh jethro"
}
stage('Build') {
sh "MACHINE=${machine} ./scripts/build.sh"
}
} catch (e) {
echo "Caught: ${e}"
throw e
} finally {
stage('Cleanup Environment') {
sh "./scripts/cleanup-env.sh"
deleteDir()
}
}
}
}
}
parallel machine_builds

View File

@@ -1,6 +1,6 @@
## Introduction
This openembedded layer provides the rust compiler, tools for building packages
This OpenEmbedded layer provides the rust compiler, tools for building packages
(cargo), and a few example projects.
## What works:
@@ -59,10 +59,7 @@ On the target:
Open a Pull Request.
Generally, I try to support the latest master of poky. I'm happy to support
older versions too by applying backwards compat patches as long as I don't need
to maintain a seperate branch. Of course, others are welcome to create forks to
support their individual needs.
The master branch supports the latest master of poky. When poky creates releases, we will create a branch with the same name as the poky release. This release branch should always work with that poky release. Note that these release branches will typically be less tested than the master branch.
## Copyright

View File

@@ -11,14 +11,9 @@ def cargo_base_dep(d):
BASEDEPENDS_append = " ${@cargo_base_dep(d)}"
# FIXME: this is a workaround for a misbehavior in cargo when used with quilt.
# See https://github.com/rust-lang/cargo/issues/978
PATCHTOOL = "patch"
# Cargo only supports in-tree builds at the moment
B = "${S}"
# In case something fails in the build process, give a bit more feedback on
# where the issue occured
export RUST_BACKTRACE = "1"
@@ -74,8 +69,8 @@ export CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} --release"
# change if CARGO_BUILD_FLAGS changes.
export CARGO_TARGET_SUBDIR="${HOST_SYS}/release"
oe_cargo_build () {
which cargo
which rustc
echo "cargo: $(which cargo)"
echo "rustc: $(which rustc)"
bbnote ${CARGO} build ${CARGO_BUILD_FLAGS} "$@"
"${CARGO}" build ${CARGO_BUILD_FLAGS} "$@"
}

21
conf/bblayers.conf.sample Normal file
View File

@@ -0,0 +1,21 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
##OEROOT##/meta-rust \
##OEROOT##/meta \
##OEROOT##/meta-yocto \
##OEROOT##/meta-yocto-bsp \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-openembedded/meta-ruby \
"
BBLAYERS_NON_REMOVABLE ?= " \
##OEROOT##/meta \
##OEROOT##/meta-yocto \
"

View File

@@ -8,7 +8,7 @@ BBFILE_COLLECTIONS += "rust-layer"
BBFILE_PATTERN_rust-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_rust-layer = "7"
LICENSE_PATH += "${LAYERDIR}/files/common-licenses"
LICENSE_PATH += "${LAYERDIR}/licenses"
# Override security flags
require conf/distro/include/rust_security_flags.inc

242
conf/local.conf.sample Normal file
View File

@@ -0,0 +1,242 @@
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at local.conf.extended
# which contains other examples of configuration which can be placed in this file
# but new users likely won't need any of them initially.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemuarm64"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemumips64"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# There are also the following hardware board target machines included for
# demonstration purposes:
#
#MACHINE ?= "beaglebone"
#MACHINE ?= "genericx86"
#MACHINE ?= "genericx86-64"
#MACHINE ?= "mpc8315e-rdb"
#MACHINE ?= "edgerouter"
#
# This sets the default machine to be qemux86 if no other machine is selected:
MACHINE ??= "qemux86"
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
#DL_DIR ?= "${TOPDIR}/downloads"
#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"
#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
DISTRO ?= "poky"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream
# source control systems. This is just mentioned here as an example, its not
# useful to most new users.
# DISTRO ?= "poky-bleeding"
#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
# - 'package_deb' for debian style deb files
# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
PACKAGE_CLASSES ?= "package_rpm"
#
# SDK target architecture
#
# This variable specifies the architecture to build SDK items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686 and x86_64
#SDKMACHINE ?= "i686"
#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
# "dev-pkgs" - add -dev packages for all installed packages
# (useful if you want to develop against libs in the image)
# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
# (useful if you want to run the package test suites)
# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
# "tools-debug" - add debugging tools (gdb, strace)
# "eclipse-debug" - add Eclipse remote debugging support
# "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
# "debug-tweaks" - make an image suitable for development
# e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
# - 'buildstats' collect build statistics
# - 'image-mklibs' to reduce shared library files size for an image
# - 'image-prelink' in order to prelink the filesystem image
# - 'image-swab' to perform host system intrusion detection
# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
# image-prelink disabled for now due to issues with IFUNC symbol relocation
USER_CLASSES ?= "buildstats image-mklibs"
#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. To
# enable this uncomment this line. See classes/testimage(-auto).bbclass for
# further details.
#TEST_IMAGE = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"
#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necesary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as http or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"
SSTATE_MIRRORS ?= "file://.* http://build-cache.asterius.io/sstate/PATH;downloadfilename=PATH \n"
SOURCE_MIRROR_URL ?= "http://build-cache.asterius.io/downloads/"
INHERIT += "own-mirrors rm_work"
#
# Qemu configuration
#
# By default qemu will build with a builtin VNC server where graphical output can be
# seen. The two lines below enable the SDL backend too. By default libsdl-native will
# be built, if you want to use your host's libSDL instead of the minimal libsdl built
# by libsdl-native then uncomment the ASSUME_PROVIDED line below.
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
#ASSUME_PROVIDED += "libsdl-native"
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "1"

View File

@@ -2,7 +2,7 @@ SUMMARY = "the Git linkable library"
HOMEPAGE = "http://libgit2.github.com/"
LICENSE = "GPL-2.0-with-linking-exception"
DEPENDS = "zlib"
DEPENDS = "openssl zlib"
inherit cmake

View File

@@ -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"

View File

@@ -1,27 +0,0 @@
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/9] platform.mk: avoid choking on i586
---
mk/platform.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/platform.mk b/mk/platform.mk
index 856a22d..0c90632 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -14,7 +14,9 @@
# would create a variable HOST_i686-darwin-macos with the value
# i386.
define DEF_HOST_VAR
- HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1))))
+ HOST_$(1) = $(subst i686,i386,\
+ $(subst i586,i386,\
+ $(word 1,$(subst -, ,$(1)))))
endef
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t))))
$(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t))))
--
2.4.10

View File

@@ -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:
@@ -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;
@@ -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 {
@@ -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.
@@ -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");

View File

@@ -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
@@ -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)
-else
-# 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)
-HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
-RUSTFLAGS_STAGE0 += -L $$(TROOT$(1)_T_$(2)_H_$(3))/lib
-endif
-
-else
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
-
-ifeq ($(1),0)
-HLIB_RELATIVE$(1)_H_$(3) = lib
-else
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
@@ -42,11 +54,12 @@ 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)) \
@@ -54,7 +67,7 @@ index 34f8247..896c1df 100644
$$(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)) \

View File

@@ -1,4 +1,4 @@
From 1197d6ec82df147e8bbe0d42017fe1ee75804369 Mon Sep 17 00:00:00 2001
From 93ef6b8b93c7695280aba7f3541bf8f1ae18c722 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/9] configure: support --bindir, and extend libdir to
@@ -13,20 +13,20 @@ relative to sysroot, and allows libdir to end in an arbitrary directory
Note that this assumes absolute paths start with '/', which may break
windows platforms
---
configure | 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(-)
configure | 44 ++++++++++++++++++++-----
mk/host.mk | 6 +++-
mk/main.mk | 11 +++++++
mk/perf.mk | 4 +--
mk/prepare.mk | 27 +++++++---------
src/librustc/session/filesearch.rs | 66 ++++++++++++++++----------------------
src/librustc_trans/back/link.rs | 3 +-
7 files changed, 94 insertions(+), 67 deletions(-)
diff --git a/configure b/configure
index 60d3661..01c447b 100755
index 287b7b3..7d53a66 100755
--- a/configure
+++ b/configure
@@ -334,6 +334,31 @@ enable_if_not_disabled() {
@@ -334,6 +334,32 @@ enable_if_not_disabled() {
fi
}
@@ -54,28 +54,20 @@ index 60d3661..01c447b 100755
+ result="${result}${down#/}"
+ echo "$result"
+}
+
+
to_llvm_triple() {
case $1 in
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -632,6 +657,8 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
@@ -652,18 +678,19 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
CFG_HOST=$(to_llvm_triple $CFG_HOST)
CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
+CFG_LIBDIR_RELATIVE=lib
+
# On windows we just store the libraries in the bin directory because
# there's no rpath. This is where the build system itself puts libraries;
# --libdir is used to configure the installation directory.
@@ -639,24 +666,21 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ]
then
CFG_LIBDIR_RELATIVE=bin
-else
- CFG_LIBDIR_RELATIVE=lib
fi
-valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
# On Windows this determines root of the subtree for target libraries.
# Host runtime libs always go to 'bin'.
-valopt libdir "${CFG_PREFIX}/lib" "install libraries"
+valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
-case "$CFG_LIBDIR" in
@@ -93,15 +85,9 @@ index 60d3661..01c447b 100755
+CFG_BINDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_BINDIR}")
+CFG_LIBDIR_RELATIVE=$(relpath "${CFG_PREFIX}" "${CFG_LIBDIR}")
if ( [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] ) \
- && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
- err "libdir on windows should be set to 'bin'"
+ && [ "$CFG_LIBDIR_RELATIVE" != "$CFG_BINDIR_RELATIVE" ]; then
+ err "Windows builds currently require that LIBDIR == BINDIR (we have libdir{$CFG_LIBDIR_RELATIVE} != bindir{$CFG_BINDIR_RELATIVE} )"
fi
if [ $HELP -eq 1 ]
@@ -1733,6 +1757,7 @@ putvar CFG_PREFIX
then
@@ -1760,6 +1787,7 @@ putvar CFG_PREFIX
putvar CFG_HOST
putvar CFG_TARGET
putvar CFG_LIBDIR_RELATIVE
@@ -129,10 +115,10 @@ index 59a0095..b8e8345 100644
endef
diff --git a/mk/main.mk b/mk/main.mk
index 896c1df..ab12166 100644
index 04b3e25..ba11e5e 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -345,7 +345,9 @@ export CFG_RELEASE_CHANNEL
@@ -351,7 +351,9 @@ export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT
export CFG_PREFIX
export CFG_LIBDIR
@@ -142,7 +128,7 @@ index 896c1df..ab12166 100644
export CFG_DISABLE_INJECT_STD_VERSION
ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
@@ -375,7 +377,16 @@ define SREQ
@@ -381,7 +383,16 @@ define SREQ
# Destinations of artifacts for the host compiler
HROOT$(1)_H_$(3) = $(3)/stage$(1)
@@ -156,9 +142,9 @@ index 896c1df..ab12166 100644
+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
HLIB_RELATIVE$(1)_H_$(3) = $$(CFG_LIBDIR_RELATIVE)
diff --git a/mk/perf.mk b/mk/perf.mk
index 16cbaab..f8a354c 100644
--- a/mk/perf.mk
@@ -180,46 +166,70 @@ index 16cbaab..f8a354c 100644
endif
diff --git a/mk/prepare.mk b/mk/prepare.mk
index e263a6d..45590ab 100644
index 87a4450..c358bbc 100644
--- a/mk/prepare.mk
+++ b/mk/prepare.mk
@@ -186,10 +186,10 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
@@ -90,8 +90,6 @@ PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS
# $(3) is host
# $(4) tag
define DEF_PREPARE_HOST_TOOL
-prepare-host-tool-$(1)-$(2)-$(3)-$(4): \
- PREPARE_SOURCE_BIN_DIR=$$(HBIN$(2)_H_$(3))
prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \
$$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \
$$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \
@@ -117,10 +115,8 @@ PREPARE_TAR_LIB_DIR = $(patsubst $(CFG_LIBDIR_RELATIVE)%,lib%,$(1))
# $(3) is host
# $(4) tag
define DEF_PREPARE_HOST_LIB
-prepare-host-lib-$(1)-$(2)-$(3)-$(4): \
- PREPARE_WORKING_SOURCE_LIB_DIR=$$(HLIB$(2)_H_$(3))
-prepare-host-lib-$(1)-$(2)-$(3)-$(4): \
- PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(call PREPARE_TAR_LIB_DIR,$$(HLIB_RELATIVE$(2)_H_$(3)))
+prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)
+prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)
prepare-host-lib-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \
$$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \
$$(HLIB$(2)_H_$(3))/stamp.$(1) \
@@ -138,14 +134,10 @@ endef
# $(4) tag
define DEF_PREPARE_TARGET_N
# Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets
-prepare-target-$(2)-host-$(3)-$(1)-$(4): \
- PREPARE_WORKING_SOURCE_LIB_DIR=$$(TLIB$(1)_T_$(2)_H_$(3))
-prepare-target-$(2)-host-$(3)-$(1)-$(4): \
- PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib
-prepare-target-$(2)-host-$(3)-$(1)-$(4): \
- PREPARE_SOURCE_BIN_DIR=$$(TBIN$(1)_T_$(2)_H_$(3))
-prepare-target-$(2)-host-$(3)-$(1)-$(4): \
- PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(2)/lib
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(3)/bin
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin
prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
$$(foreach crate,$$(TARGET_CRATES), \
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
@@ -198,9 +190,12 @@ 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_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
+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_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_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(call PREPARE_TAR_LIB_DIR,$$(CFG_LIBDIR_RELATIVE))
+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_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)
prepare-base-$(1)-%: PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 311ab1c..1b03b1a 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -68,8 +68,7 @@ impl<'a> FileSearch<'a> {
if !found {
let rustpath = rust_path();
for path in &rustpath {
- let tlib_path = make_rustpkg_lib_path(
- self.sysroot, path, self.triple);
+ let tlib_path = make_rustpkg_lib_path(path, self.triple);
debug!("is {} in visited_dirs? {}", tlib_path.display(),
visited_dirs.contains(&tlib_path));
@@ -96,7 +95,7 @@ impl<'a> FileSearch<'a> {
where F: FnMut(&Path, PathKind) -> FileMatch
{
self.for_each_lib_search_path(|lib_search_path, kind| {
- debug!("searching {}", lib_search_path.display());
+ info!("searching {}", lib_search_path.display());
match fs::read_dir(lib_search_path) {
Ok(files) => {
let files = files.filter_map(|p| p.ok().map(|s| s.path()))
@@ -157,7 +156,7 @@ impl<'a> FileSearch<'a> {
prepare-base-$(1)-target: prepare-target-$(1)
diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs
index 09c6b54..00736c6 100644
--- a/src/librustc/session/filesearch.rs
+++ b/src/librustc/session/filesearch.rs
@@ -124,7 +124,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);
@@ -228,7 +238,7 @@ index 311ab1c..1b03b1a 100644
p.push(&rustlibdir());
p.push(&self.triple);
p.push("bin");
@@ -165,8 +164,8 @@ impl<'a> FileSearch<'a> {
@@ -132,8 +132,8 @@ impl<'a> FileSearch<'a> {
}
}
@@ -239,24 +249,14 @@ index 311ab1c..1b03b1a 100644
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
@@ -143,7 +143,19 @@ 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")
+}
@@ -267,12 +267,10 @@ index 311ab1c..1b03b1a 100644
+
+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 {
@@ -161,44 +173,22 @@ pub fn get_or_default_sysroot() -> PathBuf {
}
match canonicalize(env::current_exe().ok()) {
@@ -292,13 +290,8 @@ index 311ab1c..1b03b1a 100644
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
@@ -331,20 +324,14 @@ index 311ab1c..1b03b1a 100644
- "lib".to_string()
- }
-}
-
-#[cfg(windows)]
-fn find_libdir(_sysroot: &Path) -> String {
- "bin".to_string()
-}
-
// The name of rustc's own place to organize libraries.
// Used to be "rustc", now the default is "rustlib"
pub fn rustlibdir() -> String {
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 6171ff1..32f41ff 100644
index ec1383f..670d637 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -1033,11 +1033,10 @@ fn link_args(cmd: &mut Linker,
@@ -1042,11 +1042,10 @@ fn link_args(cmd: &mut Linker,
// where extern libraries might live, based on the
// addl_lib_search_paths
if sess.opts.cg.rpath {

View File

@@ -1,4 +1,4 @@
From 68662f758244a476b64b0772d93c7a1731e9d1ad Mon Sep 17 00:00:00 2001
From 8b088363a61a627fd8a31318d15164113f081660 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/9] std/thread_local: workaround for NULL __dso_handle
@@ -8,10 +8,10 @@ Subject: [PATCH 6/9] std/thread_local: workaround for NULL __dso_handle
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index c204f79..b2f6f1d 100644
index ca0f103..5851127 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -338,7 +338,7 @@ mod imp {
@@ -324,7 +324,7 @@ pub mod elf {
#[linkage = "extern_weak"]
static __cxa_thread_atexit_impl: *const libc::c_void;
}

View File

@@ -1,4 +1,4 @@
From be3663fcd9ae11a207b3c1649917bfff3c69b1c4 Mon Sep 17 00:00:00 2001
From 1a9ada8070bb9cd293cfb93913721c68ca0b7766 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
@@ -11,16 +11,16 @@ Path rewriting is only useful for prepackaged binary installers.
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mk/install.mk b/mk/install.mk
index 8b81702..4fed072 100644
index af6f3ff..430add7 100644
--- a/mk/install.mk
+++ b/mk/install.mk
@@ -12,7 +12,9 @@ RUN_INSALLER = cd tmp/empty_dir && \
@@ -12,7 +12,9 @@ RUN_INSTALLER = 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)"
+ "$(MAYBE_DISABLE_VERIFY)" \
+ --disable-rewrite-paths
install:

View File

@@ -1,28 +0,0 @@
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

View File

@@ -1,4 +1,4 @@
From e6888f9b888911bdbd52e2ee7c37914ee4cee0e2 Mon Sep 17 00:00:00 2001
From 8e359ae2b44fe2edd863e460346554c73f460ba7 Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lexmark.com>
Date: Tue, 7 Jul 2015 14:57:42 -0400
Subject: [PATCH 9/9] Remove crate metadata from symbol hashing
@@ -8,10 +8,10 @@ Subject: [PATCH 9/9] Remove crate metadata from symbol hashing
1 file changed, 5 deletions(-)
diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
index 32f41ff..2a87cd7 100644
index 670d637..4e7150e 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -212,11 +212,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
@@ -213,11 +213,6 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
symbol_hasher.reset();
symbol_hasher.input_str(&link_meta.crate_name);
symbol_hasher.input_str("-");
@@ -20,7 +20,7 @@ index 32f41ff..2a87cd7 100644
- symbol_hasher.input_str(&meta[..]);
- }
- symbol_hasher.input_str("-");
symbol_hasher.input(&encoder::encoded_ty(tcx, t));
symbol_hasher.input(&tcx.sess.cstore.encode_type(tcx, t));
// Prefix with 'h' so that it never blends into adjacent digits
let mut hash = String::from("h");
--

View File

@@ -1,4 +1,4 @@
From 1bd3ab55ce24b2a54e021ba471a5f934b3b9ad6b Mon Sep 17 00:00:00 2001
From 04eee951641b9d9c580ee21c481bdf979dc2fe30 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
@@ -18,15 +18,15 @@ 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/back/link.rs | 36 ++++++++++++++++++++++++++++++++++++
src/librustc_trans/trans/base.rs | 3 +++
5 files changed, 48 insertions(+)
5 files changed, 46 insertions(+)
diff --git a/mk/platform.mk b/mk/platform.mk
index 0c90632..4681783 100644
index 5239086..eb693b8 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -181,6 +181,7 @@ define CFG_MAKE_TOOLCHAIN
@@ -186,6 +186,7 @@ define CFG_MAKE_TOOLCHAIN
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
LINK_$(1)=$(CROSS_PREFIX_$(1))$(LINK_$(1))
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(LINK_$(1))) \
@@ -35,10 +35,10 @@ index 0c90632..4681783 100644
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
index 4cc059b..600cb4b 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -460,6 +460,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
@@ -497,6 +497,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"),
@@ -48,19 +48,19 @@ index ecb38d4..b74b3c4 100644
"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
index 636a1aa..1b87a7a 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>,
@@ -118,6 +118,8 @@ pub struct TargetOptions {
/// Linker arguments that are unconditionally passed *after* any
/// user-defined libraries.
pub post_link_args: 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 {
@@ -213,6 +215,7 @@ impl Default for TargetOptions {
ar: option_env!("CFG_DEFAULT_AR").unwrap_or("ar").to_string(),
pre_link_args: Vec::new(),
post_link_args: Vec::new(),
@@ -68,7 +68,7 @@ index 3ffa484..d52e67c 100644
cpu: "generic".to_string(),
features: "".to_string(),
dynamic_linking: false,
@@ -314,6 +317,7 @@ impl Target {
@@ -331,6 +334,7 @@ impl Target {
key!(cpu);
key!(ar);
key!(linker);
@@ -77,10 +77,10 @@ index 3ffa484..d52e67c 100644
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
index 4e7150e..0d8a125 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 {
@@ -394,6 +394,13 @@ fn command_path(sess: &Session) -> OsString {
env::join_paths(new_path).unwrap()
}
@@ -94,7 +94,7 @@ index 2a87cd7..53fa913 100644
pub fn remove(sess: &Session, path: &Path) {
match fs::remove_file(path) {
Ok(..) => {}
@@ -919,6 +926,34 @@ fn link_natively(sess: &Session, dylib: bool,
@@ -928,6 +935,32 @@ fn link_natively(sess: &Session, dylib: bool,
}
}
@@ -115,12 +115,10 @@ index 2a87cd7..53fa913 100644
+ 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();
@@ -129,7 +127,7 @@ index 2a87cd7..53fa913 100644
fn link_args(cmd: &mut Linker,
sess: &Session,
dylib: bool,
@@ -951,6 +986,9 @@ fn link_args(cmd: &mut Linker,
@@ -960,6 +993,9 @@ fn link_args(cmd: &mut Linker,
// executable. This metadata is in a separate object file from the main
// object file, so we link that in here.
if dylib {
@@ -140,19 +138,19 @@ index 2a87cd7..53fa913 100644
}
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs
index 14fea61..df019f7 100644
index 4c619f8..2b68767 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,
@@ -2924,6 +2924,9 @@ pub fn write_metadata<'a, 'tcx>(cx: &SharedCrateContext<'a, 'tcx>,
};
unsafe {
llvm::LLVMSetInitializer(llglobal, llconst);
+ llvm::LLVMSetGlobalConstant(llglobal, llvm::True);
+ llvm::LLVMSetUnnamedAddr(llglobal, llvm::True);
+ llvm::SetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
let name = loader::meta_section_name(&cx.sess().target.target);
let name =
cx.tcx().sess.cstore.metadata_section_name(&cx.sess().target.target);
let name = CString::new(name).unwrap();
llvm::LLVMSetSection(llglobal, name.as_ptr())
--
1.9.1

View File

@@ -1,4 +1,4 @@
From 128a81ede6b188637743a37a582b2267a49d0a32 Mon Sep 17 00:00:00 2001
From b6805ab1099ca824bb516da4f1825a7e4ce30153 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
@@ -11,14 +11,14 @@ 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(-)
src/librustc_trans/back/link.rs | 28 ++++++++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index b74b3c4..a11cb90 100644
index 600cb4b..3570e78 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -500,6 +500,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
@@ -537,6 +537,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"),
@@ -28,10 +28,10 @@ index b74b3c4..a11cb90 100644
"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
index 0d8a125..9917a1e 100644
--- a/src/librustc_trans/back/link.rs
+++ b/src/librustc_trans/back/link.rs
@@ -46,7 +46,7 @@ use std::str;
@@ -45,7 +45,7 @@ use std::str;
use flate;
use serialize::hex::ToHex;
use syntax::ast;
@@ -40,10 +40,11 @@ index 53fa913..83619ae 100644
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 {
@@ -186,9 +186,33 @@ pub fn build_link_meta(sess: &Session,
krate: &hir::Crate,
name: &str)
-> LinkMeta {
+ use std::collections::BTreeMap;
+ let crate_hash = if sess.opts.cg.crate_hash != "" {
+ let dummy_span = Span {
+ lo: BytePos(0),
@@ -52,14 +53,15 @@ index 53fa913..83619ae 100644
+ };
+ let dummy_module = hir::Mod {
+ inner: dummy_span,
+ items: vec!()
+ item_ids: hir::HirVec::new()
+ };
+ let dummy_krate = hir::Crate {
+ module: dummy_module,
+ attrs: vec!(),
+ config: vec!(),
+ attrs: hir::HirVec::new(),
+ config: hir::CrateConfig::new(),
+ span: dummy_span,
+ exported_macros: vec!()
+ exported_macros: hir::HirVec::new(),
+ items: BTreeMap::new()
+ };
+
+ Svh::calculate(&vec!(sess.opts.cg.crate_hash.clone()), &dummy_krate)

View File

@@ -1,4 +1,4 @@
From d0fa41075317425b01262dd539c01e87e2eaf5f4 Mon Sep 17 00:00:00 2001
From 7abedc46cad6b52d44badaf88350d41ef907cd4c 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
@@ -9,10 +9,10 @@ bitbake recipe will export FORCE_CRATE_HASH
1 file changed, 1 insertion(+)
diff --git a/mk/platform.mk b/mk/platform.mk
index 4681783..59aa560 100644
index eb693b8..e6317b5 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -182,6 +182,7 @@ define CFG_MAKE_TOOLCHAIN
@@ -187,6 +187,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))) \

View File

@@ -1,4 +1,4 @@
From 1fbfa088007054c655741e547bb3e72f1d5f1746 Mon Sep 17 00:00:00 2001
From f3e8bd9ab353d4b3d7432a02e37a22eed24b5e57 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
@@ -10,10 +10,10 @@ Subject: [PATCH] mk: allow changing the platform configuration source
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 01c447b..0f004cf 100755
index 7d53a66..5d40516 100755
--- a/configure
+++ b/configure
@@ -650,6 +650,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
@@ -671,6 +671,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"
@@ -21,7 +21,7 @@ index 01c447b..0f004cf 100755
# Temporarily support old triples until buildbots get updated
CFG_BUILD=$(to_llvm_triple $CFG_BUILD)
@@ -1110,7 +1111,7 @@ CFG_MANDIR=${CFG_MANDIR%/}
@@ -1127,7 +1128,7 @@ CFG_MANDIR=${CFG_MANDIR%/}
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
CFG_SUPPORTED_TARGET=""
@@ -30,19 +30,19 @@ index 01c447b..0f004cf 100755
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
@@ -1795,6 +1796,7 @@ putvar CFG_I686_LINUX_ANDROID_NDK
putvar CFG_NACL_CROSS_PATH
putvar CFG_MANDIR
putvar CFG_USING_LIBCPP
+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
index e6317b5..68a20e1 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -112,7 +112,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \
@@ -114,7 +114,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \
CFG_RLIB_GLOB=lib$(1)-*.rlib
@@ -50,7 +50,7 @@ index 59aa560..a964d6f 100644
+include $(wildcard $(CFG_PLATFORM_CFG)/*.mk)
define ADD_INSTALLED_OBJECTS
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
INSTALLED_OBJECTS_$(1) += $$(CFG_INSTALLED_OBJECTS_$(1))
--
2.7.0

View File

@@ -0,0 +1,28 @@
diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs
index 92c3bf8..b9fd014 100644
--- a/src/libstd/rand/os.rs
+++ b/src/libstd/rand/os.rs
@@ -46,8 +46,10 @@
#[cfg(target_arch = "aarch64")]
const NR_GETRANDOM: libc::c_long = 278;
+ const GRND_NONBLOCK: libc::c_uint = 0x0001;
+
unsafe {
- libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0)
+ libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), GRND_NONBLOCK)
}
}
@@ -69,6 +71,10 @@
let err = errno() as libc::c_int;
if err == libc::EINTR {
continue;
+ } else if err == libc::EAGAIN {
+ let mut reader_rng = ReaderRng::new(File::open("/dev/urandom").unwrap());
+ reader_rng.fill_bytes(&mut v[read..]);
+ read += v.len() as usize;
} else {
panic!("unexpected getrandom error: {}", err);
}

View File

@@ -1,9 +1,3 @@
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}"
}

View File

@@ -15,7 +15,6 @@ EXTRA_OECONF += "--enable-bindings=none"
EXTRA_OECONF += "--disable-terminfo"
EXTRA_OECONF += "--disable-zlib"
EXTRA_OECONF += "--disable-libffi"
EXTRA_OECONF += "--enable-keep-symbols"
PACKAGES += "${PN}-data"
@@ -28,11 +27,11 @@ do_install_append () {
# Remove the debug info (>2 GB) as part of normal operation
rm -rf ${D}${bindir}/.debug
cd ${D}${bindir}
cd ${D}${bindir} || bbfatal "failed to cd ${D}${bindir}"
ln -s *-llc llc
for i in *-llvm-*; do
link=$(echo $i | sed -e 's/.*-llvm-\(.*\)/\1/')
ln -sf $i llvm-$link
for i in *-llvm-* *-llc *-lli *-FileCheck; do
link=$(echo $i | sed -e "s/${TARGET_SYS}-\(.*\)/\1/")
ln -sf "$i" "${link}" || bbfatal "failed to symlink ${link}"
done
}

View File

@@ -1,14 +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"
RS_DATE = "2015-12-18"
RS_SRCHASH = "3391630"
# linux-x86_64
RS_ARCH = "linux-x86_64"
RS_HASH = "7df8ba9dec63ec77b857066109d4b6250f3d222f"
RS_HASH = "97e2a5eb8904962df8596e95d6e5d9b574d73bf4"
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"
SRC_URI[rust-snapshot.md5sum] = "5c29eb06c8b6ce6ff52f544f31efabe1"
SRC_URI[rust-snapshot.sha256sum] = "a8dc5203673ce43f47316beb02ee0c427edb7bbde2ab5fc662a06b52db2950e7"

View File

@@ -8,19 +8,17 @@ inherit shared-source-provide
require rust-version.inc
require rust-release.inc
SRC_URI[rust.md5sum] = "234bd912481a04e93b7f2eff0d5b3485"
SRC_URI[rust.sha256sum] = "641037af7b7b6cad0b231cc20671f8a314fbf2f40fc0901d0b877c39fc8da5a0"
SRC_URI[rust.md5sum] = "15f1c204580017838301c5c8568e8f3f"
SRC_URI[rust.sha256sum] = "6df96059d87b718676d9cd879672e4e22418b6093396b4ccb5b5b66df37bf13a"
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 \
@@ -28,4 +26,5 @@ SRC_URI_append = "\
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 \
file://rust/fix-urandom-during-init.patch \
"

View File

@@ -1,6 +1,6 @@
# Note: if you adjust this, you'll also need to change the hashes in
# rust-source.bb
SOURCE_NAME = "rust"
PV = "1.5.0"
PV = "1.7.0"
LICENSE = "MIT | Apache-2.0"

View File

@@ -2,9 +2,9 @@
inherit rust
inherit rust-installer
require rust-shared-source.inc
require rust-snapshot-2015-08-11.inc
require rust-snapshot-2015-12-18.inc
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a"
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=9c5a05eab0ffc3590e50db38c51d1425"
SUMMARY = "Rust compiler and runtime libaries"
HOMEPAGE = "http://www.rust-lang.org"
@@ -92,47 +92,74 @@ def llvm_features_from_tune(d):
return ','.join(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
# stable (1.9.0?)
def llvm_features_from_cc_arch(d):
f = []
feat = d.getVar('TARGET_CC_ARCH', True)
if not feat:
return ""
feat = frozenset(feat.split())
if '-mmmx' in feat:
f.append("+mmx")
if '-msse' in feat:
f.append("+sse")
if '-msse2' in feat:
f.append("+sse2")
if '-msse3' in feat:
f.append("+sse3")
if '-mssse3' in feat:
f.append("+ssse3")
if '-msse4.1' in feat:
f.append("+sse4.1")
if '-msse4.2' in feat:
f.append("+sse4.2")
if '-msse4a' in feat:
f.append("+sse4a")
if '-mavx' in feat:
f.append("+avx")
if '-mavx2' in feat:
f.append("+avx2")
return ','.join(f)
## arm-unknown-linux-gnueabihf
DATA_LAYOUT[arm] = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32"
LLVM_TARGET[arm] = "${RUST_TARGET_SYS}"
TARGET_ENDIAN[arm] = "little"
TARGET_POINTER_WIDTH[arm] = "32"
FEATURES[arm] = "+v6,+vfp2"
PRE_LINK_ARGS[arm] = "-Wl,--as-needed"
POST_LINK_ARGS[arm] = "-lssp"
DATA_LAYOUT[aarch64] = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-n32:64-S128"
## aarch64-unknown-linux-gnu
LLVM_TARGET[aarch64] = "aarch64-unknown-linux-gnu"
TARGET_ENDIAN[aarch64] = "little"
TARGET_POINTER_WIDTH[aarch64] = "64"
PRE_LINK_ARGS[aarch64] = "-Wl,--as-needed"
## x86_64-unknown-linux-gnu
DATA_LAYOUT[x86_64] = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
LLVM_TARGET[x86_64] = "x86_64-unknown-linux-gnu"
TARGET_ENDIAN[x86_64] = "little"
TARGET_POINTER_WIDTH[x86_64] = "64"
PRE_LINK_ARGS[x86_64] = "-Wl,--as-needed -m64"
## i686-unknown-linux-gnu
DATA_LAYOUT[i686] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"
LLVM_TARGET[i686] = "i686-unknown-linux-gnu"
TARGET_ENDIAN[i686] = "little"
TARGET_POINTER_WIDTH[i686] = "32"
PRE_LINK_ARGS[i686] = "-Wl,--as-needed -m32"
## XXX: a bit of a hack so qemux86 builds, clone of i686-unknown-linux-gnu above
DATA_LAYOUT[i586] = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"
LLVM_TARGET[i586] = "i586-unknown-linux-gnu"
TARGET_ENDIAN[i586] = "little"
TARGET_POINTER_WIDTH[i586] = "32"
PRE_LINK_ARGS[i586] = "-Wl,--as-needed -m32"
# enable-new-dtags causes rpaths to be inserted as DT_RUNPATH (as well as
# DT_RPATH), which lets LD_LIBRARY_PATH override them
RPATH_LDFLAGS = "-Wl,--enable-new-dtags"
TARGET_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
BUILD_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
HOST_PRE_LINK_ARGS = "${RPATH_LDFLAGS} ${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
TARGET_PRE_LINK_ARGS = "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
BUILD_PRE_LINK_ARGS = "${BUILD_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
HOST_PRE_LINK_ARGS = "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
# These LDFLAGS have '-L' options in them. We need these to come last so they
# don't screw up the link order and pull in the wrong rust build/version.
@@ -173,17 +200,22 @@ def arch_to_rust_target_arch(arch):
else:
return arch
def as_json(list_):
a = '['
for e in list_:
if type(e) == str:
a += '"{}",'.format(e)
else:
raise Exception
if len(list_):
a = a[:-1]
a += ']'
return a
# generates our target CPU value
def llvm_cpu(d):
cpu = d.getVar('TUNE_PKGARCH', True)
target = d.getVar('TRANSLATED_TARGET_ARCH', True)
trans = {}
trans['corei7-64'] = "corei7"
trans['core2-32'] = "core2"
trans['x86-64'] = "x86-64"
trans['i686'] = "i686"
trans['i586'] = "i586"
try:
return trans[cpu]
except:
return trans.get(target, "generic")
def post_link_args_for(d, thing, arch):
post_link_args = (d.getVar('{}_POST_LINK_ARGS'.format(thing), True) or "").split()
@@ -200,71 +232,57 @@ 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)}"
TARGET_LLVM_CPU="${@llvm_cpu(d)}"
TARGET_LLVM_FEATURES = "${@llvm_features_from_tune(d)} ${@llvm_features_from_cc_arch(d)}"
TARGET_LLVM_CPU_class-cross="${@llvm_cpu(d)}"
TARGET_LLVM_FEATURES_class-cross = "${@llvm_features_from_tune(d)} ${@llvm_features_from_cc_arch(d)}"
# class-native implies TARGET=HOST, and TUNE_FEATURES only describes the real
# (original) target.
TARGET_LLVM_FEATURES_class-native = ""
TARGET_LLVM_CPU="${@llvm_cpu(d)}"
TARGET_LLVM_FEATURES_class-native = "${@llvm_features_from_cc_arch(d)}"
def rust_gen_target(d, thing, wd):
import json
arch = arch_for(d, thing)
sys = sys_for(d, thing)
prefix = prefix_for(d, thing)
o = open(wd + sys + '.json', 'w')
data_layout = d.getVarFlag('DATA_LAYOUT', arch, True)
if not data_layout:
bb.utils.fatal("DATA_LAYOUT[{}] required but not set for {}".format(arch, thing))
llvm_target = d.getVarFlag('LLVM_TARGET', arch, True)
target_pointer_width = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True)
endian = d.getVarFlag('TARGET_ENDIAN', arch, True)
prefix = d.getVar('{}_PREFIX'.format(thing), True)
ccache = d.getVar('CCACHE', True)
linker = "{}{}gcc".format(ccache, prefix)
objcopy = "{}objcopy".format(prefix)
features = ""
if thing is "TARGET":
features = d.getVar('TARGET_LLVM_FEATURES', True) or ""
features = features or d.getVarFlag('FEATURES', arch, True) or ""
features = features.strip()
pre_link_args = pre_link_args_for(d, thing, arch)
post_link_args = post_link_args_for(d, thing, arch)
# build tspec
tspec = {}
tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch, True)
tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch, True)
tspec['target-word-size'] = tspec['target-pointer-width']
tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch, True)
tspec['arch'] = arch_to_rust_target_arch(arch)
tspec['os'] = "linux"
tspec['env'] = "gnu"
tspec['linker'] = "{}{}gcc".format(d.getVar('CCACHE', True), prefix)
tspec['objcopy'] = "{}objcopy".format(prefix)
tspec['ar'] = "{}ar".format(prefix)
tspec['cpu'] = d.getVar('TARGET_LLVM_CPU', True)
if features is not "":
tspec['features'] = features
tspec['dynamic-linking'] = True
tspec['executables'] = True
tspec['morestack'] = True
tspec['linker-is-gnu'] = True
tspec['has-rpath'] = True
tspec['has-elf-tls'] = True
tspec['position-independent-executables'] = True
tspec['pre-link-args'] = pre_link_args_for(d, thing, arch)
tspec['post-link-args'] = post_link_args_for(d, thing, arch)
# write out the target spec json file
with open(wd + sys + '.json', 'w') as f:
json.dump(tspec, f)
o.write('''{{
"data-layout": "{}",
"llvm-target": "{}",
"target-endian": "{}",
"target-word-size": "{}",
"target-pointer-width": "{}",
"arch": "{}",
"os": "linux",
"linker": "{}",
"objcopy": "{}",
"features": "{}",
"dynamic-linking": true,
"executables": true,
"morestack": true,
"linker-is-gnu": true,
"has-rpath": true,
"position-independent-executables": true,
"pre-link-args": {},
"post-link-args": {}
}}'''.format(
data_layout,
llvm_target,
endian,
target_pointer_width,
target_pointer_width,
arch_to_rust_target_arch(arch),
linker,
objcopy,
features,
as_json(pre_link_args),
as_json(post_link_args),
))
o.close()
python do_rust_gen_targets () {
wd = d.getVar('WORKDIR', True) + '/targets/'
@@ -347,6 +365,9 @@ do_rust_arch_fixup[dirs] += "${WORKDIR}/mk-cfg"
llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}"
# prevent the rust-installer scripts from calling ldconfig
export CFG_DISABLE_LDCONFIG="notempty"
do_configure () {
# Note: when we adjust the generated targets, rust doesn't rebuild (even
# when it should), so for now we need to remove the build dir to keep
@@ -389,12 +410,12 @@ do_configure () {
"--disable-docs" \
"--disable-manage-submodules" \
"--disable-debug" \
"--enable-debuginfo" \
"--enable-optimize" \
"--enable-optimize-cxx" \
"--disable-llvm-version-check" \
"--llvm-root=${llvmdir}" \
"--enable-optimize-tests" \
"--release-channel=stable" \
"--prefix=${prefix}" \
"--target=${TARGET_SYS}" \
"--host=${HOST_SYS}" \
@@ -450,9 +471,9 @@ rust_do_install () {
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 .)
# Remove any files directly installed into libdir to avoid
# conflicts between cross and native
rm -f ${D}${libdir}/lib*.so
}
do_install () {

View File

@@ -0,0 +1,10 @@
inherit cargo
SRC_URI = "https://crates.io/api/v1/crates/rustfmt/0.4.0/download;downloadfilename=${P}.tar.gz"
SRC_URI[md5sum] = "2916b64ad7d6b6c9f33ea89f9b3083c4"
SRC_URI[sha256sum] = "add2143a74d9dde7ddbfdd325ac6f253656662fd3b6c22600e1fa4b52f9eab01"
LIC_FILES_CHKSUM="file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SUMMARY = "Format Rust Code"
HOMEPAGE = "https://github.com/rust-lang-nursery/rustfmt"
LICENSE = "MIT | Apache-2.0"

19
scripts/build.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Grab the MACHINE from the environment; otherwise, set it to a sane default
export MACHINE="${MACHINE-qemux86}"
# What to build
BUILD_TARGETS="\
rustfmt \
"
die() {
echo "$*" >&2
exit 1
}
rm -f build/conf/bblayers.conf || die "failed to nuke bblayers.conf"
rm -f build/conf/local.conf || die "failed to nuke local.conf"
./scripts/containerize.sh bitbake ${BUILD_TARGETS} || die "failed to build"

5
scripts/cleanup-env.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash -e
sudo umount build
exit 0

54
scripts/containerize.sh Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
# what container are we using to build this
CONTAINER="starlabio/yocto:1.5"
einfo() {
echo "$*" >&2
}
die() {
echo "$*" >&2
exit 1
}
# Save the commands for future use
cmd=$@
# If no command was specified, just drop us into a shell if we're interactive
[ $# -eq 0 ] && tty -s && cmd="/bin/bash"
# user and group we are running as to ensure files created inside
# the container retain the same permissions
my_uid=$(id -u)
my_gid=$(id -g)
# Are we in an interactive terminal?
tty -s && termint=t
# Fetch the latest version of the container
einfo "*** Ensuring local container is up to date"
docker pull ${CONTAINER} > /dev/null || die "Failed to update docker container"
# Ensure we've got what we need for SSH_AUTH_SOCK
if [[ -n ${SSH_AUTH_SOCK} ]]; then
SSH_AUTH_DIR=$(dirname $(readlink -f ${SSH_AUTH_SOCK}))
SSH_AUTH_NAME=$(basename ${SSH_AUTH_SOCK})
fi
# Kick off Docker
einfo "*** Launching container ..."
exec docker run \
--privileged \
-e BUILD_UID=${my_uid} \
-e BUILD_GID=${my_gid} \
-e TEMPLATECONF=meta-rust/conf \
-e MACHINE=${MACHINE:-qemux86} \
${SSH_AUTH_SOCK:+-e SSH_AUTH_SOCK="/tmp/ssh-agent/${SSH_AUTH_NAME}"} \
-v ${HOME}/.ssh:/var/build/.ssh \
-v "${PWD}":/var/build:rw \
${SSH_AUTH_SOCK:+-v "${SSH_AUTH_DIR}":/tmp/ssh-agent} \
${EXTRA_CONTAINER_ARGS} \
-${termint}i --rm -- \
${CONTAINER} \
${cmd}

95
scripts/fetch.sh Executable file
View File

@@ -0,0 +1,95 @@
#!/bin/bash -x
# the repos we want to check out, must setup variables below
# NOTE: poky must remain first
REPOS="poky metaoe"
POKY_URI="git://git.yoctoproject.org/poky.git"
POKY_PATH="poky"
POKY_REV="${POKY_REV-refs/remotes/origin/$1}"
METAOE_URI="git://git.openembedded.org/meta-openembedded.git"
METAOE_PATH="poky/meta-openembedded"
METAOE_REV="${METAOE_REV-refs/remotes/origin/$1}"
METARUST_URI="."
METARUST_PATH="poky/meta-rust"
die() {
echo "$*" >&2
exit 1
}
update_repo() {
uri=$1
path=$2
rev=$3
# check if we already have it checked out, if so we just want to update
if [[ -d ${path} ]]; then
pushd ${path} > /dev/null
echo "Updating '${path}'"
git remote set-url origin "${uri}"
git fetch origin || die "unable to fetch ${uri}"
else
echo "Cloning '${path}'"
if [ -z "${GIT_LOCAL_REF_DIR}" ]; then
git clone ${uri} ${path} || die "unable to clone ${uri}"
else
git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` ${uri} ${path}
fi
pushd ${path} > /dev/null
fi
# The reset steps are taken from Jenkins
# Reset
# * drop -d from clean to not nuke build/tmp
# * add -e to not clear out bitbake bits
git reset --hard || die "failed reset"
git clean -fx -e bitbake -e meta/lib/oe || die "failed clean"
# Call the branch what we're basing it on, otherwise use default
# if the revision was not a branch.
branch=$(basename ${rev})
[[ "${branch}" == "${rev}" ]] && branch="default"
# Create 'default' branch
git update-ref refs/heads/${branch} ${rev} || \
die "unable to get ${rev} of ${uri}"
git config branch.${branch}.remote origin || die "failed config remote"
git config branch.${branch}.merge ${rev} || die "failed config merge"
git symbolic-ref HEAD refs/heads/${branch} || die "failed symbolic-ref"
git reset --hard || die "failed reset"
popd > /dev/null
echo "Updated '${path}' to '${rev}'"
}
# For each repo, do the work
for repo in ${REPOS}; do
# upper case the name
repo=$(echo ${repo} | tr '[:lower:]' '[:upper:]')
# expand variables
expand_uri="${repo}_URI"
expand_path="${repo}_PATH"
expand_rev="${repo}_REV"
repo_uri=${!expand_uri}
repo_path=${!expand_path}
repo_rev=${!expand_rev}
# check that we've got data
[[ -z ${repo_uri} ]] && die "No revision defined in ${expand_uri}"
[[ -z ${repo_path} ]] && die "No revision defined in ${expand_path}"
[[ -z ${repo_rev} ]] && die "No revision defined in ${expand_rev}"
# now fetch/clone/update repo
update_repo "${repo_uri}" "${repo_path}" "${repo_rev}"
done
rm -rf "${METARUST_PATH}" || die "unable to clear old ${METARUST_PATH}"
ln -sf "../${METARUST_URI}" "${METARUST_PATH}" || \
die "unable to symlink ${METARUST_PATH}"
exit 0

7
scripts/setup-env.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash -e
mkdir -p build
sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build
exit 0