204 Commits

Author SHA1 Message Date
Doug Goldstein 404cbe3dcc rust-llvm: cmake build bits from openswitch
Grabbed this chunk from
http://git.openswitch.net/cgit/openswitch/ops-build/tree/yocto/openswitch/meta-foss-openswitch/recipes-core/llvm/llvm.inc
The cmake.bbclass that poky ships with does not generate the proper
values for native builds so this is necessary to fix that up.
2016-11-04 13:13:08 -05:00
Doug Goldstein ea888066a3 rust-llvm: convert to cmake build
Future versions of LLVM require cmake to build so it will be easier to
prove that out on a known good build and to allow future versions to use
this as common code.
2016-11-04 13:13:08 -05:00
Derek Straka e0e7b6cefe Merge pull request #104 from cardoe/fix-data-layout
rust: fix LLVM data layouts for Rust 1.10
2016-11-04 13:20:05 -04:00
Doug Goldstein ce9949725c 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.
2016-11-03 17:05:41 -05:00
Doug Goldstein bef7c3f07e rust: fix LLVM data layouts for Rust 1.10
The data layout changed for Rust 1.10. I noticed this because I got a
crash when using rust-native to build rust. The assertion that hit was
saying data layout mismatch and caused me to check the values in the
Rust sources.
2016-11-03 16:31:21 -05:00
Doug Goldstein 6db046c19d 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-11-03 14:56:22 -05:00
Doug Goldstein a97f66224a drop files supporting shared source 2016-11-01 15:37:47 -05:00
Doug Goldstein 2536080e0b libstd-rs: stop using shared source
Convert libstd-rs to not use the shared source setup and instead use
its own extracted directory. Include the version info in the bitbake
file so that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
2016-11-01 15:37:47 -05:00
Doug Goldstein 1f903865b4 compiler-rt: stop using shared source
Convert compiler-rt to not use the shared source setup and instead use
its own extracted directory. Include the version info in the bitbake
file so that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
2016-11-01 15:12:16 -05:00
Doug Goldstein 7f7b3cd652 rust: stop using shared source
Convert rust to not use the shared source setup and instead use its own
extracted directory. Include the version info in the bitbake file so
that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
2016-11-01 13:00:35 -05:00
Doug Goldstein a1ca1ed06d rust-llvm: stop using shared source
Convert rust-llvm to not use the shared source setup and instead use its
own extracted directory. Include the version info in the bitbake file so
that in the future we can support multiple versions via a
PREFERRED_VERSIONS variable.
2016-10-31 22:30:47 -05:00
Cody P Schafer 1436b99692 rust: avoid using flags for TARGET for non-TARGET 2016-10-01 21:58:39 -04:00
Cody P Schafer 41800bdd99 rust.inc: ensure proper flags are given to rustllvm
rustllvm ships some c++ code that we need to ensure is built with the
flags we want. Abuse an existing variable to make this happen.

This should fix our issues with the libstdc++ cxx11 abi (_GLIBCXX_USE_CXX11_ABI).
2016-09-25 02:30:46 -04:00
Cody P Schafer 9b8d884d6b rust.inc: start passing *FLAGS vars to compile
When rust's build system builds llvm itself, it uses these flags. Avoid
them interfering with other things by cleaning their usage out of the
platform cfg mk file.
2016-09-25 02:29:29 -04:00
Cody P Schafer 45d540de36 rust.inc: EXTRA_OEMAKE is now empty by default, drop our set
Since poky rev: f8520142c8a33fa9414314511fb01fbe79a2bf01, oe-core rev:
aeb653861a0ec39ea7a014c0622980edcbf653fa
2016-09-25 00:53:39 -04:00
Cody P Schafer 1cb0b64537 rust: remove duplicated TARGET_LLVM_* vars 2016-09-24 13:20:00 -04:00
Cody P Schafer 237a22fd17 rust-cross: fix build where TARGET_ARCH and HOST_ARCH are the same
By copying exactly the target we intend to.

Fixes #77
2016-09-14 00:16:07 -04:00
Steven Walter 34f213d162 Merge pull request #71 from srwalter/cargo-no-network
Update cargo support so that there truly is no network access
2016-09-05 18:45:14 -04:00
Steven Walter fbf59ed6a0 cargo.bbclass: replace with what was cargo_util.bbclass
The old cargo.bbclass had no users in meta-rust and had lots of
problems (not least of which was lots of duplicated lines with
cargo_util.bbclass).  Delete the old cargo.bbclass and replace it
entirely wiht cargo_util
2016-09-05 18:40:42 -04:00
Steven Walter e87b2d43b0 libstd-rs: use cargo_util_do_compile 2016-09-05 18:38:38 -04:00
Steven Walter f31f0c2257 libstd-rs: download dependent crates
Cargo was trying to download these itself before, which isn't allowed.
Use the crate fetcher to get our dependencies
2016-09-05 18:38:38 -04:00
Tyler Hall 8af5d4f7e9 compiler-rt: ensure -e is passed to make
OE-Core rev aeb653861a0ec39ea7a014c0622980edcbf653fa (between jethro and
krogoth) removed -e from the default flags in EXTRA_OEMAKE. Without
this, the makefile will default to gcc for CC.
2016-09-03 19:42:56 -04:00
Steven Walter 56ac849771 rust-cross: use base_libdir_native
This fixes rust-cross-aarch64 (and probably rust-cross-x86_64) since
those targets will use lib64 for cross but lib for native.
2016-09-03 10:35:04 -04:00
Steven Walter f6c7789c95 rust-cross: don't actually build a compiler
Instead of building a full compiler, we can use rust-native to
cross-compile.  All we need is a cross-compiled standard library, which
libstd-rs builds, and a compiler spec file.  rust-cross is now just used
to generate the json spec file for cross-compiling, which is naturally
much faster.
2016-09-02 12:01:28 -04:00
Steven Walter e2d09d0362 libstd-rs: cross compile rust's runtime
This can replace rustlib, which just copies the binaries already
built by rust-cross.
2016-09-02 11:33:46 -04:00
Steven Walter 0a1d85272d Revert "rust: drop unnecessary data layout targets"
Rust 1.10.0 requires the data-layout field

This reverts commit d749cbb98a.
2016-08-28 14:58:14 -04:00
Steven Walter 3d0fab8860 Rework support for downloading the stage0 rustc
Rust does something fairly different than in 1.7.  Instead of just
expecting the tarball to exist, it either expects an already extracted
and ready toolchain, or else it does everything itself.

To work with that, we'll always pass --use-local-rust to ./configure so
that bootstrap.py doesn't try to download anything.  We'll either
download and setup a snapshot ourselves, or use the system rust, based
on PACKAGECONFIG[local-rust] as before
2016-08-28 14:58:14 -04:00
Steven Walter b708837c7c rust-llvm: skip unittests
These fail to build, apparently because some files do not include the
appropriate headers, e.g. <mutex> and <condition_variable>
2016-08-28 14:58:14 -04:00
Steven Walter ec3cbddb38 Rebase patches for 1.10.0 2016-08-28 14:57:48 -04:00
Doug Goldstein 15bb60780a Merge pull request #66 from meta-rust/random-number-backport
rust: add a backport fix to use /dev/urandom in cases where the random pool isn't yet initialized
2016-08-18 20:04:05 -04:00
Derek Straka 344fd5eec5 rust: add a backport fix to use /dev/urandom in cases where the random pool isn't yet initialized
Signed-off-by: Derek Straka <derek@asterius.io>
2016-08-18 13:18:38 -04:00
Derek Straka 7c494d94f0 rust: resolve issues with conflicted linking between host and target libs
Signed-off-by: Derek Straka <derek@asterius.io>
2016-08-03 07:31:19 -04:00
Cody Schafer 395cde5819 Merge pull request #50 from srwalter/rust-1.7-fixes
Several fixes for rust 1.7
2016-05-08 16:47:54 -04:00
Steven Walter 75c20f0bbc Upgrade snapshot to 2015-12-18
The August snapshot is no longer new enough for rust 1.7.0.  Without the
update rust's build process still tries to download its own snapshot,
which rather defeats the point of this.
2016-05-05 21:56:19 -04:00
Steven Walter 7b05b9c7f0 rustlib: install rlib's as well as .so's
This will allow clients to choose between static and dynamic linking
2016-05-05 21:56:19 -04:00
Steven Walter 9a0ea9bf40 rust: allow building against musl libc on arm 2016-05-05 21:39:46 -04:00
Doug Goldstein d477a68dba 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-11 09:33:43 -05:00
Doug Goldstein fe8b755da0 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-11 09:33:43 -05:00
Doug Goldstein 825bf74a2e 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-11 09:33:43 -05:00
Doug Goldstein 5ced950596 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-11 09:33:43 -05:00
Doug Goldstein b13e266124 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-11 09:33:43 -05:00
Doug Goldstein ba16b5c39e 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-11 09:33:43 -05:00
Doug Goldstein 2fb76952f7 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-11 09:33:43 -05:00
Doug Goldstein 0fb90a149c 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-11 09:33:43 -05:00
Doug Goldstein 95af734ac1 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-11 09:33:43 -05:00
Doug Goldstein 8f25a92000 rust: drop duplicate variable assignment
prefix_for() and the deleted line are identical.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-11 09:33:43 -05:00
Doug Goldstein 91b165427c 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-11 09:33:43 -05:00
Doug Goldstein 5f701adec8 rust: fix bad line in patch
This needs to be properly escaped.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-11 09:33:43 -05:00
Doug Goldstein 8982df0b5c 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-11 09:33:43 -05:00
Doug Goldstein d749cbb98a 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-11 09:33:43 -05:00