Skip to content

Commit

Permalink
Fix: fix sccache bug for dwo file generate
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouronghua committed Oct 9, 2024
1 parent 29d17c7 commit 0e2d96f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ where
};
if split_dwarf {
let dwo = output.with_extension("dwo");
common_args.push(OsString::from("-D_gsplit_dwarf_path=".to_owned() + dwo.to_str().unwrap()));
// -gsplit-dwarf doesn't guarantee .dwo file if no -g is specified
outputs.insert(
"dwo",
Expand Down Expand Up @@ -1075,6 +1076,12 @@ mod test {
CompilerArguments::Ok(args) => args,
o => panic!("Got unexpected parse result: {:?}", o),
};
let mut common_and_arch_args = common_args.clone();
common_and_arch_args.extend(common_args.to_vec());
debug!(
"common_and_arch_args: {:?}",
common_and_arch_args
);
assert_eq!(Some("foo.cpp"), input.to_str());
assert_eq!(Language::Cxx, language);
assert_map_contains!(
Expand All @@ -1095,7 +1102,9 @@ mod test {
)
);
assert!(preprocessor_args.is_empty());
assert_eq!(ovec!["-gsplit-dwarf"], common_args);
assert!(common_args.contains(&"-gsplit-dwarf".into())
&& common_args.contains(&"-D_gsplit_dwarf_path=foo.dwo".into())
);
assert!(!msvc_show_includes);
}

Expand Down

0 comments on commit 0e2d96f

Please sign in to comment.