libstd-rs: cross compile rust's runtime
This can replace rustlib, which just copies the binaries already built by rust-cross.
This commit is contained in:
23
recipes-devtools/rust/compiler-rt.bb
Normal file
23
recipes-devtools/rust/compiler-rt.bb
Normal file
@@ -0,0 +1,23 @@
|
||||
SUMMARY = "Rust compiler run-time"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT"
|
||||
|
||||
require rust-shared-source.inc
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=27b14ab4ce08d04c3a9a5f0ed7997362"
|
||||
|
||||
S .= "/src/compiler-rt"
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
do_compile () {
|
||||
oe_runmake -C ${S} \
|
||||
ProjSrcRoot="${S}" \
|
||||
ProjObjRoot="${B}" \
|
||||
TargetTriple=${HOST_SYS} \
|
||||
triple-builtins
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${libdir}
|
||||
cp triple/builtins/libcompiler_rt.a ${D}${libdir}/libcompiler-rt.a
|
||||
}
|
||||
30
recipes-devtools/rust/libstd-rs.bb
Normal file
30
recipes-devtools/rust/libstd-rs.bb
Normal file
@@ -0,0 +1,30 @@
|
||||
SUMMARY = "Rust standard libaries"
|
||||
HOMEPAGE = "http://www.rust-lang.org"
|
||||
SECTION = "devel"
|
||||
LICENSE = "MIT | Apache-2.0"
|
||||
|
||||
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8"
|
||||
require rust-shared-source.inc
|
||||
|
||||
DEPENDS += "compiler-rt"
|
||||
|
||||
RUSTLIB_DEP = ""
|
||||
inherit cargo_util
|
||||
|
||||
# Needed so cargo can find libbacktrace
|
||||
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
|
||||
do_compile () {
|
||||
cd ${S}/src/rustc/std_shim
|
||||
export CARGO_TARGET_DIR="${B}"
|
||||
export RUSTC_BOOTSTRAP_KEY="e8edd0fd"
|
||||
oe_cargo_fix_env
|
||||
oe_cargo_build
|
||||
}
|
||||
|
||||
do_install () {
|
||||
mkdir -p ${D}${rustlibdir}
|
||||
cp ${B}/${TARGET_SYS}/release/deps/* ${D}${rustlibdir}
|
||||
}
|
||||
Reference in New Issue
Block a user