1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

rust: Generate per recipe target configuration files

Instead of generating target configuration files centrally and often getting
it wrong, or having trouble finding the right set, generate them dynamically
from the bbclass into WORKDIR per recipe.

(From OE-Core rev: 9160e4a37561d8ac882057450a818621bec13bed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2022-08-05 13:15:31 +01:00
parent 9a093d0348
commit b1d8d2a3bf
8 changed files with 26 additions and 22 deletions
+2
View File
@@ -18,6 +18,8 @@ EXCLUDE_FROM_WORLD = "1"
inherit cargo pkgconfig
RUST_TARGETGENS = "BUILD HOST TARGET"
do_cargo_setup_snapshot () {
${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
# Need to use uninative's loader if enabled/present since the library paths
+3
View File
@@ -12,6 +12,9 @@ DEPENDS:append:libc-musl = " libunwind"
DEPENDS:remove:riscv32 = "libunwind"
DEPENDS:remove:riscv64 = "libunwind"
RUST_TARGETGENS = "BUILD HOST TARGET"
# Embed bitcode in order to allow compiling both with and without LTO
RUSTFLAGS += "-Cembed-bitcode=yes"
# Needed so cargo can find libbacktrace
+2 -3
View File
@@ -12,9 +12,6 @@ DEPENDS:append:class-native = " rust-llvm-native"
S = "${RUSTSRC}"
# We generate local targets, and need to be able to locate them
export RUST_TARGET_PATH="${WORKDIR}/targets/"
export FORCE_CRATE_HASH="${BB_TASKHASH}"
RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
@@ -40,6 +37,8 @@ setup_cargo_environment () {
inherit rust-target-config
RUST_TARGETGENS = "BUILD HOST TARGET"
do_rust_setup_snapshot () {
for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do
"${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig