summaryrefslogtreecommitdiff
path: root/tools/thermal
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2017-09-27 16:02:35 -0700
committerZhang Rui <rui.zhang@intel.com>2017-10-18 09:59:30 +0800
commitec04aa3ae87b895dbc674a7e0b78b670f73a2c22 (patch)
tree5419a5b18517b3d2721b77c42e0d177f85376835 /tools/thermal
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
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: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'tools/thermal')
-rw-r--r--tools/thermal/tmon/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 3a961e998281..5777bc78173f 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
@@ -1,8 +1,13 @@
+# We need this for the "cc-option" macro.
+include ../../../scripts/Kbuild.include
+
VERSION = 1.0
BINDIR=usr/bin
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
CFLAGS+=-D VERSION=\"$(VERSION)\"