Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Unbreak dwz on sparc64
To:
ports@openbsd.org
Cc:
bcallah@openbsd.org
Date:
Fri, 28 Nov 2025 13:12:40 +0100

Download raw body.

Thread
Seen while poking at espeak on sparc64:

> Extracting debug info from /usr/ports/pobj/espeak-1.52.0/fake-sparc64/usr/local/bin/espeak-ng
Bus error (core dumped)

xxhash is broken on strict alignment archs and needs a patch to
work correctly. This copies over sthen's patch from sysutils/xxhash
and fixes the problem.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/dwz/Makefile,v
diff -u -p -r1.9 Makefile
--- Makefile	5 Sep 2025 16:38:51 -0000	1.9
+++ Makefile	28 Nov 2025 12:08:54 -0000
@@ -4,6 +4,8 @@ XXHASH_V =	0.8.3
 DISTFILES =	${PKGNAME}.tar.gz
 DISTFILES.h= 	xxhash-${XXHASH_V}{xxhash}.h
 
+REVISION =	0
+
 CATEGORIES =	devel
 
 HOMEPAGE =	https://sourceware.org/dwz/
Index: patches/patch-xxhash_h
===================================================================
RCS file: patches/patch-xxhash_h
diff -N patches/patch-xxhash_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-xxhash_h	28 Nov 2025 11:59:21 -0000
@@ -0,0 +1,17 @@
+Index: xxhash.h
+--- xxhash.h.orig
++++ xxhash.h
+@@ -2297,8 +2297,11 @@ XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3
+    /* prefer __packed__ structures (method 1) for GCC
+     * < ARMv7 with unaligned access (e.g. Raspbian armhf) still uses byte shifting, so we use memcpy
+     * which for some reason does unaligned loads. */
+-#  if defined(__GNUC__) && !(defined(__ARM_ARCH) && __ARM_ARCH < 7 && defined(__ARM_FEATURE_UNALIGNED))
+-#    define XXH_FORCE_MEMORY_ACCESS 1
++#  if defined(__GNUC__)
++#    include <endian.h>   /* __STRICT_ALIGNMENT */
++#    if !defined(__STRICT_ALIGNMENT)
++#      define XXH_FORCE_MEMORY_ACCESS 1
++#    endif
+ #  endif
+ #endif
+