diff --git a/fuzz/build.zig b/fuzz/build.zig index ee4accf..7d8bfc4 100644 --- a/fuzz/build.zig +++ b/fuzz/build.zig @@ -17,18 +17,10 @@ pub fn build(b: *std.Build) void { }); afl_obj.root_module.stack_check = false; afl_obj.root_module.link_libc = true; - afl_obj.root_module.fuzz = true; + //afl_obj.root_module.fuzz = true; afl_obj.root_module.addImport("xml", xml.module("xml")); - // TODO: ABI issues on my system - // const afl_exe = afl.addInstrumentedExe(b, target, .Debug, afl_obj); - const afl_exe = afl_exe: { - const run_afl_cc = b.addSystemCommand(&.{ "afl-cc", "-O3", "-o" }); - const afl_exe = run_afl_cc.addOutputFileArg(afl_obj.name); - run_afl_cc.addFileArg(b.dependency("zig-afl-kit", .{}).path("afl.c")); - run_afl_cc.addFileArg(afl_obj.getEmittedLlvmBc()); - break :afl_exe afl_exe; - }; + const afl_exe = afl.addInstrumentedExe(b, target, .Debug, afl_obj); const afl_exe_install = b.addInstallBinFile(afl_exe, "fuzz-xml"); b.getInstallStep().dependOn(&afl_exe_install.step); } diff --git a/fuzz/build.zig.zon b/fuzz/build.zig.zon index 78d98a2..cd28382 100644 --- a/fuzz/build.zig.zon +++ b/fuzz/build.zig.zon @@ -11,8 +11,9 @@ .path = "..", }, .@"zig-afl-kit" = .{ - .url = "git+https://github.com/kristoff-it/zig-afl-kit?ref=main#f003bfe714f2964c90939fdc940d5993190a66ec", - .hash = "1220f2d8402bb7bbc4786b9c0aad73910929ea209cbd3b063842371d68abfed33c1e", + // https://github.com/kristoff-it/zig-afl-kit/pull/1 + .url = "git+https://github.com/ianprime0509/zig-afl-kit?ref=afl-path#5b0770089d2144eb7bde61bb02604344ec5f5d24", + .hash = "1220208b7e29e54dd723ebba03cd41e358d10bb3d75477cb4b43f73db29844f9efb9", }, }, }