diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-05 13:25:46 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-08 15:44:20 +0100 |
| commit | 1c8444bd380d8caff4f09a02af2c15be928f5ae6 (patch) | |
| tree | 8854a17cd56b54decf17a1a52850200cc986ea9d /meta/recipes-devtools/rust/rust.inc | |
| parent | b1d8d2a3bfe40d83a651448bcd0eeb01434b7ad1 (diff) | |
| download | poky-1c8444bd380d8caff4f09a02af2c15be928f5ae6.tar.gz | |
rust-common/rust: Improve bootstrap BUILD_SYS handling
Move the "unknown" vendor workaround used during bootstrap to a
central location so it is applied consistently to all RUST_BUILD_SYS
values rather than some subset.
(From OE-Core rev: d02c28b2219d736c9598a13fead7a03eaa3256a6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust/rust.inc')
| -rw-r--r-- | meta/recipes-devtools/rust/rust.inc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 172cd22657..5730887411 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc | |||
| @@ -23,7 +23,6 @@ CARGO_DISABLE_BITBAKE_VENDORING = "1" | |||
| 23 | 23 | ||
| 24 | # We can't use RUST_BUILD_SYS here because that may be "musl" if | 24 | # We can't use RUST_BUILD_SYS here because that may be "musl" if |
| 25 | # TCLIBC="musl". Snapshots are always -unknown-linux-gnu | 25 | # TCLIBC="musl". Snapshots are always -unknown-linux-gnu |
| 26 | SNAPSHOT_BUILD_SYS = "${RUST_BUILD_ARCH}-unknown-linux-gnu" | ||
| 27 | setup_cargo_environment () { | 26 | setup_cargo_environment () { |
| 28 | # The first step is to build bootstrap and some early stage tools, | 27 | # The first step is to build bootstrap and some early stage tools, |
| 29 | # these are build for the same target as the snapshot, e.g. | 28 | # these are build for the same target as the snapshot, e.g. |
| @@ -31,7 +30,7 @@ setup_cargo_environment () { | |||
| 31 | # Later stages are build for the native target (i.e. target.x86_64-linux) | 30 | # Later stages are build for the native target (i.e. target.x86_64-linux) |
| 32 | cargo_common_do_configure | 31 | cargo_common_do_configure |
| 33 | 32 | ||
| 34 | printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config | 33 | printf '[target.%s]\n' "${RUST_BUILD_SYS}" >> ${CARGO_HOME}/config |
| 35 | printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config | 34 | printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config |
| 36 | } | 35 | } |
| 37 | 36 | ||
| @@ -89,7 +88,7 @@ python do_configure() { | |||
| 89 | 88 | ||
| 90 | # If we don't do this rust-native will compile it's own llvm for BUILD. | 89 | # If we don't do this rust-native will compile it's own llvm for BUILD. |
| 91 | # [target.${BUILD_ARCH}-unknown-linux-gnu] | 90 | # [target.${BUILD_ARCH}-unknown-linux-gnu] |
| 92 | build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) | 91 | build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS', True)) |
| 93 | config.add_section(build_section) | 92 | config.add_section(build_section) |
| 94 | 93 | ||
| 95 | config.set(build_section, "llvm-config", e(llvm_config_build)) | 94 | config.set(build_section, "llvm-config", e(llvm_config_build)) |
| @@ -136,7 +135,7 @@ python do_configure() { | |||
| 136 | 135 | ||
| 137 | # We can't use BUILD_SYS since that is something the rust snapshot knows | 136 | # We can't use BUILD_SYS since that is something the rust snapshot knows |
| 138 | # nothing about when trying to build some stage0 tools (like fabricate) | 137 | # nothing about when trying to build some stage0 tools (like fabricate) |
| 139 | config.set("build", "build", e(d.getVar("SNAPSHOT_BUILD_SYS", True))) | 138 | config.set("build", "build", e(d.getVar("RUST_BUILD_SYS", True))) |
| 140 | 139 | ||
| 141 | # [install] | 140 | # [install] |
| 142 | config.add_section("install") | 141 | config.add_section("install") |
