[PATCH 61/94] sys-kernel/rumpkernel: new package, add 0_p20250111_p6, add 9999

Sam James <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <091dbe4510dc3f3b0c77ede37cd401c3155c730e.1774994340.git.sam@gentoo.org>
From: "Hyland B." <[email protected]>

Co-authored-by: Sam James <[email protected]>
Signed-off-by: Hyland B. <[email protected]>
Signed-off-by: Sam James <[email protected]>
---
 profiles/base/package.mask                    |   1 +
 profiles/default/hurd/amd64/package.mask      |   1 +
 profiles/default/hurd/x86/package.mask        |   1 +
 sys-kernel/rumpkernel/Manifest                |   1 +
 ...0_p20250111_p6-bsd-own-mk-no-sysroot.patch |  35 ++++
 .../rumpkernel}/metadata.xml                  |   0
 .../rumpkernel-0_p20250111_p6.ebuild          | 185 ++++++++++++++++++
 sys-kernel/rumpkernel/rumpkernel-9999.ebuild  | 185 ++++++++++++++++++
 8 files changed, 409 insertions(+)
 create mode 100644 sys-kernel/rumpkernel/Manifest
 create mode 100644 sys-kernel/rumpkernel/files/rumpkernel-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
 copy {acct-group/anope => sys-kernel/rumpkernel}/metadata.xml (100%)
 create mode 100644 sys-kernel/rumpkernel/rumpkernel-0_p20250111_p6.ebuild
 create mode 100644 sys-kernel/rumpkernel/rumpkernel-9999.ebuild

diff --git a/profiles/base/package.mask b/profiles/base/package.mask
index f096e79ab5269..39c4ff474da7f 100644
--- a/profiles/base/package.mask
+++ b/profiles/base/package.mask
@@ -6,6 +6,7 @@
 dev-util/mig
 sys-kernel/gnumach
 sys-kernel/hurd
+sys-kernel/rumpkernel
 
 # Sam James <[email protected]> (2026-02-18)
 # Needs systemd so unmasked in targets/systemd
diff --git a/profiles/default/hurd/amd64/package.mask b/profiles/default/hurd/amd64/package.mask
index 0873b120d89fb..fbb976eda999a 100644
--- a/profiles/default/hurd/amd64/package.mask
+++ b/profiles/default/hurd/amd64/package.mask
@@ -6,3 +6,4 @@
 -dev-util/mig
 -sys-kernel/hurd
 -sys-kernel/gnumach
+-sys-kernel/rumpkernel
diff --git a/profiles/default/hurd/x86/package.mask b/profiles/default/hurd/x86/package.mask
index 0873b120d89fb..fbb976eda999a 100644
--- a/profiles/default/hurd/x86/package.mask
+++ b/profiles/default/hurd/x86/package.mask
@@ -6,3 +6,4 @@
 -dev-util/mig
 -sys-kernel/hurd
 -sys-kernel/gnumach
+-sys-kernel/rumpkernel
diff --git a/sys-kernel/rumpkernel/Manifest b/sys-kernel/rumpkernel/Manifest
new file mode 100644
index 0000000000000..01131b84b0584
--- /dev/null
+++ b/sys-kernel/rumpkernel/Manifest
@@ -0,0 +1 @@
+DIST rumpkernel-debian-0_20250111-6.tar.bz2 73276281 BLAKE2B 9c68ea59c364d38d12b6ae59ee55390252e7c7aa3347c2ef40fd5cffac3112ecc1d4da77c43726c66794623e2d73c581585dbcc0657f576cf31bb8224dc13551 SHA512 d3451b22848fddd18412890351d15bda043b050890109b1f2dfdf266497ffe60382a654289f4bb9d54a4bf95f5c16b3e9873d58d855a7212c543dc8bafea3fb5
diff --git a/sys-kernel/rumpkernel/files/rumpkernel-0_p20250111_p6-bsd-own-mk-no-sysroot.patch b/sys-kernel/rumpkernel/files/rumpkernel-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
new file mode 100644
index 0000000000000..43bda5d3d7793
--- /dev/null
+++ b/sys-kernel/rumpkernel/files/rumpkernel-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
@@ -0,0 +1,35 @@
+We end up getting linker errors about us not finding /lib/... and some
+various other bits due to the value of --sysroot, which is set to
+somewhere in ${S}.
+
+This might not be the ideal patch (or solution), but for us, we want
+it to remain untouched for LDFLAGS in any case.
+
+--- a/buildrump.sh/src/share/mk/bsd.own.mk
++++ b/buildrump.sh/src/share/mk/bsd.own.mk
+@@ -434,23 +434,8 @@
+ #
+ DESTDIR?=
+ 
+-# Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.)
+-# because it confuses Coverity. Still we need to cov-configure specially
+-# for each specific sysroot argument.
+-# Also don't add a sysroot at all if a rumpkernel build.
+-.if !defined(HOSTPROG) && !defined(HOSTLIB) && !defined(RUMPRUN)
+-.  if ${DESTDIR} != ""
+-.	if empty(CPPFLAGS:M*--sysroot=*)
+-CPPFLAGS+=	--sysroot=${DESTDIR}
+-.	endif
+-LDFLAGS+=	--sysroot=${DESTDIR}
+-.  else
+-.	if empty(CPPFLAGS:M*--sysroot=*)
+-CPPFLAGS+=	--sysroot=/
+-.	endif
+-LDFLAGS+=	--sysroot=/
+-.  endif
+-.endif
++CPPFLAGS?=
++LDFLAGS?=
+ 
+ DBSYM=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
+ ARM_ELF2AOUT=	${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
diff --git a/acct-group/anope/metadata.xml b/sys-kernel/rumpkernel/metadata.xml
similarity index 100%
copy from acct-group/anope/metadata.xml
copy to sys-kernel/rumpkernel/metadata.xml
diff --git a/sys-kernel/rumpkernel/rumpkernel-0_p20250111_p6.ebuild b/sys-kernel/rumpkernel/rumpkernel-0_p20250111_p6.ebuild
new file mode 100644
index 0000000000000..a4ca330bb64b3
--- /dev/null
+++ b/sys-kernel/rumpkernel/rumpkernel-0_p20250111_p6.ebuild
@@ -0,0 +1,185 @@
+# Copyright 2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# TODO: check for any automagic dependencies, possible USE flags
+# TODO: make building for x86_64 work (don't hardcode i386)
+# TODO: make building natively work
+
+inherit flag-o-matic multiprocessing toolchain-funcs
+
+DESCRIPTION="NetBSD's rumpkernel for the Hurd"
+HOMEPAGE="https://salsa.debian.org/hurd-team/rumpkernel https://darnassus.sceen.net/~hurd-web/hurd/rump/ https://rumpkernel.github.io/"
+
+if [[ ${PV} == *9999* ]] ; then
+	EGIT_REPO_URI="https://salsa.debian.org/hurd-team/rumpkernel.git"
+	inherit git-r3
+elif [[ ${PV} == *_p*_p* ]] ; then
+	# These are proper Debian relaeses. rumpkernel isn't currently
+	# part of the Debian archive, so this is the best we can do (no
+	# 'orig' tarballs).
+	RUMPKERNEL_PV=0_$(ver_cut 3)-$(ver_cut 5)
+
+	SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/debian/${RUMPKERNEL_PV}/rumpkernel-debian-${RUMPKERNEL_PV}.tar.bz2"
+	S="${WORKDIR}"/${PN}-debian-${RUMPKERNEL_PV}
+else
+	# Snapshots
+	RUMPKERNEL_COMMIT="c65c4413295247f3390385fb623215d3bd8d6052"
+	SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/${RUMPKERNEL_COMMIT}/rumpkernel-${RUMPKERNEL_COMMIT}.tar.bz2"
+fi
+
+# A lot from NetBSD, see:
+# https://salsa.debian.org/hurd-team/rumpkernel/-/blob/master/debian/copyright
+LICENSE="Apache-2.0 Boost-1.0 BSD BSD-2 BSD-4 CDDL GPL-1 GPL-2+ GPL-3+ ISC
+	LGPL-2.1+ MIT public-domain ZLIB"
+
+SLOT="0"
+if [[ ${PV} != *9999* ]] ; then
+	KEYWORDS="~amd64 ~x86"
+fi
+
+DEPEND="
+	dev-util/mig
+"
+# XXX
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
+)
+
+src_prepare() {
+	default
+
+	eapply $(sed -e 's:^:debian/patches/:' debian/patches/series || die)
+}
+
+src_configure() {
+	# TODO: conflict with -pg but we might not need -pg to begin with;
+	# objects get built thrice (regular, -pg, -fPIC).
+	filter-flags -fomit-frame-pointer
+
+	export HOST_CC=$(tc-getBUILD_CC)
+	export HOST_CPPFLAGS=-D_GNU_SOURCE
+	export TARGET_AR=${CHOST}-ar
+	export TARGET_CC=${CHOST}-gcc
+	export TARGET_CXX=${CHOST}-g++
+	export TARGET_LD=${CHOST}-ld
+	export TARGET_MIG=${CHOST}-mig
+	export TARGET_NM=${CHOST}-nm
+	export MIG=${CHOST}-mig
+	export _GCC_CRTENDS= _GCC_CRTEND= _GCC_CRTBEGINS= _GCC_CRTBEGIN= _GCC_CRTI= _GCC_CRTN=
+	export BSDOBJDIR="${S}"/obj
+
+	cd buildrump.sh/src/lib/librumpuser || die "Couldn't change to the build directory"
+	econf
+
+	NBMAKE="${S}"/buildrump.sh/src/obj/tooldir/bin/nbmake-i386
+}
+
+src_compile() {
+	cd buildrump.sh/src || die "Couldn't change to the build directory"
+	mkdir -p obj || die "Couldn't make obj dir"
+
+	local buildrump_cppflags=(
+		-I"${S}"/buildrump.sh/src/obj/destdir.i386/usr/include
+
+		-D_FILE_OFFSET_BITS=64
+		-DRUMP_REGISTER_T=int
+		-DRUMPUSER_CONFIG=yes
+		-DNO_PCI_MSI_MSIX=yes
+		-DNUSB_DMA=1
+		-DPAE
+		-DBUFPAGES=16
+
+		# Workaround broken open() call
+		-U_FORTIFY_SOURCE
+
+		# libipsec doesn't get CWARNFLAGS, apparently
+		-Wno-error=unused-but-set-variable
+	)
+
+	local buildrump_warnflags=(
+		-Wno-error=unused-but-set-variable
+		-Wno-error=maybe-uninitialized
+		-Wno-error=address-of-packed-member
+		-Wno-error=unused-variable
+		-Wno-error=stack-protector
+		-Wno-error=array-parameter
+		-Wno-error=array-bounds
+		-Wno-error=stringop-overflow
+		-Wno-error=int-to-pointer-cast
+		-Wno-error=incompatible-pointer-types
+		-Wno-error=unterminated-string-initialization
+		-Wno-error=format-nonliteral
+		-Wno-error=sign-compare
+	)
+
+	local mybuildshargs=(
+		-V TOOLS_BUILDRUMP=yes
+		-V MKBINUTILS=no
+		-V MKGDB=no
+		-V MKGROFF=no
+		-V MKDTRACE=no
+		-V MKZFS=no
+
+		-V TOPRUMP="${S}"/buildrump.sh/src/sys/rump
+		-V BUILDRUMP_CPPFLAGS="-Wno-error=stringop-overread"
+		-V RUMPUSER_EXTERNAL_DPLIBS=pthread
+
+		-V CPPFLAGS="${buildrump_cppflags[*]}"
+		-V CWARNFLAGS="${buildrump_warnflags[*]}"
+		#-V TARGET_LDADD="-Wl,-v -v"
+
+		-V _GCC_CRTENDS="" -V _GCC_CRTEND=""
+		-V _GCC_CRTBEGINS="" -V _GCC_CRTBEGIN=""
+		-V _GCC_CRTI="" -V _GCC_CRTN=""
+		-V MIG=${CHOST}-mig
+
+		# XXX
+		-m i386
+		-U -u
+		-j $(get_makeopts_jobs)
+		-T ./obj/tooldir
+	)
+
+	# The Makefiles scattered across NetBSD use $S everywhere. So we
+	# will get rid of this. Otherwise, you won't see some things build
+	# in the correct directory. Thank you sam
+	(
+		_S="${S}"
+		unset S
+
+		ebegin "Building tools + rumpkernel"
+		./build.sh "${mybuildshargs[@]}" tools rump
+		eend $? || die "rumpkernel's ./build.sh failed"
+
+		cd "${_S}"/buildrump.sh/src/lib/librumpuser || die "couldn't cd"
+		ebegin "Building librumpuser"
+		RUMPRUN=true ${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
+		eend $? || die "librumpuser build failed"
+
+		cd "${_S}"/pci-userspace/src-gnu || die "couldn't cd"
+		ebegin "Building pci-userspace"
+		${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
+		eend $? || die "pci-userspace build failed"
+	)
+}
+
+src_install() {
+	dodir /usr/include /usr/lib
+
+	cp -a "${S}"/buildrump.sh/src/sys/rump/include/rump "${ED}"/usr/include/ || die
+	# Kept "${S}"/buildrump.sh/src/obj separate here as may change to
+	# another builddir.
+	find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f,l \
+		-name "librump*.so*" -exec cp -a {} "${ED}"/usr/lib/ \; || die
+	find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f \
+		-name "librump*.a" -exec cp -a {} "${ED}"/usr/lib/ \; || die
+
+	# rempve non lib files
+	rm -f "${ED}"/usr/lib/*.map || die
+	# Remove it to make lintian happy
+	rm -f "${ED}"/usr/lib/librumpkern_z.* || die
+}
diff --git a/sys-kernel/rumpkernel/rumpkernel-9999.ebuild b/sys-kernel/rumpkernel/rumpkernel-9999.ebuild
new file mode 100644
index 0000000000000..a4ca330bb64b3
--- /dev/null
+++ b/sys-kernel/rumpkernel/rumpkernel-9999.ebuild
@@ -0,0 +1,185 @@
+# Copyright 2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# TODO: check for any automagic dependencies, possible USE flags
+# TODO: make building for x86_64 work (don't hardcode i386)
+# TODO: make building natively work
+
+inherit flag-o-matic multiprocessing toolchain-funcs
+
+DESCRIPTION="NetBSD's rumpkernel for the Hurd"
+HOMEPAGE="https://salsa.debian.org/hurd-team/rumpkernel https://darnassus.sceen.net/~hurd-web/hurd/rump/ https://rumpkernel.github.io/"
+
+if [[ ${PV} == *9999* ]] ; then
+	EGIT_REPO_URI="https://salsa.debian.org/hurd-team/rumpkernel.git"
+	inherit git-r3
+elif [[ ${PV} == *_p*_p* ]] ; then
+	# These are proper Debian relaeses. rumpkernel isn't currently
+	# part of the Debian archive, so this is the best we can do (no
+	# 'orig' tarballs).
+	RUMPKERNEL_PV=0_$(ver_cut 3)-$(ver_cut 5)
+
+	SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/debian/${RUMPKERNEL_PV}/rumpkernel-debian-${RUMPKERNEL_PV}.tar.bz2"
+	S="${WORKDIR}"/${PN}-debian-${RUMPKERNEL_PV}
+else
+	# Snapshots
+	RUMPKERNEL_COMMIT="c65c4413295247f3390385fb623215d3bd8d6052"
+	SRC_URI="https://salsa.debian.org/hurd-team/rumpkernel/-/archive/${RUMPKERNEL_COMMIT}/rumpkernel-${RUMPKERNEL_COMMIT}.tar.bz2"
+fi
+
+# A lot from NetBSD, see:
+# https://salsa.debian.org/hurd-team/rumpkernel/-/blob/master/debian/copyright
+LICENSE="Apache-2.0 Boost-1.0 BSD BSD-2 BSD-4 CDDL GPL-1 GPL-2+ GPL-3+ ISC
+	LGPL-2.1+ MIT public-domain ZLIB"
+
+SLOT="0"
+if [[ ${PV} != *9999* ]] ; then
+	KEYWORDS="~amd64 ~x86"
+fi
+
+DEPEND="
+	dev-util/mig
+"
+# XXX
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0_p20250111_p6-bsd-own-mk-no-sysroot.patch
+)
+
+src_prepare() {
+	default
+
+	eapply $(sed -e 's:^:debian/patches/:' debian/patches/series || die)
+}
+
+src_configure() {
+	# TODO: conflict with -pg but we might not need -pg to begin with;
+	# objects get built thrice (regular, -pg, -fPIC).
+	filter-flags -fomit-frame-pointer
+
+	export HOST_CC=$(tc-getBUILD_CC)
+	export HOST_CPPFLAGS=-D_GNU_SOURCE
+	export TARGET_AR=${CHOST}-ar
+	export TARGET_CC=${CHOST}-gcc
+	export TARGET_CXX=${CHOST}-g++
+	export TARGET_LD=${CHOST}-ld
+	export TARGET_MIG=${CHOST}-mig
+	export TARGET_NM=${CHOST}-nm
+	export MIG=${CHOST}-mig
+	export _GCC_CRTENDS= _GCC_CRTEND= _GCC_CRTBEGINS= _GCC_CRTBEGIN= _GCC_CRTI= _GCC_CRTN=
+	export BSDOBJDIR="${S}"/obj
+
+	cd buildrump.sh/src/lib/librumpuser || die "Couldn't change to the build directory"
+	econf
+
+	NBMAKE="${S}"/buildrump.sh/src/obj/tooldir/bin/nbmake-i386
+}
+
+src_compile() {
+	cd buildrump.sh/src || die "Couldn't change to the build directory"
+	mkdir -p obj || die "Couldn't make obj dir"
+
+	local buildrump_cppflags=(
+		-I"${S}"/buildrump.sh/src/obj/destdir.i386/usr/include
+
+		-D_FILE_OFFSET_BITS=64
+		-DRUMP_REGISTER_T=int
+		-DRUMPUSER_CONFIG=yes
+		-DNO_PCI_MSI_MSIX=yes
+		-DNUSB_DMA=1
+		-DPAE
+		-DBUFPAGES=16
+
+		# Workaround broken open() call
+		-U_FORTIFY_SOURCE
+
+		# libipsec doesn't get CWARNFLAGS, apparently
+		-Wno-error=unused-but-set-variable
+	)
+
+	local buildrump_warnflags=(
+		-Wno-error=unused-but-set-variable
+		-Wno-error=maybe-uninitialized
+		-Wno-error=address-of-packed-member
+		-Wno-error=unused-variable
+		-Wno-error=stack-protector
+		-Wno-error=array-parameter
+		-Wno-error=array-bounds
+		-Wno-error=stringop-overflow
+		-Wno-error=int-to-pointer-cast
+		-Wno-error=incompatible-pointer-types
+		-Wno-error=unterminated-string-initialization
+		-Wno-error=format-nonliteral
+		-Wno-error=sign-compare
+	)
+
+	local mybuildshargs=(
+		-V TOOLS_BUILDRUMP=yes
+		-V MKBINUTILS=no
+		-V MKGDB=no
+		-V MKGROFF=no
+		-V MKDTRACE=no
+		-V MKZFS=no
+
+		-V TOPRUMP="${S}"/buildrump.sh/src/sys/rump
+		-V BUILDRUMP_CPPFLAGS="-Wno-error=stringop-overread"
+		-V RUMPUSER_EXTERNAL_DPLIBS=pthread
+
+		-V CPPFLAGS="${buildrump_cppflags[*]}"
+		-V CWARNFLAGS="${buildrump_warnflags[*]}"
+		#-V TARGET_LDADD="-Wl,-v -v"
+
+		-V _GCC_CRTENDS="" -V _GCC_CRTEND=""
+		-V _GCC_CRTBEGINS="" -V _GCC_CRTBEGIN=""
+		-V _GCC_CRTI="" -V _GCC_CRTN=""
+		-V MIG=${CHOST}-mig
+
+		# XXX
+		-m i386
+		-U -u
+		-j $(get_makeopts_jobs)
+		-T ./obj/tooldir
+	)
+
+	# The Makefiles scattered across NetBSD use $S everywhere. So we
+	# will get rid of this. Otherwise, you won't see some things build
+	# in the correct directory. Thank you sam
+	(
+		_S="${S}"
+		unset S
+
+		ebegin "Building tools + rumpkernel"
+		./build.sh "${mybuildshargs[@]}" tools rump
+		eend $? || die "rumpkernel's ./build.sh failed"
+
+		cd "${_S}"/buildrump.sh/src/lib/librumpuser || die "couldn't cd"
+		ebegin "Building librumpuser"
+		RUMPRUN=true ${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
+		eend $? || die "librumpuser build failed"
+
+		cd "${_S}"/pci-userspace/src-gnu || die "couldn't cd"
+		ebegin "Building pci-userspace"
+		${NBMAKE} -j$(get_makeopts_jobs) MIG=${CHOST}-mig dependall
+		eend $? || die "pci-userspace build failed"
+	)
+}
+
+src_install() {
+	dodir /usr/include /usr/lib
+
+	cp -a "${S}"/buildrump.sh/src/sys/rump/include/rump "${ED}"/usr/include/ || die
+	# Kept "${S}"/buildrump.sh/src/obj separate here as may change to
+	# another builddir.
+	find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f,l \
+		-name "librump*.so*" -exec cp -a {} "${ED}"/usr/lib/ \; || die
+	find "${S}"/buildrump.sh/src "${S}"/buildrump.sh/src/obj -type f \
+		-name "librump*.a" -exec cp -a {} "${ED}"/usr/lib/ \; || die
+
+	# rempve non lib files
+	rm -f "${ED}"/usr/lib/*.map || die
+	# Remove it to make lintian happy
+	rm -f "${ED}"/usr/lib/librumpkern_z.* || die
+}
-- 
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.