diff options
author | Markus Mayer <mmayer@broadcom.com> | 2017-09-27 19:02:35 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2017-10-17 21:59:30 -0400 |
commit | ec04aa3ae87b895dbc674a7e0b78b670f73a2c22 (patch) | |
tree | 5419a5b18517b3d2721b77c42e0d177f85376835 /tools | |
parent | 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (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/Makefile | 7 |
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. | ||
2 | include ../../../scripts/Kbuild.include | ||
3 | |||
1 | VERSION = 1.0 | 4 | VERSION = 1.0 |
2 | 5 | ||
3 | BINDIR=usr/bin | 6 | BINDIR=usr/bin |
4 | WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int | 7 | WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int |
5 | CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector | 8 | CFLAGS+= -O1 ${WARNFLAGS} |
9 | # Add "-fstack-protector" only if toolchain supports it. | ||
10 | CFLAGS+= $(call cc-option,-fstack-protector) | ||
6 | CC=$(CROSS_COMPILE)gcc | 11 | CC=$(CROSS_COMPILE)gcc |
7 | 12 | ||
8 | CFLAGS+=-D VERSION=\"$(VERSION)\" | 13 | CFLAGS+=-D VERSION=\"$(VERSION)\" |