Skip to content

Commit

Permalink
FreeBSD: Fix bootstrapping tools under Linux/musl
Browse files Browse the repository at this point in the history
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
  • Loading branch information
valpackett authored and behlendorf committed Jan 29, 2024
1 parent 276be53 commit 09a7961
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/libspl/include/os/freebsd/sys/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09a7961

Please sign in to comment.