diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-04-03 07:23:23 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-04-04 06:08:10 +0200 |
| commit | c3e88a21fbe9c9e1d163bb7bef10cc5072aeb19e (patch) | |
| tree | 310bbfc066837fc6c9dab245f58f31dd07756883 /src | |
| parent | 7c5412c7a49ff1bd387dcfdea4e1cbf0985a40d4 (diff) | |
| download | zig-c3e88a21fbe9c9e1d163bb7bef10cc5072aeb19e.tar.gz zig-c3e88a21fbe9c9e1d163bb7bef10cc5072aeb19e.zip | |
compiler: Recognize -fno-sanitize=<...> in addition to -fsanitize=<...>.
Diffstat (limited to 'src')
| -rw-r--r-- | src/clang_options_data.zig | 2 | ||||
| -rw-r--r-- | src/main.zig | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig index 483433f1a3..6f636e90a3 100644 --- a/src/clang_options_data.zig +++ b/src/clang_options_data.zig @@ -7043,7 +7043,7 @@ joinpd1("fmsc-version="), .{ .name = "fno-sanitize=", .syntax = .comma_joined, - .zig_equivalent = .other, + .zig_equivalent = .no_sanitize, .pd1 = true, .pd2 = false, .psl = false, diff --git a/src/main.zig b/src/main.zig index a377b38494..9a4fd1112e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2217,18 +2217,19 @@ fn buildOutputType( mod_opts.strip = false; create_module.opts.debug_format = .{ .dwarf = .@"64" }; }, - .sanitize => { + .sanitize, .no_sanitize => |t| { + const enable = t == .sanitize; var san_it = std.mem.splitScalar(u8, it.only_arg, ','); var recognized_any = false; while (san_it.next()) |sub_arg| { if (mem.eql(u8, sub_arg, "undefined")) { - mod_opts.sanitize_c = true; + mod_opts.sanitize_c = enable; recognized_any = true; } else if (mem.eql(u8, sub_arg, "thread")) { - mod_opts.sanitize_thread = true; + mod_opts.sanitize_thread = enable; recognized_any = true; } else if (mem.eql(u8, sub_arg, "fuzzer") or mem.eql(u8, sub_arg, "fuzzer-no-link")) { - mod_opts.fuzz = true; + mod_opts.fuzz = enable; recognized_any = true; } } @@ -5904,6 +5905,7 @@ pub const ClangArgIterator = struct { gdwarf32, gdwarf64, sanitize, + no_sanitize, linker_script, dry_run, verbose, |
