From a58400e08d23a19d713493f7c0f82f3284fd9e16 Mon Sep 17 00:00:00 2001 From: Ross Bamford Date: Tue, 8 Oct 2024 20:03:04 +0100 Subject: [PATCH] Try change based on PR comment --- .../stage2/boot_menu/Makefile | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/code/firmware/rosco_m68k_firmware/stage2/boot_menu/Makefile b/code/firmware/rosco_m68k_firmware/stage2/boot_menu/Makefile index 5adbe889..22c971bb 100644 --- a/code/firmware/rosco_m68k_firmware/stage2/boot_menu/Makefile +++ b/code/firmware/rosco_m68k_firmware/stage2/boot_menu/Makefile @@ -14,7 +14,7 @@ MAKEFLAGS += --no-builtin-rules FLAGS=-ffunction-sections -fdata-sections -fomit-frame-pointer \ -Wall -Wextra -Werror -Wno-unused-function -pedantic \ - -Wno-array-bounds -g -O2 $(DEFINES) + -g -O2 $(DEFINES) CFLAGS=-std=c2x -Wno-format -Iwelcome/include $(FLAGS) CXXFLAGS=-std=c++20 -fno-exceptions -fno-rtti $(FLAGS) @@ -44,7 +44,23 @@ CP=cp COPASM=$(XOSERA_M68K_API)/bin/copasm -ifeq ($(FIRMWARE_BUILD),true) +# GCC-version-specific settings +ifneq ($(findstring GCC,$(shell $(CC) --version 2>/dev/null)),) +CC_VERSION:=$(shell $(CC) -dumpfullversion) +CC_MAJOR:=$(firstword $(subst ., ,$(CC_VERSION))) +# If this is GCC 12, 13, or 14, add flag --param=min-pagesize=0 to CFLAGS +ifeq ($(CC_MAJOR),12) +CFLAGS+=--param=min-pagesize=0 +endif +ifeq ($(CC_MAJOR),13) +CFLAGS+=--param=min-pagesize=0 +endif +ifeq ($(CC_MAJOR),14) +CFLAGS+=--param=min-pagesize=0 +endif +endif + +ifeq ($(FIRMWARE_BUILD), true) DEFINES+=-DROSCO_M68K_FIRMWARE endif