aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-20 15:09:33 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-04-20 15:17:07 -0700
commitceff2782029672714ac2e04a7b3e25af23eb9a9b (patch)
tree959bfcee9176e487dfcd4488ada99364658f9a37 /src/main.zig
parentd026202a26e56e7e2ea20ca49509fdcf8b937020 (diff)
downloadzig-ceff2782029672714ac2e04a7b3e25af23eb9a9b.tar.gz
zig-ceff2782029672714ac2e04a7b3e25af23eb9a9b.zip
fixes to the previous commit
* CompileStep: Avoid calling producesPdbFile() to determine whether the option should be respected. If the user asks for it, put it on the command line and let the Zig CLI deal with it appropriately. * Make the namespace of `std.dwarf.Format.dwarf32` no longer have a redundant "dwarf" in it. * Add `zig cc` integration for `-gdwarf32` and `-gdwarf64`. * Toss in a bonus bug fix for `-gdwarf-2`, `-gdwarf-3`, etc. * Avoid using default init values for struct fields unnecessarily. * Add missing cache hash addition for the new option.
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index 81a83d580d..6a83791ca3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1357,9 +1357,9 @@ fn buildOutputType(
} else if (mem.eql(u8, arg, "-fno-strip")) {
strip = false;
} else if (mem.eql(u8, arg, "-gdwarf32")) {
- dwarf_format = .dwarf32;
+ dwarf_format = .@"32";
} else if (mem.eql(u8, arg, "-gdwarf64")) {
- dwarf_format = .dwarf64;
+ dwarf_format = .@"64";
} else if (mem.eql(u8, arg, "-fformatted-panics")) {
formatted_panics = true;
} else if (mem.eql(u8, arg, "-fno-formatted-panics")) {
@@ -1767,6 +1767,14 @@ fn buildOutputType(
try clang_argv.appendSlice(it.other_args);
}
},
+ .gdwarf32 => {
+ strip = false;
+ dwarf_format = .@"32";
+ },
+ .gdwarf64 => {
+ strip = false;
+ dwarf_format = .@"64";
+ },
.sanitize => {
if (mem.eql(u8, it.only_arg, "undefined")) {
want_sanitize_c = true;
@@ -5108,6 +5116,8 @@ pub const ClangArgIterator = struct {
asm_only,
optimize,
debug,
+ gdwarf32,
+ gdwarf64,
sanitize,
linker_script,
dry_run,