From a0ca9a0bfa76cd2d04502b7f341cba5153f51899 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 11:47:39 -0300 Subject: build: C targets without UBSan, whose checks would be traced too --- build.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index e49bb65..7569650 100644 --- a/build.zig +++ b/build.zig @@ -13,9 +13,10 @@ pub const Ctx = struct { test_step: *std.Build.Step, /// A C program to trace, from `targets/`: -O1 with debug info, frame - /// pointers kept, so its code is short and still maps to its source. + /// pointers kept, so its code is short and still maps to its source; no + /// UBSan (Zig's default in Debug), whose checks would be traced too. pub fn cTarget(ctx: Ctx, name: []const u8, files: []const []const u8) *std.Build.Step.Compile { - const mod = ctx.b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false }); + const mod = ctx.b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false, .sanitize_c = .off }); mod.addCSourceFiles(.{ .root = ctx.b.path("targets"), .files = files, .flags = &.{ "-O1", "-g", "-fno-omit-frame-pointer" } }); return ctx.b.addExecutable(.{ .name = name, .root_module = mod }); } -- cgit v1.3