summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/rust-common.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* rust: cargo: Convert single-valued variables to weak defaultsAlex Kiernan2023-12-091-2/+2
| | | | | | | | | | All of these variables are single-valued, so we can use weak-defaults for them and only see the final assignment after parsing. (From OE-Core rev: 3221e82a35a149fdf38fe66dcd5de758ac1b9185) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-common.bbclass: Define rust arch for x32 platformsKhem Raj2023-12-021-0/+2
| | | | | | | | (From OE-Core rev: 02d6c89ca2e72e95d093282f5626e607060da588) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: drop PE, PR from /usr/src/debug pathsMartin Jansa2023-11-201-1/+1
| | | | | | | | (From OE-Core rev: e4931b1d6f147fc7ced080e30c63f0aaf0d1e7ff) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-common.bbclass: move musl-specific linking fix from rust-source.incAlexander Kanavin2023-06-271-0/+4
| | | | | | | | | | | This needs to be done for any item that is linked under rustc, and not just rust itself. Latest python-cryptography exposes the issue. (From OE-Core rev: d3811228747590ea06e8d68be4785d45ec9c478f) 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: Do not use default compiler flags defined in CC crateAnton Antonov2023-01-121-9/+19
| | | | | | | | | | | | | | | | | | | | | Rust crates build dependecy C libraries using "CC" crate. This crate adds some default compiler parameters depending on target arch. For some targets these parameters conflict with the parameters defined by OE. Warnings/errors like this can be seen in the case: cc1: error: switch '-mcpu=cortex-a15' conflicts with switch '-march=armv7-a+fp' [-Werror] Lets use only the OE parameters by exporting CRATE_CC_NO_DEFAULTS. https://github.com/rust-lang/cc-rs#external-configuration-via-environment-variables This patch fixes https://bugzilla.yoctoproject.org/show_bug.cgi?id=14947 (From OE-Core rev: 0c07089bdf7e0d7d8f37552db0bcd75f860979d9) Signed-off-by: Anton Antonov <Anton.Antonov@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: Enable baremetal targetsAlejandro Hernandez Samaniego2022-12-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Allow rust to build for baremetal targets by generating the proper target triple, follow the format specified by rusts Triple [1], that is: <arch>-<vendor>-<os>-<abi> This is done automatically based on both TARGET_OS and TCLIBC. For example, a riscv64 baremetal target triple would look like this: riscv64gc-poky-none-elf matching rusts own target triple for riscv64 according to platform-support [2] [1] https://docs.rs/target-lexicon/latest/target_lexicon/struct.Triple.html [2] https://doc.rust-lang.org/stable/rustc/platform-support.html (From OE-Core rev: 3bff689f0c5ea73076ce0510872b0552e8660cbe) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-common.bbclass: use built-in rust targets for -native buildsAlexander Kanavin2022-11-021-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* classes: Update classes to match new bitbake class scope functionalityRichard Purdie2022-08-121-0/+177
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. (From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>