diff --git a/pkgs/by-name/lu/lucky-commit/package.nix b/pkgs/by-name/lu/lucky-commit/package.nix index 99fef8610c6a..ab5adb72164d 100644 --- a/pkgs/by-name/lu/lucky-commit/package.nix +++ b/pkgs/by-name/lu/lucky-commit/package.nix @@ -20,6 +20,15 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-zuWPkaYltxOOLaR6NTVkf1WbKzUQByml45jNL+e5UJ0="; + # LLVM Apple assembler rejects `:lo12:` combined with `@PAGEOFF`. + postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + substituteInPlace "$cargoDepsCopy"/sha1-asm-*/src/aarch64_apple.S \ + --replace-fail "#:lo12:.K0@PAGEOFF" ".K0@PAGEOFF" \ + --replace-fail "#:lo12:.K1@PAGEOFF" ".K1@PAGEOFF" \ + --replace-fail "#:lo12:.K2@PAGEOFF" ".K2@PAGEOFF" \ + --replace-fail "#:lo12:.K3@PAGEOFF" ".K3@PAGEOFF" + ''; + buildInputs = lib.optional (withOpenCL && (!stdenv.hostPlatform.isDarwin)) ocl-icd; buildNoDefaultFeatures = !withOpenCL;