Skip to content

Commit

Permalink
Don't assume GCC toolchain supports the same dwarf format rust uses
Browse files Browse the repository at this point in the history
While it may be a fairly safe assumption that we can use the same dwarf version
rust uses (0fff25a) if we're compiling with clang, it might not be a valid
assumption for the Gnu toolchain.

Closes rust-lang#1075.
  • Loading branch information
mqudsi committed May 20, 2024
1 parent 3ba2356 commit d8762f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,12 @@ impl ToolFamily {
ToolFamily::Msvc { .. } => {
cmd.push_cc_arg("-Z7".into());
}
ToolFamily::Clang { .. } if dwarf_version.is_some() => {
cmd.push_cc_arg(format!("-gdwarf-{}", dwarf_version.unwrap()).into());
}
// Don't assume gcc supports the same dwarf version rust/llvm does (#1075)
ToolFamily::Gnu | ToolFamily::Clang { .. } => {
cmd.push_cc_arg(
dwarf_version
.map_or_else(|| "-g".into(), |v| format!("-gdwarf-{}", v))
.into(),
);
cmd.push_cc_arg("-g".into());
}
}
}
Expand Down

0 comments on commit d8762f3

Please sign in to comment.