musl dropped the LFS64 interfaces in 1.2.4, so the stat64 paths cannot be
built there.  From Alpine's community/firefox lfs64.patch, except that the
conditions are keyed on __GLIBC__ rather than switched off outright: 32-bit
glibc still needs stat64 for large files, and the sandbox broker still needs
the matching struct layout.

--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -19,7 +19,8 @@
 
 // stat64 and lstat64 are deprecated on OS X. Normal stat and lstat are
 // 64-bit by default on OS X 10.6+.
-#if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
+#if defined(__GLIBC__) && defined(HAVE_STAT64) && \
+    defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
 #  define STAT stat64
 #  define LSTAT lstat64
 #  define HAVE_STATS64 1
--- a/mozglue/baseprofiler/core/shared-libraries-linux.cc
+++ b/mozglue/baseprofiler/core/shared-libraries-linux.cc
@@ -177,7 +177,8 @@
       return false;
     }
 
-#if defined(__x86_64__) || defined(__aarch64__) || \
+#if !defined(__GLIBC__) || defined(__x86_64__) || \
+    defined(__aarch64__) ||                        \
     (defined(__mips__) && _MIPS_SIM == _ABI64) ||  \
     !(defined(GP_OS_linux) || defined(GP_OS_android))
 
--- a/security/sandbox/linux/broker/SandboxBrokerUtils.h
+++ b/security/sandbox/linux/broker/SandboxBrokerUtils.h
@@ -14,7 +14,8 @@
 // calls. We'll intercept those and handle them in the stat functions
 // but must be sure to use the right structure layout.
 
-#if defined(__NR_stat64) || defined(__NR_fstatat64)
+#if defined(__GLIBC__) && \
+    (defined(__NR_stat64) || defined(__NR_fstatat64))
 typedef struct stat64 statstruct;
 #  define statsyscall stat64
 #  define lstatsyscall lstat64
