Skip to content

Commit 5b5349e

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 d459445 commit 5b5349e

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
@@ -142,7 +142,11 @@ impl<'tcx> CodegenCx<'tcx> {
142142

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

0 commit comments

Comments
 (0)