guix_mirror_bot pushed a commit to branch javascript-team in repository guix.
commit b5111279ff45f966f725d2b9b41dbe5dc81b3c80 Author: Jelle Licht <[email protected]> AuthorDate: Mon Sep 7 21:37:02 2026 +0200 gnu: Add hdrhistogram-c. * gnu/packages/c.scm (hdrhistogram-c): New variable. * gnu/packages/patches/hdrhistogram-c-no-avx2-on-i386.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Modified-by: Maxim Cournoyer <[email protected]> --- gnu/local.mk | 1 + gnu/packages/c.scm | 39 ++++++++++++++++++++++ .../patches/hdrhistogram-c-no-avx2-on-i386.patch | 23 +++++++++++++ 3 files changed, 63 insertions(+) diff --git a/gnu/local.mk b/gnu/local.mk index b0deee3e180..e32eac1ba7b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1624,6 +1624,7 @@ dist_patch_DATA = \ %D%/packages/patches/hdf-eos5-remove-gctp.patch \ %D%/packages/patches/hdf-eos5-fix-szip.patch \ %D%/packages/patches/hdf-eos5-fortrantests.patch \ + %D%/packages/patches/hdrhistogram-c-no-avx2-on-i386.patch \ %D%/packages/patches/heatshrink-add-cmake.patch \ %D%/packages/patches/heimdal-CVE-2022-45142.patch \ %D%/packages/patches/helm-fix-gcc-9-build.patch \ diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index 1f1e1ec4d60..a6ed5fc34a8 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -27,6 +27,7 @@ ;;; Copyright © 2026 Cayetano Santos <[email protected]> ;;; Copyright © 2026 Sharlatan Hellseher <[email protected]> ;;; Copyright © 2026 Sughosha <[email protected]> +;;; Copyright © 2026 Jelle Licht <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +66,7 @@ #:use-module (gnu packages bison) #:use-module (gnu packages check) #:use-module (gnu packages compiler-tools) + #:use-module (gnu packages compression) #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages perl) @@ -324,6 +326,43 @@ common extended features of widespread compilers like @code{gcc} and (home-page "https://sr.ht/~mcf/cproc") (license license:expat)))) +(define-public hdrhistogram-c + (package + (name "hdrhistogram-c") + (version "0.11.10") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/HdrHistogram/HdrHistogram_c") + (commit version))) + (file-name (git-file-name name version)) + (sha256 (base32 + "1y72lxxlqjr7sw0614qx3pfmw8wz191dgjagh5dhsf5izgp67iic")) + (patches (search-patches "hdrhistogram-c-no-avx2-on-i386.patch")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(if #$(target-ppc32?) + (list "-DCMAKE_EXE_LINKER_FLAGS=-latomic" + "-DCMAKE_SHARED_LINKER_FLAGS=-latomic") + '()))) + (inputs (list zlib)) + (home-page "https://github.com/HdrHistogram/HdrHistogram_c") + (synopsis "C port of the HdrHistogram") + (description "This is a C port of HdrHistogram, which contains a subset of +the functionality supported by the Java implementation. The current supported +features are: +@enumerate +@item Intercept any memory access or directly map real memory ranges. +@item Standard histogram with 64 bit counts (32/16 bit counts not supported). +@item All iterator types (all values, recorded, percentiles, linear, logarithmic)> +@item Histogram serialisation (encoding version 1.2, decoding 1.0-1.2). +@item Reader/writer phaser and interval recorder. +@end enumerate") + (license license:cc0))) + (define-public minini (package (name "minini") diff --git a/gnu/packages/patches/hdrhistogram-c-no-avx2-on-i386.patch b/gnu/packages/patches/hdrhistogram-c-no-avx2-on-i386.patch new file mode 100644 index 00000000000..754d777a264 --- /dev/null +++ b/gnu/packages/patches/hdrhistogram-c-no-avx2-on-i386.patch @@ -0,0 +1,23 @@ +From 164bb946e213d657334325f2b1f3f27a2ce39f80 Mon Sep 17 00:00:00 2001 +From: K900 <[email protected]> +Date: Fri, 17 Jul 2026 15:31:35 +0300 +Subject: [PATCH] Don't attempt AVX2 on i386 + +There is no AVX2 on i386. +--- + src/hdr_histogram.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/hdr_histogram.c b/src/hdr_histogram.c +index a34de2c..1ec32e6 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>
