From a3fb9e1c7721622fa90eaadf344cbe142cfe85a9 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 12 Sep 2023 10:18:09 -0600 Subject: [PATCH] avr: Fix compiling with GCC 13 Apply the CFLAGS workaround for GCC 13. The issue is fixed in GCC 14, so only 12 and 13 are affected. Ref: 84fe76cad47d ("avr: Fix compiling with GCC 12") Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 Signed-off-by: Tim Crawford --- src/arch/avr/toolchain.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arch/avr/toolchain.mk b/src/arch/avr/toolchain.mk index 6dbf8b5c9..aaa74ba62 100644 --- a/src/arch/avr/toolchain.mk +++ b/src/arch/avr/toolchain.mk @@ -5,7 +5,10 @@ CFLAGS += -MMD -Os -fstack-usage -Wall -Werror \ -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 -ifneq ($(findstring 12.,$(shell avr-gcc --version 2>/dev/null)),) +_gcc_version = $(shell avr-gcc --version 2>/dev/null) +ifneq ($(findstring 12.,$(_gcc_version)),) +CFLAGS += --param=min-pagesize=0 +else ifneq ($(findstring 13.,$(_gcc_version)),) CFLAGS += --param=min-pagesize=0 endif