From 0d92c2ca5b13756d0b68e28d8921e3f63c2b6093 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 30 Sep 2022 02:09:29 -0400 Subject: [PATCH] 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. --- src/Compilation.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index f0d100cb9a..90f830384d 100644 --- 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})); }