From bfb276e55c76f3c089f461dfbcb180713a92e131 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Wed, 18 Feb 2026 00:46:02 +0000 Subject: [PATCH] freebsd: Fix TIMESPEC_OVERFLOW for PowerPC Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break, which predates the addition of FreeBSD support to OpenZFS. Moreover, 64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also defined (alongside __powerpc64__ to disambiguate), which has always had a 64-bit time_t. This code has therefore always been wrong for all PowerPC variants. Fix this by limiting the 32-bit case to just i386, which is the only architecture in FreeBSD to have a 32-bit time_t and not have broken ABI, due to its special legacy compatibility status. Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Jessica Clarke Closes #18217 Closes #18218 --- include/os/freebsd/spl/sys/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/os/freebsd/spl/sys/time.h b/include/os/freebsd/spl/sys/time.h index 14b42f2e7..c72c3ea36 100644 --- a/include/os/freebsd/spl/sys/time.h +++ b/include/os/freebsd/spl/sys/time.h @@ -51,7 +51,7 @@ extern int hz; typedef longlong_t hrtime_t; -#if defined(__i386__) || defined(__powerpc__) +#ifdef __i386__ #define TIMESPEC_OVERFLOW(ts) \ ((ts)->tv_sec < INT32_MIN || (ts)->tv_sec > INT32_MAX) #else