aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2025-11-17 11:34:01 +0000
committerMartin Matuska <mm@FreeBSD.org>2025-11-17 16:12:03 +0000
commitbb8580e7a6a8c54481d0fd19cac43e84a485f45b (patch)
treea5d526190c1c1240773a4b81af0bae1085ed0b72
parent4303bde4297a3d19cabdb08ce1550f682578d2ba (diff)
zfs: fix cross-build after openzfs/zfs@e63d026b9d
Workaround multiple cross-build issues in OpenZFS code TBD: discuss long-term fix with OpenZFS
-rw-r--r--cddl/lib/libspl/Makefile6
-rw-r--r--sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/fcntl.h2
-rw-r--r--sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h2
-rw-r--r--sys/contrib/openzfs/lib/libspl/include/sys/random.h2
-rw-r--r--sys/contrib/openzfs/lib/libspl/include/sys/sysmacros.h2
5 files changed, 11 insertions, 3 deletions
diff --git a/cddl/lib/libspl/Makefile b/cddl/lib/libspl/Makefile
index 2c56348cdf9c..173e9116e284 100644
--- a/cddl/lib/libspl/Makefile
+++ b/cddl/lib/libspl/Makefile
@@ -14,9 +14,7 @@ SRCS = \
assert.c \
backtrace.c \
condvar.c \
- cred.c \
kmem.c \
- kstat.c \
libspl.c \
list.c \
mkdirp.c \
@@ -28,7 +26,6 @@ SRCS = \
rwlock.c \
sid.c \
taskq.c \
- thread.c \
timestamp.c \
include/sys/list.h \
include/sys/list_impl.h
@@ -38,7 +35,10 @@ SRCS = \
.if !defined(BOOTSTRAPPING)
SRCS += \
atomic.c \
+ cred.c \
getexecname.c \
+ kstat.c \
+ thread.c \
tunables.c \
os/freebsd/getexecname.c \
os/freebsd/gethostid.c \
diff --git a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/fcntl.h b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/fcntl.h
index 64dd4d7ebe45..04fcc9f85c91 100644
--- a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/fcntl.h
+++ b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/fcntl.h
@@ -27,7 +27,9 @@
#ifndef _LIBSPL_SYS_FCNTL_H_
#define _LIBSPL_SYS_FCNTL_H_
+#if !defined(__linux__) || !defined(IN_BASE)
#include_next <sys/fcntl.h>
+#endif
#define O_LARGEFILE 0
#define O_RSYNC 0
diff --git a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h
index 231c250d3410..5548ad7d22b2 100644
--- a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h
+++ b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/mount.h
@@ -29,8 +29,10 @@
#ifndef _LIBSPL_SYS_MOUNT_H
#define _LIBSPL_SYS_MOUNT_H
+#if !defined(__linux__) || !defined(IN_BASE)
#undef _SYS_MOUNT_H_
#include_next <sys/mount.h>
+#endif
#include <assert.h>
#include <string.h>
diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/random.h b/sys/contrib/openzfs/lib/libspl/include/sys/random.h
index d11580829ed2..09ca0662d1a3 100644
--- a/sys/contrib/openzfs/lib/libspl/include/sys/random.h
+++ b/sys/contrib/openzfs/lib/libspl/include/sys/random.h
@@ -39,7 +39,9 @@ random_in_range(uint32_t range)
{
uint32_t r;
+#if !defined(__APPLE__) || !defined(IN_BASE)
ASSERT(range != 0);
+#endif
if (range == 1)
return (0);
diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/sysmacros.h b/sys/contrib/openzfs/lib/libspl/include/sys/sysmacros.h
index cc6edf25a7bc..f67b081c42fa 100644
--- a/sys/contrib/openzfs/lib/libspl/include/sys/sysmacros.h
+++ b/sys/contrib/openzfs/lib/libspl/include/sys/sysmacros.h
@@ -38,8 +38,10 @@
* have this header, so include_next won't find it and will abort. So, we
* protect it with a platform check.
*/
+#ifndef IN_BASE
#include_next <sys/sysmacros.h>
#endif
+#endif
#ifdef __FreeBSD__
#include <sys/param.h>