aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVal Packett <[email protected]>2024-01-19 18:01:26 -0300
committerBrian Behlendorf <[email protected]>2024-01-29 14:53:29 -0800
commit09a79613640bd96f2ac39967557a8ed602cd04a5 (patch)
tree681a4ccab6ee9b7c758ac26912dc9bf9cac9f62a /lib
parent276be5357cf33a266a676fca1f22924655da1ba3 (diff)
FreeBSD: Fix bootstrapping tools under Linux/musl
musl libc has deprecated LFS64 aliases, so bootstrapping FreeBSD tools under musl distros has been failing with stat64 errors. Apply the aliases under non-glibc Linux to fix this problem. Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Val Packett <[email protected]> Closes #15780
Diffstat (limited to 'lib')
-rw-r--r--lib/libspl/include/os/freebsd/sys/stat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libspl/include/os/freebsd/sys/stat.h b/lib/libspl/include/os/freebsd/sys/stat.h
index 88773cceb..af488244b 100644
--- a/lib/libspl/include/os/freebsd/sys/stat.h
+++ b/lib/libspl/include/os/freebsd/sys/stat.h
@@ -76,8 +76,12 @@ fstat64_blk(int fd, struct stat64 *st)
/*
* Only Intel-based Macs have a separate stat64; Arm-based Macs are like
* FreeBSD and have a full 64-bit stat from the start.
+ *
+ * On Linux, musl libc is full 64-bit too and has deprecated its own version
+ * of these defines since version 1.2.4.
*/
-#if defined(__APPLE__) && !(defined(__i386__) || defined(__x86_64__))
+#if (defined(__APPLE__) && !(defined(__i386__) || defined(__x86_64__))) || \
+ (defined(__linux__) && !defined(__GLIBC__))
#define stat64 stat
#define fstat64 fstat
#endif