From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Thu, 7 Aug 2025 19:01:26 +0200
Subject: [PATCH] bootstrap: Workaround for system stage0

See: https://github.com/rust-lang/rust/issues/143735
---
 src/bootstrap/src/core/build_steps/compile.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 68a4f928464f..201d918d88a9 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -822,7 +822,10 @@ fn run(self, builder: &Builder<'_>) {
                 let _ = fs::remove_dir_all(sysroot.join("lib/rustlib/src/rust"));
             }
 
-            builder.cp_link_r(&builder.initial_sysroot.join("lib"), &sysroot.join("lib"));
+            builder.cp_link_r(
+                &builder.initial_sysroot.join("lib/rustlib"),
+                &sysroot.join("lib/rustlib"),
+            );
         } else {
             if builder.download_rustc() {
                 // Ensure there are no CI-rustc std artifacts.
