Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec04aa3a authored by Markus Mayer's avatar Markus Mayer Committed by Zhang Rui
Browse files

tools/thermal: tmon: use "-fstack-protector" only if supported



Most, but not all, toolchains support the "-fstack-protector" flag. We
check if the compiler supports the flag before using it. This allows
tmon to be compiled for more environments.

Signed-off-by: default avatarMarkus Mayer <mmayer@broadcom.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 2bd6bf03
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
# We need this for the "cc-option" macro.
include ../../../scripts/Kbuild.include

VERSION = 1.0
VERSION = 1.0


BINDIR=usr/bin
BINDIR=usr/bin
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector
CFLAGS+= -O1 ${WARNFLAGS}
# Add "-fstack-protector" only if toolchain supports it.
CFLAGS+= $(call cc-option,-fstack-protector)
CC=$(CROSS_COMPILE)gcc
CC=$(CROSS_COMPILE)gcc


CFLAGS+=-D VERSION=\"$(VERSION)\"
CFLAGS+=-D VERSION=\"$(VERSION)\"