[PATCH 62/94] sys-kernel/hurd: wire up rumpkernel support

Sam James <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <48d400fbd1e558109032aea9b868fd9e278cce1e.1774994344.git.sam@gentoo.org>
Build sys-kernel/rumpkernel support which provides drivers from NetBSD
run in userland. This is needed for 64-bit systems and is considered the
future of driver and hardware support on Hurd.

In particular wrt 64-bit, this is because the imported Linux drivers
in Hurd are from a very old version and aren't 64-bit clean, along with
other problems.

Signed-off-by: Sam James <[email protected]>
---
 .../files/hurd-0.9_p20251029-rump-link.patch  | 20 +++++++++++++++++++
 sys-kernel/hurd/hurd-0.9_p20251029.ebuild     |  6 ++++--
 sys-kernel/hurd/hurd-9999.ebuild              |  9 +++++++--
 sys-kernel/hurd/metadata.xml                  |  6 ++++++
 4 files changed, 37 insertions(+), 4 deletions(-)
 create mode 100644 sys-kernel/hurd/files/hurd-0.9_p20251029-rump-link.patch

diff --git a/sys-kernel/hurd/files/hurd-0.9_p20251029-rump-link.patch b/sys-kernel/hurd/files/hurd-0.9_p20251029-rump-link.patch
new file mode 100644
index 0000000000000..85d05b02cf418
--- /dev/null
+++ b/sys-kernel/hurd/files/hurd-0.9_p20251029-rump-link.patch
@@ -0,0 +1,20 @@
+Without this patch, the configure test for rump fails:
+```
+configure:5487: i686-gnu-gcc -o conftest -g -O2 -U_FORTIFY_SOURCE -Wl,--no-error-rwx-segments -Wl,--no-error-execstack -Wl,-z,notext  -g -O2 conftest.c  -lrump >&5
+/usr/x86_64-pc-linux-gnu/i686-gnu/binutils-bin/2.46.0/ld: /usr/lib/gcc/i686-gnu/16/../../../../i686-gnu/lib/librump.so: undefined reference to `rumpuser_rw_exit'
+/usr/x86_64-pc-linux-gnu/i686-gnu/binutils-bin/2.46.0/ld: /usr/lib/gcc/i686-gnu/16/../../../../i686-gnu/lib/librump.so: undefined reference to `rumpuser_cv_has_waite
+```
+and rumpuser does exist but it didn't link with it. This patch is from cross-hurd
+but it's not clear why Debian and Guix don't seem to need this:
+https://raw.githubusercontent.com/flavioc/cross-hurd/c20747b41c0f2a97c5d5602ff80e550a104a6410/patches/hurd/link-rump.patch
+--- a/configure.ac
++++ b/configure.ac
+@@ -239,7 +239,7 @@ AS_IF([test "x$with_rump" != xno], [
+   # Save
+   oldLIBS="$LIBS"
+ 
+-  LIBS="$oldLIBS -lrump"
++  LIBS="$oldLIBS -lrump -lrumpuser -lrumpvfs -lrumpvfs_fifofs  -lrumpnet -lrumpnet_net -lrumpnet_local"
+   AC_LINK_IFELSE(
+     [AC_LANG_PROGRAM(
+       [[#include <hurd.h>
diff --git a/sys-kernel/hurd/hurd-0.9_p20251029.ebuild b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
index d0a24a99c0cc6..9ed04d7cad137 100644
--- a/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
+++ b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
@@ -31,7 +31,7 @@ SLOT="0"
 if is_crosspkg ; then
 	IUSE="custom-cflags headers-only"
 else
-	IUSE="custom-cflags headers-only ncurses xkb"
+	IUSE="custom-cflags headers-only ncurses rumpkernel xkb"
 fi
 [[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86"
 
@@ -51,6 +51,7 @@ else
 		virtual/libcrypt:=[static-libs]
 		virtual/zlib:=[static-libs]
 		ncurses? ( sys-libs/ncurses:= )
+		rumpkernel? ( sys-kernel/rumpkernel )
 		xkb? ( x11-libs/libxkbcommon )
 	"
 	RDEPEND="${DEPEND}"
@@ -59,6 +60,7 @@ fi
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.9_p20251029-glibc-2.43.patch
+	"${FILESDIR}"/${PN}-0.9_p20251029-rump-link.patch
 )
 
 src_prepare() {
@@ -114,7 +116,6 @@ src_configure() {
 
 			# Unpackaged
 			--without-acpica
-			--without-rump
 
 			# TODO (configure really wants parted)
 			--without-parted
@@ -126,6 +127,7 @@ src_configure() {
 			--with-libz
 
 			$(use_enable ncurses ncursesw)
+			$(use_with rumpkernel rump)
 		)
 	fi
 
diff --git a/sys-kernel/hurd/hurd-9999.ebuild b/sys-kernel/hurd/hurd-9999.ebuild
index 598a46f57a6fb..e86d86c303ee3 100644
--- a/sys-kernel/hurd/hurd-9999.ebuild
+++ b/sys-kernel/hurd/hurd-9999.ebuild
@@ -31,7 +31,7 @@ SLOT="0"
 if is_crosspkg ; then
 	IUSE="custom-cflags headers-only"
 else
-	IUSE="custom-cflags headers-only ncurses xkb"
+	IUSE="custom-cflags headers-only ncurses rumpkernel xkb"
 fi
 [[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86"
 
@@ -51,12 +51,17 @@ else
 		virtual/libcrypt:=[static-libs]
 		virtual/zlib:=[static-libs]
 		ncurses? ( sys-libs/ncurses:= )
+		rumpkernel? ( sys-kernel/rumpkernel )
 		xkb? ( x11-libs/libxkbcommon )
 	"
 	RDEPEND="${DEPEND}"
 	BDEPEND="virtual/pkgconfig"
 fi
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9_p20251029-rump-link.patch
+)
+
 src_prepare() {
 	default
 	[[ ${PV} == 9999 || ${PV} == *_p* ]] && eautoreconf
@@ -110,7 +115,6 @@ src_configure() {
 
 			# Unpackaged
 			--without-acpica
-			--without-rump
 
 			# TODO (configure really wants parted)
 			--without-parted
@@ -122,6 +126,7 @@ src_configure() {
 			--with-libz
 
 			$(use_enable ncurses ncursesw)
+			$(use_with rumpkernel rump)
 		)
 	fi
 
diff --git a/sys-kernel/hurd/metadata.xml b/sys-kernel/hurd/metadata.xml
index 4894b3f3b2afb..0986fea90dac6 100644
--- a/sys-kernel/hurd/metadata.xml
+++ b/sys-kernel/hurd/metadata.xml
@@ -10,6 +10,12 @@
 		Build console-curses client for non-basic capabilities,
 		unlike the builtin one.
 		</flag>
+		<flag name="rumpkernel">
+		Build <pkg>sys-kernel/rumpkernel</pkg> support which provides
+		drivers from NetBSD run in userland. This is needed for 64-bit
+		systems and is considered the future of driver and hardware
+		support on Hurd.
+		</flag>
 		<flag name="xkb">
 		Depend on <pkg>x11-libs/libxkbcommon</pkg> for keymap support in
 		the console.
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.