new file mode 100644
@@ -0,0 +1,45 @@
+From e26974ca33aa322bbc60db5d1010899e40f6d624 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@wdc.com>
+Date: Fri, 9 Jan 2026 08:35:43 +1000
+Subject: [PATCH] bootstrap: minimal fix for ./x install src with build.docs =
+ false
+
+When running the `install src` command I'm seeing failures as the
+`builder.doc_out(host)` directory does not exist. This is because
+`match_paths_to_steps_and_run()` doesn't actually build any
+documentation as the `paths.is_empty()` causes an early return. This
+results in install failures as the `*/doc` src directory doesn't exist.
+
+This patch ensures that the builder.doc_out(host) directory exists.
+
+This fixes installing the Rust source when `build.docs = false`.
+
+This fixes installing the Rust source code in OpenEmbedded.
+
+Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/150845]
+Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
+Signed-off-by: Jieyou Xu <jieyouxu@outlook.com>
+---
+ src/bootstrap/src/core/build_steps/dist.rs | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
+index 2e291f7c2c3..28a7afd6c61 100644
+--- a/src/bootstrap/src/core/build_steps/dist.rs
++++ b/src/bootstrap/src/core/build_steps/dist.rs
+@@ -87,6 +87,12 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
+ // from a shared directory.
+ builder.run_default_doc_steps();
+
++ // In case no default doc steps are run for host, it is possible that `<host>/doc` directory
++ // is never created.
++ if !builder.config.dry_run() {
++ t!(fs::create_dir_all(builder.doc_out(host)));
++ }
++
+ let dest = "share/doc/rust/html";
+
+ let mut tarball = Tarball::new(builder, "rust-docs", &host.triple);
+--
+2.53.0
+
@@ -8,6 +8,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \
file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \
file://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \
+ file://0001-bootstrap-minimal-fix-for-.-x-install-src-with-build.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "e30d898272c587a22f77679f03c5e8192b5645c7c9ccc3407ad1106761507cea"
@@ -6,8 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc"
inherit rust
inherit cargo_common
+inherit pkgconfig
-DEPENDS += "llvm"
+DEPENDS += "llvm openssl"
# native rust uses cargo/rustc from binary snapshots to bootstrap
# but everything else should use our native builds
DEPENDS:append:class-target = " cargo-native rust-native"
@@ -284,6 +285,7 @@ do_install () {
rust_do_install() {
rust_runx install
+ rust_runx install src
}
rust_do_install:class-nativesdk() {