diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-11-01 10:17:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-02 09:21:29 +0000 |
commit | e33afcd0dca526c1991f5ed0062764481fe70e52 (patch) | |
tree | 9a8b4158b62a2582eb68d5ca3221b46b8b4bae94 | |
parent | 3565ea860a8c9c4a8dfb6edf2c1387c6077473ca (diff) | |
download | poky-e33afcd0dca526c1991f5ed0062764481fe70e52.tar.gz |
rust-common.bbclass: use built-in rust targets for -native builds
Rust targets have the form of 'arch-unknown-linux-gnu' while
oe's native targets are 'arch-linux-gnu', e.g. omit the vendor.
The effect this has on rust-native builds is that rust first builds
itself as stage0 for arch-unknown-linux-gnu, then builds itself
again for arch-unknown-linux-gnu, then finally uses the compiler
from second step to 'cross-compile' a compiler for 'arch-linux-gnu'.
This last step is really not necessary, and we could save 4 minutes
out of 12 if it is eliminated. Which is what this patch does
by setting the target directly to 'arch-unknown-linux-gnu'; rust's
build system then shortcuts the build process after the second step.
Given a working rust-native will be needed as early as possible in a
typical yocto build (e.g. when in a not too distant future making a
useful kernel will not be possible without rust), producing it faster
is important.
(From OE-Core rev: a918ea5645d8a67cedaf3ecf6c382520bbcad85b)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-recipe/rust-common.bbclass | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index 93bf6c8be6..3338de7502 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass | |||
@@ -53,12 +53,9 @@ def rust_base_triple(d, thing): | |||
53 | else: | 53 | else: |
54 | arch = oe.rust.arch_to_rust_arch(d.getVar('{}_ARCH'.format(thing))) | 54 | arch = oe.rust.arch_to_rust_arch(d.getVar('{}_ARCH'.format(thing))) |
55 | 55 | ||
56 | # When bootstrapping rust-native, BUILD must be the same as upstream snapshot tarballs | 56 | # Substituting "unknown" when vendor is empty will match rust's standard |
57 | bpn = d.getVar('BPN') | 57 | # targets when building native recipes (including rust-native itself) |
58 | if thing == "BUILD" and bpn in ["rust"]: | 58 | vendor = d.getVar('{}_VENDOR'.format(thing)) or "-unknown" |
59 | return arch + "-unknown-linux-gnu" | ||
60 | |||
61 | vendor = d.getVar('{}_VENDOR'.format(thing)) | ||
62 | 59 | ||
63 | # Default to glibc | 60 | # Default to glibc |
64 | libc = "-gnu" | 61 | libc = "-gnu" |