From 901f7ed6ba76cb97d149b6481dfb73887790c55b Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Samaniego Date: Thu, 15 Dec 2022 00:32:24 -0700 Subject: rust: Enable baremetal targets Allow rust to build for baremetal targets by generating the proper target triple, follow the format specified by rusts Triple [1], that is: --- 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/classes-recipe/rust-common.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'meta/classes-recipe/rust-common.bbclass') diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index 3338de7502..0f72e45e8c 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass @@ -66,6 +66,12 @@ def rust_base_triple(d, thing): elif "musl" in os: libc = "-musl" os = "linux" + elif "elf" in os: + libc = "-elf" + os = "none" + elif "eabi" in os: + libc = "-eabi" + os = "none" return arch + vendor + '-' + os + libc -- cgit v1.2.3-54-g00ecf