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.
This commit is contained in:
Jacob Young 2022-09-30 02:09:29 -04:00 committed by Andrew Kelley
parent 54eb0f2daa
commit 0d92c2ca5b

View File

@ -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}));
}