From 9e0e0ddd5a9b62dd93ab2857bc6b22f3eb1acfc0 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 7 Apr 2021 15:19:00 +0200 Subject: [PATCH] firmware: qmod-dfu: disable stack protector Prevent build failure on debian 9, ubuntu 20.04, 20.10, where bin/qmod-dfu-flash.elf does not fit the ROM. Fixes: OS#5081 Change-Id: I9fffe4c323094679062428f41a4246b1c1b30ca2 --- firmware/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/Makefile b/firmware/Makefile index 2d0f62c9..b147b0d7 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -59,6 +59,11 @@ OUTPUT = $(BOARD)-$(APP) BIN = bin OBJ = obj/$(BOARD) +# Disable stack protector for code in small ROM regions (OS#5081) +ifeq ($(BOARD)-$(APP), qmod-dfu) +CFLAGS_EXTRA ?= -fno-stack-protector +endif + #------------------------------------------------------------------------------- # Tools #------------------------------------------------------------------------------- @@ -178,6 +183,7 @@ CFLAGS += -ffunction-sections -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_L CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD) CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP) +CFLAGS += $(CFLAGS_EXTRA) ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__ LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--print-memory-usage -Wl,--no-undefined $(LIB) #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats