summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanneke Nieuwenhuizen <janneke@gnu.org>2023-05-16 10:57:48 +0200
committerDamien Zammit <damien@zamaudio.com>2023-06-24 00:00:17 +1000
commitde0a306542be54660f3508f98a253cc3dcc0e6a9 (patch)
tree68cb16b16fcd513119f78df5079301429cc928bd
parent8fae1f1736b93bcf075069804f8d0950b637348d (diff)
Fix cross-build for non-multiarch toolchains.
* debian/patches/crossbuild: Also respect triplet on AR, MIG and NM. Message-Id: <20230516085750.32095-2-janneke@gnu.org>
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/crossbuild55
2 files changed, 56 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 78b49d79..78cdf1c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+rumpkernel (0~20211031-4) UNRELEASED; urgency=medium
+
+ [ Janneke Nieuwenhuizen ]
+ * debian/patches/crossbuild: Fix cross-builds on Arch.
+
+ -- Samuel Thibault <sthibault@debian.org> Tue, 16 May 2023 13:55:58 +0200
+
rumpkernel (0~20211031-3) unreleased; urgency=medium
[ Damien Zammit ]
diff --git a/debian/patches/crossbuild b/debian/patches/crossbuild
index 77936030..6185b9fc 100644
--- a/debian/patches/crossbuild
+++ b/debian/patches/crossbuild
@@ -2,10 +2,13 @@ TODO: "TARGET" is a terrible name since that's confusing compared to the
build/host/target convention of the GNU toolchain.
---
- buildrump.sh/src/build.sh | 8 +++++---
- buildrump.sh/src/share/mk/bsd.lib.mk | 2 +-
- 2 files changed, 6 insertions(+), 4 deletions(-)
+ buildrump.sh/src/build.sh | 18 +++++++++++++-----
+ buildrump.sh/src/share/mk/bsd.lib.mk | 2 +-
+ pci-userspace/src-gnu/Makefile.inc | 3 ++-
+ 3 files changed, 16 insertions(+), 7 deletions(-)
+diff --git a/buildrump.sh/src/build.sh b/buildrump.sh/src/build.sh
+index d2ee76786..0e80813c1 100755
--- a/buildrump.sh/src/build.sh
+++ b/buildrump.sh/src/build.sh
@@ -1693,7 +1693,7 @@ rebuildmake()
@@ -17,23 +20,42 @@ build/host/target convention of the GNU toolchain.
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
${HOST_SH} "${TOP}/tools/make/configure" ${configure_args} ||
( cp ${tmpdir}/config.log ${tmpdir}-config.log
-@@ -2231,9 +2231,11 @@ maketoolwrapper ()
+@@ -2230,10 +2230,18 @@ maketoolwrapper ()
+ musthave=$1
tool=$2
- if [ "${tool}" = "CC" ]; then
+- if [ "${tool}" = "CC" ]; then
- lctool=gcc
++ if [ "${tool}" = "AR" ]; then
++ lctool=${TARGET_AR-ar}
++ elif [ "${tool}" = "CC" ]; then
+ lctool=${TARGET_CC-gcc}
elif [ "${tool}" = "CXX" ]; then
- lctool=g++
+ lctool=${TARGET_CXX-g++}
+ elif [ "${tool}" = "LD" ]; then
+ lctool=${TARGET_LD-ld}
++ elif [ "${tool}" = "MIG" ]; then
++ lctool=${TARGET_MIG-mig}
++ elif [ "${tool}" = "NM" ]; then
++ lctool=${TARGET_NM-nm}
else
lctool=$(echo ${tool} | tr '[A-Z]' '[a-z]')
fi
+@@ -2300,7 +2308,7 @@ makerumptools ()
+ for x in CC AR NM OBJCOPY; do
+ maketoolwrapper true $x
+ done
+- for x in AS LD OBJDUMP RANLIB READELF SIZE STRINGS STRIP CXX; do
++ for x in AS LD OBJDUMP RANLIB READELF SIZE STRINGS STRIP CXX MIG; do
+ maketoolwrapper false $x
+ done
+
+diff --git a/buildrump.sh/src/share/mk/bsd.lib.mk b/buildrump.sh/src/share/mk/bsd.lib.mk
+index 2225f7891..7c91cabea 100644
--- a/buildrump.sh/src/share/mk/bsd.lib.mk
+++ b/buildrump.sh/src/share/mk/bsd.lib.mk
-@@ -622,7 +622,7 @@ LIBDPLIBS+= stdc++ ${.CURDIR}/../../
+@@ -622,7 +622,7 @@ LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../external/gpl3/${EXTERNAL_GCC_SU
LIBCC:= ${CC}
.endif
@@ -42,3 +64,24 @@ build/host/target convention of the GNU toolchain.
_LDFLAGS.${_LIB}= ${LDFLAGS} ${LDFLAGS.${_LIB}}
_MAINLIBDEPS= ${SOLIB} ${DPADD} ${DPLIBC} \
+diff --git a/pci-userspace/src-gnu/Makefile.inc b/pci-userspace/src-gnu/Makefile.inc
+index 6f8db357e..ef25bac3a 100644
+--- a/pci-userspace/src-gnu/Makefile.inc
++++ b/pci-userspace/src-gnu/Makefile.inc
+@@ -8,11 +8,12 @@ RUMPCOMP_USER_CPPFLAGS+=-I${PCIDIR} -I${DESTDIR}/usr/include
+ RUMPCOMP_CPPFLAGS+= -I${PCIDIR} -I${DESTDIR}/usr/include
+ CPPFLAGS+= -I${PCIDIR}
+ LDFLAGS+= -lmachuser -Wl,--no-as-needed -lpciaccess -Wl,--as-needed
++MIG=mig
+
+ mach_debugUser.c:
+ echo '#include <mach_debug/mach_debug.defs>' \
+ | ${CC} -E -x c - -o - \
+- | mig -cc cat - /dev/null -subrprefix __ \
++ | $(MIG) -cc cat - /dev/null -subrprefix __ \
+ -user mach_debugUser.c \
+ -server /dev/null \
+ -header mach_debug_U.h
+--
+2.39.2
+