From 4eb8f4ece330734c59ee985f53e188aa894c22ac Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 16 May 2020 22:05:02 +0100 Subject: [PATCH 1/3] aflplusplus: 2.64c -> 2.65c --- pkgs/tools/security/aflplusplus/default.nix | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pkgs/tools/security/aflplusplus/default.nix b/pkgs/tools/security/aflplusplus/default.nix index f99be6d75758..ea32b6faf00e 100644 --- a/pkgs/tools/security/aflplusplus/default.nix +++ b/pkgs/tools/security/aflplusplus/default.nix @@ -17,26 +17,16 @@ let libtokencap = callPackage ./libtokencap.nix { inherit aflplusplus; }; aflplusplus = stdenvNoCC.mkDerivation rec { pname = "aflplusplus"; - version = "2.64c"; + version = "2.65c"; src = fetchFromGitHub { owner = "AFLplusplus"; repo = "AFLplusplus"; rev = version; - sha256 = "0n618pk6nlmkcbv1qm05fny4mnhcprrw0ppmra1phvk1y22iildj"; + sha256 = "1np2a3kypb2m8nyv6qnij18yzn41pl8619jzydci40br4vxial9l"; }; enableParallelBuilding = true; - # build of unsigaction32 broken in 2.64c: - # https://github.com/AFLplusplus/AFLplusplus/commit/079fdbf9bc5be1adba19e4bd08be965bd4dd79dc#commitcomment-38428357 - # The applied patch fixes it. - patches = [ - (fetchpatch { - url = "https://github.com/AFLplusplus/AFLplusplus/commit/5b9928f1a9d4b017ea04365ca8b522fde71236eb.patch"; - sha256 = "1m4w9w4jaxb2mjkwvr6r4qa2j5cdzzpchjphpwd95861h0zvb6hh"; - }) - ]; - # Note: libcgroup isn't needed for building, just for the afl-cgroup # script. nativeBuildInputs = [ makeWrapper which clang_9 gcc ]; @@ -123,7 +113,7 @@ let --replace '../libcompcov.so' '`$out/bin/get-afl-qemu-libcompcov-so`' \ --replace '../libdislocator.so' '`$out/bin/get-libdislocator-so`' \ --replace '../libtokencap.so' '`$out/bin/get-libtokencap-so`' - perl -pi -e 's|(? Date: Sat, 16 May 2020 22:07:46 +0100 Subject: [PATCH 2/3] aflplusplus: don't run unit tests with cmocka i don't think running the unit tests really adds anything given that we have proper integration tests working, and it just introduces another build dependency and possibility for spurious breakage. --- pkgs/tools/security/aflplusplus/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/aflplusplus/default.nix b/pkgs/tools/security/aflplusplus/default.nix index ea32b6faf00e..332e79e70e1d 100644 --- a/pkgs/tools/security/aflplusplus/default.nix +++ b/pkgs/tools/security/aflplusplus/default.nix @@ -1,6 +1,6 @@ { stdenv, stdenvNoCC, fetchFromGitHub, callPackage, makeWrapper , clang_9, llvm_9, gcc, which, libcgroup, python, perl, gmp -, file, cmocka, wine ? null, fetchpatch +, file, wine ? null, fetchpatch }: # wine fuzzing is only known to work for win32 binaries, and using a mixture of @@ -105,7 +105,7 @@ let wrapPythonProgramsIn $out/bin ${python.pkgs.pefile} ''; - installCheckInputs = [ perl file cmocka ]; + installCheckInputs = [ perl file ]; doInstallCheck = true; installCheckPhase = '' # replace references to tools in build directory with references to installed locations From d478d7a65b359e405b334e4b36845283e7c0b2cf Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 16 May 2020 22:13:56 +0100 Subject: [PATCH 3/3] aflplusplus: remove clang_9 and llvm_9 specificity i've successfully built this with llvm 8 and 6 now - make this easier to override --- pkgs/tools/security/aflplusplus/default.nix | 10 +++++----- pkgs/top-level/all-packages.nix | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/security/aflplusplus/default.nix b/pkgs/tools/security/aflplusplus/default.nix index 332e79e70e1d..a0ef58ae8b61 100644 --- a/pkgs/tools/security/aflplusplus/default.nix +++ b/pkgs/tools/security/aflplusplus/default.nix @@ -1,5 +1,5 @@ { stdenv, stdenvNoCC, fetchFromGitHub, callPackage, makeWrapper -, clang_9, llvm_9, gcc, which, libcgroup, python, perl, gmp +, clang, llvm, gcc, which, libcgroup, python, perl, gmp , file, wine ? null, fetchpatch }: @@ -29,16 +29,16 @@ let # Note: libcgroup isn't needed for building, just for the afl-cgroup # script. - nativeBuildInputs = [ makeWrapper which clang_9 gcc ]; - buildInputs = [ llvm_9 python gmp ] + nativeBuildInputs = [ makeWrapper which clang gcc ]; + buildInputs = [ llvm python gmp ] ++ stdenv.lib.optional (wine != null) python.pkgs.wrapPython; postPatch = '' # Replace the CLANG_BIN variables with the correct path substituteInPlace llvm_mode/afl-clang-fast.c \ - --replace "CLANGPP_BIN" '"${clang_9}/bin/clang++"' \ - --replace "CLANG_BIN" '"${clang_9}/bin/clang"' \ + --replace "CLANGPP_BIN" '"${clang}/bin/clang++"' \ + --replace "CLANG_BIN" '"${clang}/bin/clang"' \ --replace 'getenv("AFL_PATH")' "(getenv(\"AFL_PATH\") ? getenv(\"AFL_PATH\") : \"$out/lib/afl\")" # Replace "gcc" and friends with full paths in afl-gcc diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 51dec492b21e..296f442ec908 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -588,7 +588,8 @@ in }; aflplusplus = callPackage ../tools/security/aflplusplus { - stdenv = clangStdenv; + clang = clang_9; + llvm = llvm_9; python = python37; wine = null; };