Rust follows the train release model via the stable, beta and nightly channels,
by default we build rust from the stable channel, however there are certain
features which are only available in the beta or nightly channels.
Make these channels available by setting a RUST_CHANNEL variable which defaults
to stable making this change transparent to the user.
The snapshot version used by rust during its compilation wont necessarily match
the version being built, specially if were building from an unstable channel,
to avoid confusion rename this to SNAPSHOT_VERSION and use RUST_VERSION for the
version to be built, which is automatically defined to PV.
Append -beta or -nightly to rusts PV for signature awareness.
It is important to note that this does not build rust from the beta/nightly
published tarball (which today build rust v1.67.0 and v1.68.0 respectively),
instead this builds rust from the current selected version (1.66.0) and enables
the beta/nightly features for that version.
Setting the variable RUST_CHANNEL=nightly results in the following:
$ rustc -Vv
rustc 1.66.0-nightly
(From OE-Core rev: 807a52686682d0d0a151ea3dadd99880feb67cc0)
Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-clang has options when it comes to C++ runtime, default is to use
gnu runtime, other options are llvm runtime and android runtime. This
patch helps when a distro is using llvm runtime for C/C++ runtime. It
informs the rust build system about right C++ runtime to configure for
when such a setting is used.
(From OE-Core rev: 521872ab2cac092c88446730772cb8c4e22b0cdc)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Emits complete details regarding the test results to understand
and debug from logfiles
(From OE-Core rev: 78aecd6d4e443cb467e9a8007f2db29943dfdd1f)
Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Adds the cross compilation linker for build, host and target.
Ensure the main rust config has the appropriate sections added
to match the configurations.
(From OE-Core rev: 02133f92c56c90a5365985b515953e4136e112aa)
Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
These match the default from the class so drop them. We then always
generate all targets so remove the configuration from the class.
(From OE-Core rev: e4d56256936c55bab2bf2934ccbde9157ef7dc57)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
To ensure buildpaths aren't encoded in the debug symbol output, ensure
we pass our prefix remapping compiler options in.
(From OE-Core rev: c7a529743560c37973787e4ab2433cb7485afb86)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Musl targets need a sysroot set to find the musl static libraries. Set this
appropriately in musl builds.
(From OE-Core rev: 1c5ab57ddda393631ce2da97ef5a876a2020d51f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Enable rust target builds as well as nativesdk-rust for the sdk. Merge
the builds of rust-tools components into the rust build, packaged separately
since this is a lot more efficient and saves rebuilding core rust multiple
times. The tools are not target specific so nativesdk-rust-tools suffices
and we can drop the cross canadian piece.
(From OE-Core rev: b9b0cd99cdc77e7a90e5fd5711e706ebe64c7b6b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
For cross compilation, build, host and target may be different. Ensure
the main rust config has the appropriate sections added to match the
configurations.
(From OE-Core rev: e2cdbf9df8d3f90b5a7ba35288c5db4f252d134d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Improve the common class to handle BUILD_SYS as well as host and target,
removing the need to a workaround in the rust recipe.
(From OE-Core rev: 0dc9635c28c269f782ad4ed6ea06b4e4de1beb8e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>
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 variable is no longer used by the llvm patches.
(From OE-Core rev: 35e1ecf88cf9725e1ba43c948e90359df983002f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
We need llvm-config for the target but the cross compiled target binary is
no good. We can copy the native one into the target location where it will
then return the target values though.
(From OE-Core rev: f355e55c1fcef57f288279ffb47ebeb52a72b689)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Instead of reusing a "target_section" variable, name them host and build
section instead. This patch sets things up for other improvementsm,
separating out the renaming.
(From OE-Core rev: 279b809e8306b0eb6ae6caeb6b0a3c3c62d2f9d2)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
The code was using a mixture of XXX_SYS and RUST_XXX_SYS. Use
RUST_XXX_SYS consistently and add the variables to the global exclsion
on signatures as they're reflected in the directory triplets and trying
to filter them out the hashes separately is too painful.
(From OE-Core rev: ee0c0fdf9c1eba9eece6ed1293fda25bf18964b3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Currently most of the rust recipes use this code but it is all piecemeal.
Turn the code into a class where things can start to be rationalised. Ultimately
some of the data and python code should be moved to a python library but one step
at a time.
No functionality changes.
(From OE-Core rev: 3795285cbf362e13b8151bfdbe1bce999ac28641)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Drop the two libstdc patches as they've finally appeared upstream.
Disable the use of libstdc++.a from the host distributions, as it results
in cross-distro contamination in rust-native.
(From OE-Core rev: 94760bc118952160865352c10ca7693680b5ce7e)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
RUST_BUILD_ARCH contains the arch_to_rust_arch()-translated value of
BUILD_ARCH. This is necessary to acquire the correct snapshot artifacts
under Linux where `uname -m` reports "ppc64le" rather than
"powerpc64le".
Change-Id: I6aec23aced8e1c6f0bfc46fe52531b0c16bcf687
(From OE-Core rev: c13afbade8d480807b9de70c56dcd650496f06b2)
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
If we use an external buildtools tarball, that combined with uninative results
in build failures with symbol mismatches. This was tracked down to the prebuilt
rust binaries that are downloaded. The libc/loader used to load them is used to
execute target binaries/libraries and therefore anything with built with a newer
libc would fail.
Add code to use patchelf to change the interpreter to our own uninative one if
present which ensures the newer libc and loader are used, hence avoiding the issue.
(From OE-Core rev: 099c761ffddcc828329d3083cc8f3d24b43e9277)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>