Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 439c323

Browse files
committed
Disable DWARF debuginfo on Windows
Windows uses PDB instead of DWARF and using DWARF debuginfo causes the linker to give an error
1 parent 7c5fbac commit 439c323

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ impl<'tcx> CodegenCx<'tcx> {
141141

142142
let unwind_context =
143143
UnwindContext::new(isa, matches!(backend_config.codegen_mode, CodegenMode::Aot));
144-
let debug_context = if debug_info { Some(DebugContext::new(tcx, isa)) } else { None };
144+
let debug_context = if debug_info && !tcx.sess.target.options.is_like_windows {
145+
Some(DebugContext::new(tcx, isa))
146+
} else {
147+
None
148+
};
145149
CodegenCx {
146150
tcx,
147151
global_asm: String::new(),

0 commit comments

Comments
 (0)