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

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
# 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)\"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment