Sun Apr 14 09:15:14 2024 UTC (43d)
x11/modular-xorg-server: Work around kern/58149 on NetBSD/aarch64 9.* and 10.0

See also
http://mail-index.netbsd.org/netbsd-users/2024/04/12/msg030915.html


(pho)
diff -r1.141 -r1.142 pkgsrc/x11/modular-xorg-server/Makefile
diff -r0 -r1.1 pkgsrc/x11/modular-xorg-server/hacks.mk

cvs diff -r1.141 -r1.142 pkgsrc/x11/modular-xorg-server/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/modular-xorg-server/Makefile 2023/12/13 07:45:07 1.141
+++ pkgsrc/x11/modular-xorg-server/Makefile 2024/04/14 09:15:14 1.142
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.141 2023/12/13 07:45:07 wiz Exp $ 1# $NetBSD: Makefile,v 1.142 2024/04/14 09:15:14 pho Exp $
2 2
3DISTNAME= xorg-server-${XORG_VERSION} 3DISTNAME= xorg-server-${XORG_VERSION}
4PKGNAME= modular-${DISTNAME} 4PKGNAME= modular-${DISTNAME}
 5PKGREVISION= 1
5 6
6MAINTAINER= pkgsrc-users@NetBSD.org 7MAINTAINER= pkgsrc-users@NetBSD.org
7COMMENT= Modular X11 server from modular X.org 8COMMENT= Modular X11 server from modular X.org
8 9
9SPECIAL_PERMS+= bin/Xorg ${SETUID_ROOT_PERMS} 10SPECIAL_PERMS+= bin/Xorg ${SETUID_ROOT_PERMS}
10 11
11NOT_FOR_PLATFORM= Darwin-*-* 12NOT_FOR_PLATFORM= Darwin-*-*
12 13
13.include "Makefile.common" 14.include "Makefile.common"
14 15
15CONFIGURE_ARGS+= --enable-xorg 16CONFIGURE_ARGS+= --enable-xorg
16CONFIGURE_ARGS+= --disable-xephyr 17CONFIGURE_ARGS+= --disable-xephyr
17CONFIGURE_ARGS+= --disable-kdrive 18CONFIGURE_ARGS+= --disable-kdrive

File Added: pkgsrc/x11/modular-xorg-server/hacks.mk
# $NetBSD: hacks.mk,v 1.1 2024/04/14 09:15:14 pho Exp $

.if !defined(MODULAR_XORG_SERVER_HACKS_MK)
MODULAR_XORG_SERVER_HACKS_MK=	defined

### [Tue Apr  9 13:40:46 JST 2024 : pho]
###
### With "smart scheduler" enabled, Xserver sets up an itimer to
### periodically receive SIGALRM from the kernel while the server is doing
### a socket I/O and processing commands from X clients. When the signal
### arrives while Xserver is in pixman_composite_src_8888_8888_asm_neon()
### or any similar functions from libpixman, the process fails to return
### from the signal handler and exits with status code 22 (EINVAL) due to
### kern/58149. These functions misalign SP while doing some SIMD stuff,
### thereby trigger the kernel bug.
###
### Disabling itimer can avoid the problem but there might be a performance
### regression.
###
.if ${MACHINE_PLATFORM:MNetBSD-9.*-aarch64} || \
	${MACHINE_PLATFORM:MNetBSD-10.0-aarch64}
PKG_HACKS+=	smart-scheduler-workaround
CONFIGURE_ENV+=	ac_cv_func_setitimer=no
.endif

.endif  # MODULAR_XORG_SERVER_HACKS_MK