https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105614
--- Comment #8 from Chris Packham <judge.packham at gmail dot com> --- In terms of my proposed change which fixes the problem for GCC 11.3.0 it actually triggers the same assert on GCC 12.1.0. [ALL ] In file included from /home/bagas/cross/workdir/mips64-unknown/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:21: [ERROR] /home/bagas/cross/workdir/mips64-unknown/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:75:38: error: static assertion failed [ALL ] 75 | COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); [ALL ] | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ [ALL ] /home/bagas/cross/workdir/mips64-unknown/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' [ALL ] 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") [ALL ] | ^~~~ [ALL ] /home/bagas/cross/workdir/mips64-unknown/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cpp:75:38: note: the comparison reduces to '(104 == 216)' [ALL ] 75 | COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); [ALL ] | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ [ALL ] /home/bagas/cross/workdir/mips64-unknown/.build/mips64-unknown-linux-gnu/src/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:348:44: note: in definition of macro 'COMPILER_CHECK' [ALL ] 348 | #define COMPILER_CHECK(pred) static_assert(pred, "") [ALL ] | ^~~~ [ERROR] make[5]: *** [Makefile:616: sanitizer_platform_limits_linux.lo] Error 1 It appears that with GCC 12 we now end up with different values for _MIPS_SIM. Removing my "fix" resolves the issue for GCC 12 but I suspect something like the suggestion from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105614#c7 might resolve the issue properly.