mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
hdrhistogram_c: apply patch (conditionally) to fix build on i686
This commit is contained in:
13
pkgs/by-name/hd/hdrhistogram_c/no-avx2-i386.patch
Normal file
13
pkgs/by-name/hd/hdrhistogram_c/no-avx2-i386.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/hdr_histogram.c b/src/hdr_histogram.c
|
||||
index b2041f8..a5dd8d7 100644
|
||||
--- a/src/hdr_histogram.c
|
||||
+++ b/src/hdr_histogram.c
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/* Runtime-dispatched AVX2 path: keep the rest of this TU at the project's
|
||||
baseline ISA so the shipped binary does not silently require AVX2. */
|
||||
-#if (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)) \
|
||||
+#if (defined(__x86_64__) || defined(_M_X64)) \
|
||||
&& (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
|
||||
# define HDR_HAS_AVX2_DISPATCH 1
|
||||
# include <immintrin.h>
|
||||
@@ -20,6 +20,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-LMZj7vuxOA1bgU/J10IKnyNe3R0dk2AA1ydLTHun4vg=";
|
||||
};
|
||||
|
||||
# Fix build on i686 by not trying to build AVX2 code
|
||||
# Submitted upstream: https://github.com/HdrHistogram/HdrHistogram_c/pull/143
|
||||
${if stdenv.hostPlatform.isi686 then "patches" else null} = [
|
||||
./no-avx2-i386.patch
|
||||
];
|
||||
|
||||
buildInputs = [ zlib ];
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
|
||||
Reference in New Issue
Block a user