zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0d92c2ca5b13756d0b68e28d8921e3f63c2b6093 (tree)
parent 54eb0f2daa2cf5237da05e3cfad5800b9ccf424e
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Fri, 30 Sep 2022 02:09:29 -0400

stage2: add support for assembly debug info

Pulls out the -g cc flag addition to the common area so that it is also
applied to assembly files.

Diffstat:
Msrc/Compilation.zig | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -4207,14 +4207,6 @@ pub fn addCCArgs( else => {}, } - if (!comp.bin_file.options.strip) { - switch (target.ofmt) { - .coff => try argv.append("-gcodeview"), - .elf, .macho => try argv.append("-gdwarf-4"), - else => try argv.append("-g"), - } - } - if (target.cpu.arch.isThumb()) { try argv.append("-mthumb"); } @@ -4356,6 +4348,14 @@ pub fn addCCArgs( }, } + if (!comp.bin_file.options.strip) { + switch (target.ofmt) { + .coff => try argv.append("-gcodeview"), + .elf, .macho => try argv.append("-gdwarf-4"), + else => try argv.append("-g"), + } + } + if (target_util.llvmMachineAbi(target)) |mabi| { try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); }