Bug 16406 - rust: Extend target registration to support all Poky/OE targets using placeholders
Summary: rust: Extend target registration to support all Poky/OE targets using placeho...
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 6.1
Hardware: All Multiple
: Medium enhancement
Target Milestone: 6.2 M3
Assignee: Deepesh Varatharajan
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-08-24 13:43 UTC by Deepesh Varatharajan
Modified: 2026-08-26 05:47 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepesh Varatharajan 2026-08-24 13:43:48 UTC
Current situation
-----------------

OE currently generates/uses custom Rust target specifications (JSON) for target triples that are not built-in Rust targets.

Custom target specifications are considered an unstable Rust feature and therefore require the "-Zunstable-options" flag when invoking rustc. As a result, building Rust code for these targets requires a nightly Rust compiler.

This limitation and the associated unstable-target behavior were from https://github.com/rust-lang/rust/pull/150151 and https://github.com/rust-lang/rust/pull/151534

Upstream Rust change
--------------------
We added built-in OE/Yocto base targets for the major architectures.
https://github.com/rust-lang/rust/pull/157650

These built-in base targets eliminate the need for OE to rely on custom target specifications for the supported target families.

Remaining OE work
-----------------
OE should consume these upstream Rust base targets through a generic target-registration mechanism instead of maintaining architecture-specific Rust target registrations or custom target specifications.

Enhancement
---------------------
Introduce placeholders/anchors for the Rust target triple, similar in concept to the existing OE distro/vendor placeholder used by the LLVM integration.

The placeholders should be populated from the existing OE target metadata so that the Rust target triple is generated according to the configured TARGET_* and ABI information.

This approach should allow the Rust target registration to cover the different Poky/OE target variants without requiring a separate hard-coded Rust target registration for each architecture or target configuration.