diff --git a/src/Compilation.zig b/src/Compilation.zig index 1eadf0640e0a43647fee4cf66b8a2c5f66a43870..48a0412b2395ead63c4c9888ebd6c36bbef2fdf5 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4483,7 +4483,11 @@ pub fn addCCArgs( if (!comp.bin_file.options.strip) { switch (target.ofmt) { - .coff => try argv.append("-gcodeview"), + .coff => { + // -g is required here because -gcodeview doesn't trigger debug info + // generation, it only changes the type of information generated. + try argv.appendSlice(&.{ "-g", "-gcodeview" }); + }, .elf, .macho => try argv.append("-gdwarf-4"), else => try argv.append("-g"), }