Skip to content

Commit 20cf861

Browse files
committed
fix: install dynamic_list.txt
1 parent 6336aaf commit 20cf861

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.zig

+10-2
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,12 @@ pub fn build(b: *std.Build) !void {
259259
});
260260
if (enable_lto) {
261261
llvm_c_flags.appendSliceAssumeCapacity(&.{
262-
"-DAFL_CLANG_LDPATH=1",
263-
"-DAFL_REAL_LD=\"lld\"",
264262
"-DAFL_CLANG_FLTO=\"-flto\"",
265263
});
264+
} else {
265+
llvm_c_flags.appendSliceAssumeCapacity(&.{
266+
"-DAFL_CLANG_FLTO=\"\"",
267+
});
266268
}
267269
if (target.query.isNative()) {
268270
llvm_c_flags.appendAssumeCapacity("-march=native");
@@ -385,6 +387,8 @@ pub fn build(b: *std.Build) !void {
385387
// LLVM instrumentation executable suite
386388
const llvm_exes_step = b.step("llvm_exes", "Install LLVM instrumentation executable suite");
387389

390+
const dynamic_list_install = b.addInstallFile(AFLplusplus_dep.path("dynamic_list.txt"), "dynamic_list.txt");
391+
388392
const cc_exe = b.addExecutable(.{
389393
.name = "afl-cc",
390394
.target = target,
@@ -401,6 +405,7 @@ pub fn build(b: *std.Build) !void {
401405
cc_exe.linkLibC();
402406

403407
const cc_exe_install = b.addInstallArtifact(cc_exe, .{});
408+
cc_exe_install.step.dependOn(&dynamic_list_install.step);
404409
cc_exe_install.step.dependOn(llvm_objs_step);
405410
cc_exe_install.step.dependOn(llvm_libs_step);
406411
llvm_exes_step.dependOn(&cc_exe_install.step);
@@ -420,6 +425,7 @@ pub fn build(b: *std.Build) !void {
420425
ld_lto_exe.linkLibC();
421426

422427
const ld_lto_exe_install = b.addInstallArtifact(ld_lto_exe, .{});
428+
ld_lto_exe_install.step.dependOn(&dynamic_list_install.step);
423429
ld_lto_exe_install.step.dependOn(llvm_objs_step);
424430
ld_lto_exe_install.step.dependOn(llvm_libs_step);
425431
llvm_exes_step.dependOn(&ld_lto_exe_install.step);
@@ -580,6 +586,8 @@ const LLVM_EXE_C_FLAGS = .{
580586
"-Wno-variadic-macros",
581587
"-Wno-deprecated-copy-with-dtor",
582588
"-DUSE_BINDIR=1",
589+
"-DAFL_REAL_LD=\"lld\"",
590+
"-DAFL_CLANG_LDPATH=1",
583591
};
584592

585593
const LLVM_EXE_CPP_FLAGS = .{

0 commit comments

Comments
 (0)