gcc15 AVR compilation fixes (#25238)

This commit is contained in:
Nick Brassel 2025-05-19 09:22:31 +10:00 committed by GitHub
parent 81355045cc
commit a4ef1ae736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 5 deletions

View file

@ -12,9 +12,10 @@ HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
BIN =
ifeq ("$(shell echo "int main(){}" | $(CC) --param=min-pagesize=0 -x c - -o /dev/null 2>&1)", "")
COMPILEFLAGS += --param=min-pagesize=0
endif
COMPILEFLAGS += $(call cc-option,--param=min-pagesize=0)
# Fix ICE's: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116389
COMPILEFLAGS += $(call cc-option,-mlra)
COMPILEFLAGS += -funsigned-char
COMPILEFLAGS += -funsigned-bitfields
@ -25,10 +26,12 @@ COMPILEFLAGS += -fshort-enums
COMPILEFLAGS += -mcall-prologues
COMPILEFLAGS += -fno-builtin-printf
# Linker relaxation is only possible if
# link time optimizations are not enabled.
# On older compilers, linker relaxation is only possible if link time optimizations are not enabled.
ifeq ($(strip $(LTO_ENABLE)), no)
COMPILEFLAGS += -mrelax
else
# Newer compilers may support both, so quickly check before adding `-mrelax`.
COMPILEFLAGS += $(call cc-option,-mrelax,,-flto=auto)
endif
ASFLAGS += $(AVR_ASFLAGS)