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.
This commit is contained in:
@@ -10,6 +10,7 @@ INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||
# the bits we need explicitly.
|
||||
DEPENDS += "rust-llvm-native"
|
||||
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
|
||||
DEPENDS += "rust-native"
|
||||
|
||||
PROVIDES = "virtual/${TARGET_PREFIX}rust"
|
||||
PN = "rust-cross-${TARGET_ARCH}"
|
||||
@@ -31,14 +32,18 @@ BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
||||
# We need the same thing for the calls to the compiler when building the runtime crap
|
||||
TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}"
|
||||
|
||||
# cross.bbclass is "helpful" and overrides our do_install. Tell it not to.
|
||||
do_install () {
|
||||
rust_do_install
|
||||
do_configure () {
|
||||
}
|
||||
|
||||
# using host-strip on target .so files generated by this recipie causes build errors.
|
||||
# for now, disable stripping.
|
||||
# A better (but more complex) approach would be to mimic gcc-runtime and build
|
||||
# the target.so files in a seperate .bb file.
|
||||
INHIBIT_PACKAGE_STRIP = "1"
|
||||
INHIBIT_SYSROOT_STRIP = "1"
|
||||
do_compile () {
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${prefix}/${baselib}/rustlib
|
||||
cp ${WORKDIR}/targets/${TARGET_ARCH}* ${D}${prefix}/${baselib}/rustlib
|
||||
}
|
||||
|
||||
rust_cross_sysroot_preprocess() {
|
||||
sysroot_stage_dir ${D}${prefix}/${baselib}/rustlib ${SYSROOT_DESTDIR}${prefix}/${baselib}/rustlib
|
||||
}
|
||||
SYSROOT_PREPROCESS_FUNCS += "rust_cross_sysroot_preprocess"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
inherit rust-installer
|
||||
require rust.inc
|
||||
|
||||
DEPENDS += "rust-llvm"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# ex: sts=4 et sw=4 ts=8
|
||||
inherit rust
|
||||
inherit rust-installer
|
||||
require rust-shared-source.inc
|
||||
require rust-snapshot-2016-05-24.inc
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
SUMMARY = "Rust runtime libaries"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
|
||||
inherit rust-bin
|
||||
|
||||
DEPENDS += "virtual/${TARGET_PREFIX}rust"
|
||||
RUSTLIB_DEP = ""
|
||||
|
||||
do_install () {
|
||||
for f in ${STAGING_DIR_NATIVE}/${rustlib_src}/*; do
|
||||
echo Installing $f
|
||||
install -D -m 755 $f ${D}/${rustlib}/$(basename $f)
|
||||
done
|
||||
}
|
||||
|
||||
# This has no license file
|
||||
python do_qa_configure() {
|
||||
return True
|
||||
}
|
||||
|
||||
FILES_${PN} += "${rustlib}/*.so"
|
||||
FILES_${PN}-dev += "${rustlib}/*.rlib"
|
||||
FILES_${PN}-staticdev += "${rustlib}/*.a"
|
||||
FILES_${PN}-dbg += "${rustlib}/.debug"
|
||||
Reference in New Issue
Block a user