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="),
70437043.{
70447044 .name = "fno-sanitize=",
70457045 .syntax = .comma_joined,
7046 .zig_equivalent = .other,
7046 .zig_equivalent = .no_sanitize,
70477047 .pd1 = true,
70487048 .pd2 = false,
70497049 .psl = false,
src/main.zig+6-4
......@@ -2217,18 +2217,19 @@ fn buildOutputType(
22172217 mod_opts.strip = false;
22182218 create_module.opts.debug_format = .{ .dwarf = .@"64" };
22192219 },
2220 .sanitize => {
2220 .sanitize, .no_sanitize => |t| {
2221 const enable = t == .sanitize;
22212222 var san_it = std.mem.splitScalar(u8, it.only_arg, ',');
22222223 var recognized_any = false;
22232224 while (san_it.next()) |sub_arg| {
22242225 if (mem.eql(u8, sub_arg, "undefined")) {
2225 mod_opts.sanitize_c = true;
2226 mod_opts.sanitize_c = enable;
22262227 recognized_any = true;
22272228 } else if (mem.eql(u8, sub_arg, "thread")) {
2228 mod_opts.sanitize_thread = true;
2229 mod_opts.sanitize_thread = enable;
22292230 recognized_any = true;
22302231 } 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;
22322233 recognized_any = true;
22332234 }
22342235 }
......@@ -5904,6 +5905,7 @@ pub const ClangArgIterator = struct {
59045905 gdwarf32,
59055906 gdwarf64,
59065907 sanitize,
5908 no_sanitize,
59075909 linker_script,
59085910 dry_run,
59095911 verbose,
tools/update_clang_options.zig+4
......@@ -284,6 +284,10 @@ const known_options = [_]KnownOpt{
284284 .name = "fsanitize",
285285 .ident = "sanitize",
286286 },
287 .{
288 .name = "fno-sanitize",
289 .ident = "no_sanitize",
290 },
287291 .{
288292 .name = "T",
289293 .ident = "linker_script",