diff --git a/src/Compilation.zig b/src/Compilation.zig index 8efc911796..fbccb21557 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2037,6 +2037,10 @@ pub fn addCCArgs( if (!comp.bin_file.options.strip) { try argv.append("-g"); + switch (comp.bin_file.options.object_format) { + .coff, .pe => try argv.append("-gcodeview"), + else => {}, + } } if (comp.haveFramePointer()) {