aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2017-09-27 19:02:35 -0400
committerZhang Rui <rui.zhang@intel.com>2017-10-17 21:59:30 -0400
commitec04aa3ae87b895dbc674a7e0b78b670f73a2c22 (patch)
tree5419a5b18517b3d2721b77c42e0d177f85376835 /tools
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')
-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 @@
1# We need this for the "cc-option" macro.
2include ../../../scripts/Kbuild.include
3
1VERSION = 1.0 4VERSION = 1.0
2 5
3BINDIR=usr/bin 6BINDIR=usr/bin
4WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int 7WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
5CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector 8CFLAGS+= -O1 ${WARNFLAGS}
9# Add "-fstack-protector" only if toolchain supports it.
10CFLAGS+= $(call cc-option,-fstack-protector)
6CC=$(CROSS_COMPILE)gcc 11CC=$(CROSS_COMPILE)gcc
7 12
8CFLAGS+=-D VERSION=\"$(VERSION)\" 13CFLAGS+=-D VERSION=\"$(VERSION)\"