Remap path in MCOptions

This commit is contained in:
Andy Wang 2021-12-11 01:11:57 +00:00
parent 42190bb42e
commit 3d16a20c7a
No known key found for this signature in database
GPG Key ID: 181B49F9F38F3374

View File

@ -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 {