Merge pull request #6128 from tannewt/gcc11_stringop

Fix SAMD51 builds on GCC11.2
This commit is contained in:
Dan Halbert 2022-03-09 13:32:56 -05:00 committed by GitHub
commit 3089c9b7fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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))