diff options
-rw-r--r-- | Makefile.toolchain | 4 | ||||
-rw-r--r-- | board/cr50/build.mk | 3 | ||||
-rw-r--r-- | chip/g/build.mk | 3 | ||||
-rw-r--r-- | core/cortex-m/build.mk | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain index 9f16a3fcaf..63f04cfe0c 100644 --- a/Makefile.toolchain +++ b/Makefile.toolchain @@ -103,6 +103,8 @@ ifneq ($(cc-name),clang) CFLAGS+= -ffat-lto-objects CFLAGS+= -fconserve-stack endif +CFLAGS+=$(CFLAGS_CHIP) $(CFLAGS_BOARD) + CXXFLAGS+=-DPROTOBUF_INLINE_NOT_IN_HEADERS=0 FTDIVERSION:=$(shell $(PKG_CONFIG) --modversion libftdi1 2>/dev/null) @@ -136,7 +138,7 @@ ifneq (${SYSROOT},) LDFLAGS_EXTRA+=--sysroot=${SYSROOT} endif LDFLAGS=-nostdlib -g -Wl,-X -Wl,--gc-sections -Wl,--build-id=none \ - $(LDFLAGS_EXTRA) $(CFLAGS_CPU) + $(LDFLAGS_EXTRA) $(CFLAGS_CPU) $(CFLAGS_CHIP) $(CFLAGS_BOARD) BUILD_LDFLAGS=$(LIBFTDIUSB_LDLIBS) HOST_LDFLAGS=$(LIBFTDIUSB_LDLIBS) HOST_TEST_LDFLAGS=-Wl,-T core/host/host_exe.lds -lrt -pthread -rdynamic -lm\ diff --git a/board/cr50/build.mk b/board/cr50/build.mk index a6abbe2fed..7eda0385ec 100644 --- a/board/cr50/build.mk +++ b/board/cr50/build.mk @@ -10,6 +10,9 @@ CHIP:=g CHIP_FAMILY:=cr50 CHIP_VARIANT ?= cr50_fpga +# Additional / overriding warnings for common rules and chip +CFLAGS_BOARD :=-Warray-parameter -Wstringop-overread + # This file is included twice by the Makefile, once to determine the CHIP info # and then again after defining all the CONFIG_ and HAS_TASK variables. We use # a guard so that recipe definitions and variable extensions only happen the diff --git a/chip/g/build.mk b/chip/g/build.mk index c5227412c3..b7bf498cd2 100644 --- a/chip/g/build.mk +++ b/chip/g/build.mk @@ -7,6 +7,9 @@ CORE:=cortex-m CFLAGS_CPU+=-march=armv7-m -mcpu=cortex-m3 +# Flags to reduce unnecessary warnings with gcc 11.2 +CFLAGS_CHIP :=-Wno-stringop-overflow -Wno-array-parameter -Wno-stringop-overread + ifeq ($(CONFIG_DCRYPTO),y) INCLUDE_ROOT := $(abspath ./include) CPPFLAGS += -I$(abspath .) diff --git a/core/cortex-m/build.mk b/core/cortex-m/build.mk index 049eb49859..2bcf32317d 100644 --- a/core/cortex-m/build.mk +++ b/core/cortex-m/build.mk @@ -16,7 +16,7 @@ CFLAGS_FPU-$(CONFIG_FPU)=-mfpu=fpv4-sp-d16 -mfloat-abi=hard # CPU specific compilation flags CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog -CFLAGS_CPU+=-mno-unaligned-access -Wno-stringop-overflow +CFLAGS_CPU+=-mno-unaligned-access CFLAGS_CPU+=$(CFLAGS_FPU-y) ifneq ($(CONFIG_LTO),) |