about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/build_system/src/build.rs
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2023-11-19 13:42:13 -0500
committerAntoni Boucher <bouanto@zoho.com>2023-11-19 13:42:13 -0500
commitfa696af9872dc2625496fb718e0703de8aa4b774 (patch)
tree8881eee6312e7c2bb98a8c068a99109ca2be0971 /compiler/rustc_codegen_gcc/build_system/src/build.rs
parent27794f95fdccda6a6ed292f6724b546cff35e13d (diff)
parent2e8386e9fb3506cef991d04f8b3bc78f9a0c2630 (diff)
downloadrust-fa696af9872dc2625496fb718e0703de8aa4b774.tar.gz
rust-fa696af9872dc2625496fb718e0703de8aa4b774.zip
Merge commit '2e8386e9fb3506cef991d04f8b3bc78f9a0c2630' into subtree-update_cg_gcc_2023-11-17
Diffstat (limited to 'compiler/rustc_codegen_gcc/build_system/src/build.rs')
-rw-r--r--compiler/rustc_codegen_gcc/build_system/src/build.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_gcc/build_system/src/build.rs b/compiler/rustc_codegen_gcc/build_system/src/build.rs
index eaca7a987d6..f1c3701a946 100644
--- a/compiler/rustc_codegen_gcc/build_system/src/build.rs
+++ b/compiler/rustc_codegen_gcc/build_system/src/build.rs
@@ -194,6 +194,12 @@ fn build_sysroot(
         copier,
     )?;
 
+    // Copy the source files to the sysroot (Rust for Linux needs this).
+    let sysroot_src_path = "sysroot/lib/rustlib/src/rust";
+    fs::create_dir_all(&sysroot_src_path)
+        .map_err(|error| format!("Failed to create directory `{}`: {:?}", sysroot_src_path, error))?;
+    run_command(&[&"cp", &"-r", &"sysroot_src/library/", &sysroot_src_path], None)?;
+
     Ok(())
 }