diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 240847354043..497de69ba67d 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -657,7 +657,6 @@ pub fn producesPdbFile(compile: *Compile) bool { .windows, .uefi => {}, else => return false, } - if (target.abi.isGnu()) return false; if (target.ofmt == .c) return false; if (compile.root_module.strip == true or (compile.root_module.strip == null and compile.root_module.optimize == .ReleaseSmall)) diff --git a/src/Compilation.zig b/src/Compilation.zig index 38a1ca11ef76..e3673a5a3f84 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -6301,6 +6301,7 @@ fn buildOutputFromZig( .emit_bin = true, .root_optimize_mode = optimize_mode, .root_strip = strip, + .debug_format = comp.config.debug_format, .link_libc = comp.config.link_libc, }); @@ -6437,6 +6438,7 @@ pub fn build_crt_file( .emit_bin = true, .root_optimize_mode = comp.compilerRtOptMode(), .root_strip = comp.compilerRtStrip(), + .debug_format = comp.config.debug_format, .link_libc = false, .lto = switch (output_mode) { .Lib => comp.config.lto, diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig index 89de37e8ac73..75a83bf61387 100644 --- a/src/clang_options_data.zig +++ b/src/clang_options_data.zig @@ -4148,7 +4148,14 @@ flagpd1("g3"), .pd2 = false, .psl = false, }, -flagpd1("gcodeview"), +.{ + .name = "gcodeview", + .syntax = .flag, + .zig_equivalent = .gcodeview, + .pd1 = true, + .pd2 = false, + .psl = false, +}, flagpd1("gcodeview-command-line"), flagpd1("gcodeview-ghash"), flagpd1("gcolumn-info"), diff --git a/src/main.zig b/src/main.zig index 10fec66fa751..662f0b05eb2d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1538,7 +1538,10 @@ fn buildOutputType( create_module.opts.debug_format = .{ .dwarf = .@"32" }; } else if (mem.eql(u8, arg, "-gdwarf64")) { create_module.opts.debug_format = .{ .dwarf = .@"64" }; - } else if (mem.eql(u8, arg, "-fformatted-panics")) { + } else if (mem.eql(u8, arg, "-gcodeview")) { + create_module.opts.debug_format = .code_view; + } + else if (mem.eql(u8, arg, "-fformatted-panics")) { // Remove this after 0.15.0 is tagged. warn("-fformatted-panics is deprecated and does nothing", .{}); } else if (mem.eql(u8, arg, "-fno-formatted-panics")) { @@ -2160,6 +2163,10 @@ fn buildOutputType( try cc_argv.appendSlice(arena, it.other_args); } }, + .gcodeview => { + mod_opts.strip = false; + create_module.opts.debug_format = .code_view; + }, .gdwarf32 => { mod_opts.strip = false; create_module.opts.debug_format = .{ .dwarf = .@"32" }; @@ -5776,6 +5783,7 @@ pub const ClangArgIterator = struct { asm_only, optimize, debug, + gcodeview, gdwarf32, gdwarf64, sanitize, diff --git a/tools/update_clang_options.zig b/tools/update_clang_options.zig index b8916e5e6aac..de8caa1f59d9 100644 --- a/tools/update_clang_options.zig +++ b/tools/update_clang_options.zig @@ -252,6 +252,10 @@ const known_options = [_]KnownOpt{ .name = "debug", .ident = "debug", }, + .{ + .name = "gcodeview", + .ident = "gcodeview", + }, .{ .name = "gdwarf32", .ident = "gdwarf32",