fix dwarf debuginfo being used in addition to CodeView on windows
Fixes the debuginfo size increase regression introduced by the DWARF5 support.
This commit is contained in:
parent
24699bcbad
commit
97510f2128
@ -97,23 +97,26 @@ pub fn finalize(&self, sess: &Session) {
|
||||
unsafe {
|
||||
llvm::LLVMRustDIBuilderFinalize(self.builder);
|
||||
|
||||
if !sess.target.is_like_msvc {
|
||||
// Debuginfo generation in LLVM by default uses a higher
|
||||
// version of dwarf than macOS currently understands. We can
|
||||
// instruct LLVM to emit an older version of dwarf, however,
|
||||
// for macOS to understand. For more info see #11352
|
||||
// This can be overridden using --llvm-opts -dwarf-version,N.
|
||||
// Android has the same issue (#22398)
|
||||
let dwarf_version =
|
||||
sess.opts.unstable_opts.dwarf_version.unwrap_or(sess.target.default_dwarf_version);
|
||||
let dwarf_version = sess
|
||||
.opts
|
||||
.unstable_opts
|
||||
.dwarf_version
|
||||
.unwrap_or(sess.target.default_dwarf_version);
|
||||
llvm::LLVMRustAddModuleFlag(
|
||||
self.llmod,
|
||||
llvm::LLVMModFlagBehavior::Warning,
|
||||
"Dwarf Version\0".as_ptr().cast(),
|
||||
dwarf_version,
|
||||
);
|
||||
|
||||
} else {
|
||||
// Indicate that we want CodeView debug information on MSVC
|
||||
if sess.target.is_like_msvc {
|
||||
llvm::LLVMRustAddModuleFlag(
|
||||
self.llmod,
|
||||
llvm::LLVMModFlagBehavior::Warning,
|
||||
|
Loading…
Reference in New Issue
Block a user