diff options
author | Markus Mayer <mmayer@broadcom.com> | 2017-09-27 16:02:35 -0700 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2017-10-18 09:59:30 +0800 |
commit | ec04aa3ae87b895dbc674a7e0b78b670f73a2c22 (patch) | |
tree | 5419a5b18517b3d2721b77c42e0d177f85376835 /tools/thermal/tmon/Makefile | |
parent | 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff) | |
download | linux-ec04aa3ae87b895dbc674a7e0b78b670f73a2c22.tar.bz2 |
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/tmon/Makefile')
-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 @@ +# 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)\" |