authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-04 19:52:48 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-08 01:45:51 -07:00
logd7457589a5d85d3005e6e2dfc0748bb704e82bbb
treef0d00969ee86d4eca83a7c2e216aa32d74d65744
parentd972c0b2b595d264a5ab8496fc10f39beb6f5bc6
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.16.0


2 files changed, 6 insertions(+), 3 deletions(-)

build.zig+5-2
...@@ -31,6 +31,7 @@ pub fn build(b: *std.Build) void {...@@ -31,6 +31,7 @@ pub fn build(b: *std.Build) void {
31 //31 //
3232
33 const fuzz_exe = addFuzzer(b, target, "yaml", &.{});33 const fuzz_exe = addFuzzer(b, target, "yaml", &.{});
34 b.getInstallStep().dependOn(&fuzz_exe.step);
3435
35 const fuzz_run = b.addSystemCommand(&.{"afl-fuzz"});36 const fuzz_run = b.addSystemCommand(&.{"afl-fuzz"});
36 fuzz_run.step.dependOn(&fuzz_exe.step);37 fuzz_run.step.dependOn(&fuzz_exe.step);
...@@ -54,17 +55,19 @@ fn addFuzzer(b: *std.Build, target: std.Build.ResolvedTarget, comptime name: []c...@@ -54,17 +55,19 @@ fn addFuzzer(b: *std.Build, target: std.Build.ResolvedTarget, comptime name: []c
54 .optimize = .Debug,55 .optimize = .Debug,
55 }),56 }),
56 });57 });
57 fuzz_lib.want_lto = true;58 fuzz_lib.lto = .full;
58 fuzz_lib.bundle_compiler_rt = true;59 fuzz_lib.bundle_compiler_rt = true;
59 fuzz_lib.use_llvm = true;60 fuzz_lib.use_llvm = true;
60 fuzz_lib.use_lld = true;61 fuzz_lib.use_lld = true;
61 fuzz_lib.root_module.pic = true;62 fuzz_lib.root_module.pic = true;
63 fuzz_lib.root_module.link_libc = true;
64 fuzz_lib.bundle_ubsan_rt = true;
6265
63 deps.addAllTo(fuzz_lib);66 deps.addAllTo(fuzz_lib);
6467
65 const fuzz_executable_name = "fuzz-" ++ name;68 const fuzz_executable_name = "fuzz-" ++ name;
6669
67 const fuzz_compile = b.addSystemCommand(&.{ "afl-clang-lto", "-v", "-o" });70 const fuzz_compile = b.addSystemCommand(&.{ "afl-clang-lto", "-o" });
68 const output_path = fuzz_compile.addOutputFileArg(fuzz_executable_name);71 const output_path = fuzz_compile.addOutputFileArg(fuzz_executable_name);
69 fuzz_compile.addArtifactArg(fuzz_lib);72 fuzz_compile.addArtifactArg(fuzz_lib);
70 fuzz_compile.addArgs(afl_clang_args);73 fuzz_compile.addArgs(afl_clang_args);
fuzz/main.zig+1-1
...@@ -3,7 +3,7 @@ const yaml = @import("yaml");...@@ -3,7 +3,7 @@ const yaml = @import("yaml");
3const nfs = @import("nfs");3const nfs = @import("nfs");
44
5pub export fn main() void {5pub export fn main() void {
6 var gpa = std.heap.GeneralPurposeAllocator(.{}){};6 var gpa = std.heap.DebugAllocator(.{}){};
7 defer std.debug.assert(gpa.deinit() == .ok);7 defer std.debug.assert(gpa.deinit() == .ok);
8 const allocator = gpa.allocator();8 const allocator = gpa.allocator();
99