summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/rust_1.75.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rust/rust_1.75.0.bb')
-rw-r--r--meta/recipes-devtools/rust/rust_1.75.0.bb23
1 files changed, 15 insertions, 8 deletions
diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb b/meta/recipes-devtools/rust/rust_1.75.0.bb
index 76e1fe2d84..c66c14cc5a 100644
--- a/meta/recipes-devtools/rust/rust_1.75.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.75.0.bb
@@ -11,6 +11,11 @@ DEPENDS += "file-native python3-native"
11DEPENDS:append:class-native = " rust-llvm-native" 11DEPENDS:append:class-native = " rust-llvm-native"
12DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" 12DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm"
13 13
14# native rust uses cargo/rustc from binary snapshots to bootstrap
15# but everything else should use our native builds
16DEPENDS:append:class-target = " cargo-native rust-native"
17DEPENDS:append:class-nativesdk = " cargo-native rust-native"
18
14DEPENDS += "rust-llvm (=${PV})" 19DEPENDS += "rust-llvm (=${PV})"
15 20
16RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" 21RDEPENDS:${PN}:append:class-target = " gcc g++ binutils"
@@ -35,8 +40,6 @@ RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-co
35# own vendoring. 40# own vendoring.
36CARGO_DISABLE_BITBAKE_VENDORING = "1" 41CARGO_DISABLE_BITBAKE_VENDORING = "1"
37 42
38# We can't use RUST_BUILD_SYS here because that may be "musl" if
39# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
40setup_cargo_environment () { 43setup_cargo_environment () {
41 # The first step is to build bootstrap and some early stage tools, 44 # The first step is to build bootstrap and some early stage tools,
42 # these are build for the same target as the snapshot, e.g. 45 # these are build for the same target as the snapshot, e.g.
@@ -48,14 +51,14 @@ setup_cargo_environment () {
48inherit rust-target-config 51inherit rust-target-config
49 52
50do_rust_setup_snapshot () { 53do_rust_setup_snapshot () {
51 for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do 54 for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do
52 "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig 55 "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig
53 done 56 done
54 57
55 # Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo 58 # Some versions of rust (e.g. 1.18.0) tries to find cargo in stage0/bin/cargo
56 # and fail without it there. 59 # and fail without it there.
57 mkdir -p ${RUSTSRC}/build/${BUILD_SYS} 60 mkdir -p ${RUSTSRC}/build/${RUST_BUILD_SYS}
58 ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${BUILD_SYS}/stage0 61 ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${RUST_BUILD_SYS}/stage0
59 62
60 # Need to use uninative's loader if enabled/present since the library paths 63 # Need to use uninative's loader if enabled/present since the library paths
61 # are used internally by rust and result in symbol mismatches if we don't 64 # are used internally by rust and result in symbol mismatches if we don't
@@ -70,6 +73,11 @@ addtask do_test_compile after do_configure do_rust_gen_targets
70do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" 73do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
71do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" 74do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"
72 75
76RUSTC_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/rustc"
77CARGO_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/cargo"
78RUSTC_BOOTSTRAP:class-native = "${WORKDIR}/rust-snapshot/bin/rustc"
79CARGO_BOOTSTRAP:class-native = "${WORKDIR}/rust-snapshot/bin/cargo"
80
73python do_configure() { 81python do_configure() {
74 import json 82 import json
75 import configparser 83 import configparser
@@ -141,12 +149,11 @@ python do_configure() {
141 config.add_section("build") 149 config.add_section("build")
142 config.set("build", "submodules", e(False)) 150 config.set("build", "submodules", e(False))
143 config.set("build", "docs", e(False)) 151 config.set("build", "docs", e(False))
144 config.set("build", "tools", ["rust-demangler",])
145 152
146 rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc") 153 rustc = d.getVar('RUSTC_BOOTSTRAP')
147 config.set("build", "rustc", e(rustc)) 154 config.set("build", "rustc", e(rustc))
148 155
149 cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo") 156 cargo = d.getVar('CARGO_BOOTSTRAP')
150 config.set("build", "cargo", e(cargo)) 157 config.set("build", "cargo", e(cargo))
151 158
152 config.set("build", "vendor", e(True)) 159 config.set("build", "vendor", e(True))