authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-03 07:23:23+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-04 06:08:10+02:00
logc3e88a21fbe9c9e1d163bb7bef10cc5072aeb19e
tree310bbfc066837fc6c9dab245f58f31dd07756883
parent7c5412c7a49ff1bd387dcfdea4e1cbf0985a40d4
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler: Recognize -fno-sanitize=<...> in addition to -fsanitize=<...>.


3 files changed, 11 insertions(+), 5 deletions(-)

src/clang_options_data.zig+1-1
...@@ -7043,7 +7043,7 @@ joinpd1("fmsc-version="),...@@ -7043,7 +7043,7 @@ joinpd1("fmsc-version="),
7043.{7043.{
7044 .name = "fno-sanitize=",7044 .name = "fno-sanitize=",
7045 .syntax = .comma_joined,7045 .syntax = .comma_joined,
7046 .zig_equivalent = .other,7046 .zig_equivalent = .no_sanitize,
7047 .pd1 = true,7047 .pd1 = true,
7048 .pd2 = false,7048 .pd2 = false,
7049 .psl = false,7049 .psl = false,
src/main.zig+6-4
...@@ -2217,18 +2217,19 @@ fn buildOutputType(...@@ -2217,18 +2217,19 @@ fn buildOutputType(
2217 mod_opts.strip = false;2217 mod_opts.strip = false;
2218 create_module.opts.debug_format = .{ .dwarf = .@"64" };2218 create_module.opts.debug_format = .{ .dwarf = .@"64" };
2219 },2219 },
2220 .sanitize => {2220 .sanitize, .no_sanitize => |t| {
2221 const enable = t == .sanitize;
2221 var san_it = std.mem.splitScalar(u8, it.only_arg, ',');2222 var san_it = std.mem.splitScalar(u8, it.only_arg, ',');
2222 var recognized_any = false;2223 var recognized_any = false;
2223 while (san_it.next()) |sub_arg| {2224 while (san_it.next()) |sub_arg| {
2224 if (mem.eql(u8, sub_arg, "undefined")) {2225 if (mem.eql(u8, sub_arg, "undefined")) {
2225 mod_opts.sanitize_c = true;2226 mod_opts.sanitize_c = enable;
2226 recognized_any = true;2227 recognized_any = true;
2227 } else if (mem.eql(u8, sub_arg, "thread")) {2228 } else if (mem.eql(u8, sub_arg, "thread")) {
2228 mod_opts.sanitize_thread = true;2229 mod_opts.sanitize_thread = enable;
2229 recognized_any = true;2230 recognized_any = true;
2230 } else if (mem.eql(u8, sub_arg, "fuzzer") or mem.eql(u8, sub_arg, "fuzzer-no-link")) {2231 } else if (mem.eql(u8, sub_arg, "fuzzer") or mem.eql(u8, sub_arg, "fuzzer-no-link")) {
2231 mod_opts.fuzz = true;2232 mod_opts.fuzz = enable;
2232 recognized_any = true;2233 recognized_any = true;
2233 }2234 }
2234 }2235 }
...@@ -5904,6 +5905,7 @@ pub const ClangArgIterator = struct {...@@ -5904,6 +5905,7 @@ pub const ClangArgIterator = struct {
5904 gdwarf32,5905 gdwarf32,
5905 gdwarf64,5906 gdwarf64,
5906 sanitize,5907 sanitize,
5908 no_sanitize,
5907 linker_script,5909 linker_script,
5908 dry_run,5910 dry_run,
5909 verbose,5911 verbose,
tools/update_clang_options.zig+4
...@@ -284,6 +284,10 @@ const known_options = [_]KnownOpt{...@@ -284,6 +284,10 @@ const known_options = [_]KnownOpt{
284 .name = "fsanitize",284 .name = "fsanitize",
285 .ident = "sanitize",285 .ident = "sanitize",
286 },286 },
287 .{
288 .name = "fno-sanitize",
289 .ident = "no_sanitize",
290 },
287 .{291 .{
288 .name = "T",292 .name = "T",
289 .ident = "linker_script",293 .ident = "linker_script",