From e2b79b10b57ac5b4484a94f4e54e87297d7c9591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 5 Jan 2019 16:58:51 +0100 Subject: [PATCH] afl: various cleanups --- pkgs/tools/security/afl/default.nix | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix index 067d355fb901..c90d031e989b 100644 --- a/pkgs/tools/security/afl/default.nix +++ b/pkgs/tools/security/afl/default.nix @@ -15,21 +15,18 @@ let url = "http://lcamtuf.coredump.cx/afl/releases/${name}.tgz"; sha256 = "0ig0ij4n1pwry5dw1hk4q88801jzzy2cric6y2gd6560j55lnqa3"; }; + enableParallelBuilding = true; # Note: libcgroup isn't needed for building, just for the afl-cgroup # script. - buildInputs = [ makeWrapper llvm which ]; + nativeBuildInputs = [ makeWrapper which ]; + buildInputs = [ llvm ]; - buildPhase = '' - make PREFIX=$out - cd llvm_mode - make PREFIX=$out - cd .. + makeFlags = [ "PREFIX=$(out)" ]; + postBuild = '' + make -C llvm_mode $makeFlags -j$NIX_BUILD_CORES ''; - installPhase = '' - # Do the normal installation - make install PREFIX=$out - + postInstall = '' # Install the custom QEMU emulator for binary blob fuzzing. cp ${afl-qemu}/bin/${qemu-exe-name} $out/bin/afl-qemu-trace @@ -55,9 +52,7 @@ let done ''; - passthru = { - qemu = afl-qemu; - }; + passthru.qemu = afl-qemu; meta = { description = "Powerful fuzzer via genetic algorithms and instrumentation"; @@ -78,5 +73,3 @@ let }; }; in afl - -