osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/34408?usp=email )
Change subject: firmware/Makefile: don't use distribution's CFLAGS ......................................................................
firmware/Makefile: don't use distribution's CFLAGS
Set CFLAGS on top of the Makefile, to avoid using the distribution's default CFLAGS. In debian testing and unstable, -fcf-protection was recently added to the default CFLAGS, but it cannot be used with the cross compiler:
[COMPILING libosmocore/source/backtrace.c] cc1: error: '-fcf-protection=full' is not supported for this target make[2]: *** [Makefile:270: obj/simtrace/flash_backtrace.o] Error 1
Use the same CFLAGS as currently in debian 12 (taken from dpkg-buildflags --status). (This might also be the reason why resulting binaries got bigger with newer debian releases.)
Change-Id: I5f7cd0402f9bb85dd600204fdf8855773ddbeb70 --- M firmware/Makefile 1 file changed, 33 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/08/34408/1
diff --git a/firmware/Makefile b/firmware/Makefile index 9a2d347..3d70319 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -29,6 +29,17 @@ # Makefile for compiling the Getting Started with SAM3S Microcontrollers project
GIT_VERSION=$(shell $(TOP)/git-version-gen $(TOP)/.tarball-version) + +CFLAGS = \ + -O2 \ + -Werror=format-security \ + -Wformat \ + -ffile-prefix-map=/obs=. \ + -fstack-clash-protection \ + -fstack-protector-strong \ + -g \ + $(NULL) + #------------------------------------------------------------------------------- # User-modifiable options #-------------------------------------------------------------------------------