summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig5
1 files 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 });
}