https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604
--- Comment #6 from YunQiang Su <syq at debian dot org> --- Index: gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat.d =================================================================== --- gcc-12-12-20211211.orig/src/libphobos/libdruntime/core/sys/posix/sys/stat.d +++ gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat.d @@ -347,7 +347,7 @@ version (CRuntime_Glibc) { c_ulong st_dev; int[3] st_pad1; - static if (!__USE_FILE_OFFSET64) + static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { ino_t st_ino; } @@ -360,7 +360,7 @@ version (CRuntime_Glibc) uid_t st_uid; gid_t st_gid; c_ulong st_rdev; - static if (!__USE_FILE_OFFSET64) + static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { uint[2] st_pad2; off_t st_size; @@ -394,7 +394,7 @@ version (CRuntime_Glibc) } blksize_t st_blksize; uint st_pad4; - static if (!__USE_FILE_OFFSET64) + static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { blkcnt_t st_blocks; } This patch can solve this problem: of course, we need to back port it to gcc-10/gcc-11 also. The problem is due to that: N32 and N64 uses different "struct stat" In the older version, __USE_FILE_OFFSET64 may be not defined for N64 while now, it is defined.