Skip to content

Commit 338b726

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 11007c0 commit 338b726

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

+5-1
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)