about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAndy Wang <cbeuw.andy@gmail.com>2021-12-11 01:11:57 +0000
committerAndy Wang <cbeuw.andy@gmail.com>2021-12-11 01:11:57 +0000
commit3d16a20c7aa117773a957db9893f83a1cb3bd653 (patch)
tree2039c068074ae748bbdf984420414d156813d999 /compiler/rustc_codegen_llvm/src
parent42190bb42e06f87e24f9b4280a996175e97b73ab (diff)
downloadrust-3d16a20c7aa117773a957db9893f83a1cb3bd653.tar.gz
rust-3d16a20c7aa117773a957db9893f83a1cb3bd653.zip
Remap path in MCOptions
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index 8a73890ba9d..1ddc0cf8b9b 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -205,8 +205,11 @@ pub fn target_machine_factory(
     let use_init_array =
         !sess.opts.debugging_opts.use_ctors_section.unwrap_or(sess.target.use_ctors_section);
 
+    let path_mapping = sess.source_map().path_mapping().clone();
+
     Arc::new(move |config: TargetMachineFactoryConfig| {
-        let split_dwarf_file = config.split_dwarf_file.unwrap_or_default();
+        let split_dwarf_file =
+            path_mapping.map_prefix(config.split_dwarf_file.unwrap_or_default()).0;
         let split_dwarf_file = CString::new(split_dwarf_file.to_str().unwrap()).unwrap();
 
         let tm = unsafe {