mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
compilation: fix generating coff debug info on -gnu
The issue with just passing `-gcodeview` is that it's not part of the `OPT_g_Group` in `clang/Driver/Options.td`, so it doesn't trigger debug info to be generated. Passing only `-g` is sufficient on MSVC, as there is logic in `Clang.cpp` which enables codeview if that is the default for the toolchain. Since the default for -gnu is not codeview, we do pass `-gcodeview` in that case.
This commit is contained in:
parent
0e394cf922
commit
a1aa55ebe5
@ -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"),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user