Skip to content

Commit

Permalink
build: use temporary version of zig-afl-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
ianprime0509 committed Sep 16, 2024
1 parent 8368219 commit fb2a0a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
12 changes: 2 additions & 10 deletions fuzz/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
5 changes: 3 additions & 2 deletions fuzz/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
}

0 comments on commit fb2a0a8

Please sign in to comment.