From ab8e2e46d9e0e7be3158b473c4b59fec8f79287b Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 11 May 2021 12:01:35 +0000 Subject: [PATCH] hashcat: fixup opencl support (#121961) This fixes the following compilation error: ``` clBuildProgram(): CL_BUILD_PROGRAM_FAILURE /run/user/1000/comgr-64ff7f/input/CompileSource:2252:18: fatal error: cannot open file '/run/user/1000/comgr-64ff7f/input/inc_comp_multi_bs.cl': No such file or directory #include COMPARE_M ^ /run/user/1000/comgr-64ff7f/input/CompileSource:16:19: note: expanded from macro 'COMPARE_M' ^ 1 error generated. Error: Failed to compile opencl source (from CL or HIP source to LLVM IR). ``` Signed-off-by: Arthur Gautier --- pkgs/tools/security/hashcat/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index 173fdc8b18d2..ba46fbde2d62 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -28,7 +28,9 @@ stdenv.mkDerivation rec { preFixup = '' for f in $out/share/hashcat/OpenCL/*.cl; do + # Rewrite files to be included for compilation at runtime for opencl offload sed "s|#include \"\(.*\)\"|#include \"$out/share/hashcat/OpenCL/\1\"|g" -i "$f" + sed "s|#define COMPARE_\([SM]\) \"\(.*\.cl\)\"|#define COMPARE_\1 \"$out/share/hashcat/OpenCL/\2\"|g" -i "$f" done '';