pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/emulators/qemu



Module Name:    pkgsrc
Committed By:   thor
Date:           Thu Jan 25 15:15:13 UTC 2024

Modified Files:
        pkgsrc/emulators/qemu: Makefile
Added Files:
        pkgsrc/emulators/qemu/files: linux-user-test.h

Log Message:
emulators/qemu: deactivate user mode on too-old Linux

This checks if MAP_FIXED_NOREPLACE is available in libc headers and only
enables linux-user targets if there, avoiding inevitable build failure.

This is relevant for CentOS 7.9, ubuntu 18. May be phased out in some years,
I presume, or once the main qemu targets also stop working.


To generate a diff of this commit:
cvs rdiff -u -r1.332 -r1.333 pkgsrc/emulators/qemu/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/emulators/qemu/files/linux-user-test.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/emulators/qemu/Makefile
diff -u pkgsrc/emulators/qemu/Makefile:1.332 pkgsrc/emulators/qemu/Makefile:1.333
--- pkgsrc/emulators/qemu/Makefile:1.332        Thu Dec 28 17:15:39 2023
+++ pkgsrc/emulators/qemu/Makefile      Thu Jan 25 15:15:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.332 2023/12/28 17:15:39 adam Exp $
+# $NetBSD: Makefile,v 1.333 2024/01/25 15:15:13 thor Exp $
 
 DISTNAME=      qemu-8.2.0
 CATEGORIES=    emulators
@@ -132,7 +132,14 @@ USER_EMUL=
 CONFIGURE_ARGS+=               --disable-bsd-user
 PLIST.nbd=                     yes
 .elif ${OPSYS} == "Linux"
+# Help this package to build on systems too old for user-mode code.
+HAVE_LINUX_USER!=      ${CPP} ${CPPFLAGS} ${FILESDIR}/linux-user-test.h \
+  >/dev/null 2>&1 && echo yes || echo no
+.  if ${HAVE_LINUX_USER} != "yes"
+CONFIGURE_ARGS+=               --disable-linux-user
+.  else
 USER_EMUL=                     ${UE_ARCHS}
+.  endif
 PLIST.bridge-helper=           yes
 PLIST.ga=                      yes
 PLIST.nbd=                     yes

Added files:

Index: pkgsrc/emulators/qemu/files/linux-user-test.h
diff -u /dev/null pkgsrc/emulators/qemu/files/linux-user-test.h:1.1
--- /dev/null   Thu Jan 25 15:15:13 2024
+++ pkgsrc/emulators/qemu/files/linux-user-test.h       Thu Jan 25 15:15:13 2024
@@ -0,0 +1,7 @@
+/* Qemu 8+ needs MAP_FIXED_NOREPLACE for linux user-mode emulation.
+   They offically do not support systems that are too old (glibc
+   version), but we're trying to build the rest, anyway. */
+#include <sys/mman.h>
+#ifndef MAP_FIXED_NOREPLACE
+#error "Your libc is too old."
+#endif



Home | Main Index | Thread Index | Old Index