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:
@@ -12,7 +12,7 @@ export CARGO_HOME = "${WORKDIR}/cargo_home"
|
||||
BASEDEPENDS_append = " cargo-native"
|
||||
|
||||
# Ensure we get the right rust variant
|
||||
DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust"
|
||||
DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}"
|
||||
|
||||
# Cargo only supports in-tree builds at the moment
|
||||
B = "${S}"
|
||||
|
||||
@@ -2,3 +2,7 @@ export rustlibdir = "${libdir}/rust"
|
||||
FILES_${PN} += "${rustlibdir}/*.so"
|
||||
FILES_${PN}-dev += "${rustlibdir}/*.rlib"
|
||||
FILES_${PN}-dbg += "${rustlibdir}/.debug"
|
||||
|
||||
RUSTLIB = "-L ${STAGING_LIBDIR}/rust"
|
||||
RUSTFLAGS += "-C rpath -C crate_hash=${BB_TASKHASH} ${RUSTLIB}"
|
||||
RUSTLIB_DEP ?= "libstd-rs"
|
||||
|
||||
@@ -2,11 +2,8 @@ inherit rust-vars
|
||||
|
||||
RUSTC = "rustc"
|
||||
|
||||
# FIXME: --sysroot might be needed
|
||||
RUSTFLAGS += "-C rpath -C crate_hash=${BB_TASKHASH}"
|
||||
RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} ${RUSTFLAGS}"
|
||||
|
||||
RUSTLIB_DEP ?= "rustlib"
|
||||
def rust_base_dep(d):
|
||||
# Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to
|
||||
# use rust instead of gcc
|
||||
|
||||
Reference in New Issue
Block a user