diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index 3719bfb004..114e774503 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -142,6 +142,12 @@ ifeq ($(BR2_mips64)$(BR2_mips64el):$(BR2_MIPS_NABI32),y:y) HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer endif +# libsanitizer bundled in gcc 12 fails to build for mips32 due to +# mixing kernel and user struct stat. +ifeq ($(BR2_mips)$(BR2_mipsel):$(BR2_TOOLCHAIN_GCC_AT_LEAST_12),y:y) +HOST_GCC_COMMON_CONF_OPTS += --disable-libsanitizer +endif + # The logic in libbacktrace/configure.ac to detect if __sync builtins # are available assumes they are as soon as target_subdir is not # empty, i.e when cross-compiling. However, some platforms do not have