diff options
author | 2022-08-05 13:15:31 +0100 | |
---|---|---|
committer | 2022-08-08 15:41:36 +0100 | |
commit | 9160e4a37561d8ac882057450a818621bec13bed (patch) | |
tree | cfc51e97afcc48e16c2584b3a10eaafb65f5da20 /meta/recipes-devtools | |
parent | b30ee171de9cd736d16d783410cf748e35309257 (diff) | |
download | openembedded-core-contrib-9160e4a37561d8ac882057450a818621bec13bed.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/cargo/cargo.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/libstd-rs.inc | 3 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/rust.inc | 5 |
3 files changed, 7 insertions, 3 deletions
diff --git a/meta/recipes-devtools/cargo/cargo.inc b/meta/recipes-devtools/cargo/cargo.inc index 607c51fc3d..978504052b 100644 --- a/meta/recipes-devtools/cargo/cargo.inc +++ b/meta/recipes-devtools/cargo/cargo.inc @@ -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 diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc index d49383ced5..1498b88f0e 100644 --- a/meta/recipes-devtools/rust/libstd-rs.inc +++ b/meta/recipes-devtools/rust/libstd-rs.inc @@ -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 diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 7d1f5347ea..172cd22657 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -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 |