Fix SAMD51 builds on GCC11.2

Fixes #5351
This commit is contained in:
Scott Shawcroft 2022-03-08 10:41:26 -08:00
parent 1c8f671f0a
commit 4ac6ef0086
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA

View File

@ -197,7 +197,11 @@ CFLAGS += \
-DSAM_D5X_E5X -DSAME51
endif
# GCC 11 adds stringop bounds checks that trigger when writing a memory region
# we know is ok. It's not clear how to give the compiler the info it needs so
# disable the checks for now.
# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow
LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LDFLAGS += -flto=$(shell $(NPROC))