summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 11:47:39 -0300
committerGabriel Schneider <[email protected]>2026-11-10 12:01:16 -0300
commita0ca9a0bfa76cd2d04502b7f341cba5153f51899 (patch)
tree0864fc8d1dd07a72aab729beb03ae3fdc8f24076
parent62183e7ce8e6da7d22be451683376066a8bcd282 (diff)
downloadcomputeranim-a0ca9a0bfa76cd2d04502b7f341cba5153f51899.tar.gz
computeranim-a0ca9a0bfa76cd2d04502b7f341cba5153f51899.zip
build: C targets without UBSan, whose checks would be traced too
-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 });
}