From 0bdf2535d4f8a571cb6d230f2f19eb20a452a4f8 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Fri, 18 Oct 2024 21:39:37 +0100 Subject: [PATCH] tools/build/cross-build: Don't include sys/uio.h from linux limits.h This creates a circular dependency for OpenZFS's libspl in sys/uio.h, and it shouldn't be needed since the system limits.h already defines IOV_MAX, so delete it, and unconditionally assert that to be the case. Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE before it has been defined by OpenZFS's own sys/param.h. Fixes: 7a7741af18d6 ("zfs: merge openzfs/zfs@b10992582") MFC after: 1 week --- tools/build/cross-build/include/linux/limits.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/build/cross-build/include/linux/limits.h b/tools/build/cross-build/include/linux/limits.h index 5eca34b1120c..4631cabb1104 100644 --- a/tools/build/cross-build/include/linux/limits.h +++ b/tools/build/cross-build/include/linux/limits.h @@ -45,13 +45,11 @@ #if !defined(_GNU_SOURCE) #warning "Attempting to use limits.h with -std=c89/without _GNU_SOURCE, many macros will be missing" #endif +#endif /* C89 */ -#else /* Not C89 */ -/* Not C89 -> check that all macros that we expect are defined */ #ifndef IOV_MAX #error IOV_MAX should be defined #endif -#endif /* C89 */ #ifndef MAXBSIZE #define MAXBSIZE 65536 /* must be power of 2 */ @@ -83,7 +81,6 @@ #endif #include -#include /* For IOV_MAX */ /* Sanity checks for glibc */ #ifndef _GNU_SOURCE