This is an automated email from the git hooks/post-receive script.
guix_mirror_bot pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new ab2fed9abc gnu: re2c: Fix build on armhf-linux.
ab2fed9abc is described below
commit ab2fed9abc74fc13df0d2c659b96915be403fd42
Author: Alexey Abramov <[email protected]>
AuthorDate: Sun Aug 31 09:17:29 2025 +0200
gnu: re2c: Fix build on armhf-linux.
* gnu/packages/re2c.scm (re2c)[arguments]: When building for armhf-linux
add a phase to apply a patch.
* gnu/packages/patches/re2c-Use-maximum-alignment.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
Change-Id: I9f056de47dc993b9ad779969f1eec71436c21160
Signed-off-by: Efraim Flashner <[email protected]>
---
gnu/local.mk | 1 +
.../patches/re2c-Use-maximum-alignment.patch | 48 ++++++++++++++++++++++
gnu/packages/re2c.scm | 16 +++++++-
3 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index bd86c88177..a25d0c015e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2239,6 +2239,7 @@ dist_patch_DATA =
\
%D%/packages/patches/racket-chez-scheme-bin-sh.patch \
%D%/packages/patches/racket-launcher-config-dir.patch \
%D%/packages/patches/racket-rktio-bin-sh.patch \
+ %D%/packages/patches/re2c-Use-maximum-alignment.patch \
%D%/packages/patches/reduce-unbundle-libffi.patch \
%D%/packages/patches/remake-impure-dirs.patch \
%D%/packages/patches/restartd-update-robust.patch \
diff --git a/gnu/packages/patches/re2c-Use-maximum-alignment.patch
b/gnu/packages/patches/re2c-Use-maximum-alignment.patch
new file mode 100644
index 0000000000..6d5b95354f
--- /dev/null
+++ b/gnu/packages/patches/re2c-Use-maximum-alignment.patch
@@ -0,0 +1,48 @@
+https://github.com/skvadrik/re2c/pull/555
+
+From 44125b74628d17f0a0a6cf9b51dd1f24169cd2d5 Mon Sep 17 00:00:00 2001
+From: Alexey Abramov <[email protected]>
+Date: Fri, 22 Aug 2025 08:10:08 +0200
+Subject: [PATCH] Use maximum alignment to ensure compatibility across all
+ architectures.
+
+---
+ src/util/allocator.h | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/util/allocator.h b/src/util/allocator.h
+index e6c85585b..56daf056f 100644
+--- a/src/util/allocator.h
++++ b/src/util/allocator.h
+@@ -3,6 +3,7 @@
+
+ #include <stdint.h>
+ #include <stdlib.h>
++#include <stddef.h>
+ #include <algorithm>
+ #include <vector>
+
+@@ -78,11 +79,16 @@ class slab_allocator_t {
+ };
+
+ // Use maximum alignment.
++// Use alignment based on pointer size: 32-bit platforms need stronger
alignment
++// for 64-bit types (double, long long), while 64-bit platforms are already
++// sufficiently aligned with pointer-sized alignment.
++constexpr size_t ALLOCATOR_ALIGNMENT = (sizeof(void*) == 4) ?
alignof(max_align_t) : sizeof(void*);
++
+ // Use different types to prevent accidentally mixing allocators for data
with different life spans.
+-using AstAllocator = slab_allocator_t<AllocatorKind::AST, 16 * 4096,
sizeof(void*)>;
+-using IrAllocator = slab_allocator_t<AllocatorKind::IR, 16 * 4096,
sizeof(void*)>;
+-using DfaAllocator = slab_allocator_t<AllocatorKind::DFA, 16 * 4096,
sizeof(void*)>;
+-using OutAllocator = slab_allocator_t<AllocatorKind::OUT, 16 * 4096,
sizeof(void*)>;
++using AstAllocator = slab_allocator_t<AllocatorKind::AST, 16 * 4096,
ALLOCATOR_ALIGNMENT>;
++using IrAllocator = slab_allocator_t<AllocatorKind::IR, 16 * 4096,
ALLOCATOR_ALIGNMENT>;
++using DfaAllocator = slab_allocator_t<AllocatorKind::DFA, 16 * 4096,
ALLOCATOR_ALIGNMENT>;
++using OutAllocator = slab_allocator_t<AllocatorKind::OUT, 16 * 4096,
ALLOCATOR_ALIGNMENT>;
+
+ } // namespace re2c
+
+--
+2.50.1
+
diff --git a/gnu/packages/re2c.scm b/gnu/packages/re2c.scm
index 7ff0dd9e4b..3eb898dd4c 100644
--- a/gnu/packages/re2c.scm
+++ b/gnu/packages/re2c.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2017, 2020 Sergei Trofimovich <[email protected]>
;;; Copyright © 2021 Sergei Trofimovich <[email protected]>
;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
+;;; Copyright © 2025 Alexey Abramov <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,7 +21,10 @@
(define-module (gnu packages re2c)
#:use-module (guix licenses)
+ #:use-module (guix gexp)
+ #:use-module (guix utils)
#:use-module (guix packages)
+ #:use-module (gnu packages)
#:use-module (gnu packages python)
#:use-module (guix download)
#:use-module (guix build-system gnu))
@@ -38,9 +42,19 @@
(base32
"07ysqgdm0h566a8lwnpdgycp93vz7zskzihsgah3bla0ycj2pp69"))))
(build-system gnu-build-system)
- (home-page "https://re2c.org/")
+ (arguments
+ (if (target-arm32?)
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-sources
+ (lambda _
+ (invoke "patch" "-p1" "--force" "--input"
+ #$(local-file (search-patch
+
"re2c-Use-maximum-alignment.patch")))))))
+ '()))
(native-inputs
(list python)) ; for the test driver
+ (home-page "https://re2c.org/")
(synopsis "Lexer generator for C/C++")
(description
"@code{re2c} generates minimalistic hard-coded state machine (as opposed