diff --git a/makefiles/arch/avr8.inc.mk b/makefiles/arch/avr8.inc.mk index d3162648032b7..f94bd34ad364f 100644 --- a/makefiles/arch/avr8.inc.mk +++ b/makefiles/arch/avr8.inc.mk @@ -41,10 +41,3 @@ endif OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation OPTIONAL_CFLAGS_BLACKLIST += -gz - -ifeq ($(TOOLCHAIN),gnu) - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 - ifneq ($(findstring 12.,$(shell $(TARGET_ARCH)-gcc --version 2>/dev/null)),) - CFLAGS += --param=min-pagesize=0 - endif -endif diff --git a/makefiles/toolchain/gnu.inc.mk b/makefiles/toolchain/gnu.inc.mk index e3e10485b5f24..0be76867e9949 100644 --- a/makefiles/toolchain/gnu.inc.mk +++ b/makefiles/toolchain/gnu.inc.mk @@ -32,3 +32,10 @@ endif # We use GDB for debugging include $(RIOTMAKE)/tools/gdb.inc.mk + +# Data address spaces starts at zero for all supported architectures. This fixes +# compilation at least on MSP430 and AVR. +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 +ifeq ($(GCC_VERSION),12) + CFLAGS += --param=min-pagesize=0 +endif