From ad424ad8007e7fecba3adfedfdc4f760c9d6951f Mon Sep 17 00:00:00 2001 From: John Soo Date: Sun, 30 Oct 2022 10:16:38 -0700 Subject: [PATCH] arangodb: parameterize whether to enable asm optimizations As far as I can tell, this can cause compile failures when building the vendored abseil_cpp if choosing a target arch that does not support sse. This might be possible to determine programmatically, but it is more flexible to let the user decide. --- pkgs/servers/nosql/arangodb/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/servers/nosql/arangodb/default.nix b/pkgs/servers/nosql/arangodb/default.nix index c4498087da36..684f1b7a52ce 100644 --- a/pkgs/servers/nosql/arangodb/default.nix +++ b/pkgs/servers/nosql/arangodb/default.nix @@ -15,6 +15,7 @@ , lzo , which , targetArchitecture ? null +, asmOptimizations ? gcc10Stdenv.targetPlatform.isx86 }: let @@ -65,6 +66,9 @@ gcc10Stdenv.mkDerivation rec { # avoid reading /proc/cpuinfo for feature detection "-DTARGET_ARCHITECTURE=${targetArch}" + ] ++ lib.optionals asmOptimizations [ + "-DASM_OPTIMIZATIONS=ON" + "-DHAVE_SSE42=${if gcc10Stdenv.targetPlatform.sse4_2Support then "ON" else "OFF"}" ]; meta = with lib; {