Changed check if -fstack-protector-strong is supported

This commit is contained in:
Alain 2016-10-13 15:41:22 +02:00
parent 0d0a2cbbd7
commit ab7dcb8ee6

View file

@ -31,13 +31,11 @@ CC=@CC@
PKG_CONFIG=@PKG_CONFIG@
MSGFMT_PATH=@MSGFMT_PATH@
# Check if GCC >= 5.0 before enabling stack smashing protection
ifeq "$(CC)" "gcc"
GCCVERGEQ5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 5)
ifeq "$(GCCVERGEQ5)" "1"
# Check if -fstack-protector-strong is supported before enabling it
SPUNSUPPORTED = $(shell $(CC) -fstack-protector-strong 2>&1 | grep -c 'stack-protector-strong')
ifeq "$(SPUNSUPPORTED)" "0"
CFLAGS += -fstack-protector-strong
endif
endif
DEP=dep
EXE=bin