{ fetchFromGitHub, makeWrapper, clang12Stdenv, llvmPackages_12, python3, automake, autoconf, which }:
clang12Stdenv.mkDerivation rec {
pname = "aflplusplus";
version = "4.02c";
src = fetchFromGitHub {
owner = "AFLplusplus";
repo = "AFLplusplus";
rev = version;
sha256 = "sha256-H0H2vJFKYEj+UFfoLzMkxu/ScCmpx40IYYNpcm42IRM=";
};
nativeBuildInputs = [
which
makeWrapper
llvmPackages_12.llvm
llvmPackages_12.bintools
automake
autoconf
];
buildInputs = [
(python3.withPackages (p: with p; [ setuptools ]))
];
makeFlags = [ "PREFIX=$(out)" "STATIC=1" ];
buildPhase = ''
# set -x
# llvm-config --bindir
# which ld.lld
# which clang
# to investigate the problem
make all
'';
postInstall = ''
patchShebangs $out/bin
'';
}
Which results in that the LTO version is not built, because it fails some checks:
GNUmakefile.llvm:126: we have trouble finding clang - llvm-config is not helping us
GNUmakefile.llvm:141: we have trouble finding clang++ - llvm-config is not helping us
GNUmakefile.llvm:224: ld.lld not found, cannot enable LTO mode
Reading the file we see that it tries to lookup ld.lld in the LLVM_BINDIR
Thanks, I tried that shortly after posting this, but the LLVM_BINDIR is also passed directly to the tool later, I’m assuming to give it access to “all” the LLVM tools.