defs-dist.mk: Support USE_STACK_PROTECTOR and USE_STACK_CHECKER

Add support for make variables USE_STACK_PROTECTOR and USE_STACK_CHECKER

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-03-20 20:22:59 +00:00
commit ea02655437
3 changed files with 18 additions and 3 deletions

View file

@ -274,6 +274,8 @@ COMPILE_DEBUG_CODE ?= true
#COMPILE_DEBUG_LOG ?= true #COMPILE_DEBUG_LOG ?= true
USE_COMPILER_DEBUG_OPTS ?= true USE_COMPILER_DEBUG_OPTS ?= true
#USE_COMPILER_OPTIMIZATION_OPTS ?= true #USE_COMPILER_OPTIMIZATION_OPTS ?= true
USE_STACK_PROTECTOR ?= true
#USE_STACK_CHECKER ?= true
#USE_FUSE ?= true #USE_FUSE ?= true
#USE_SNDFILE ?= true #USE_SNDFILE ?= true

View file

@ -273,7 +273,9 @@ LOG_THREAD_NAMES ?= true
#COMPILE_DEBUG_CODE ?= true #COMPILE_DEBUG_CODE ?= true
#COMPILE_DEBUG_LOG ?= true #COMPILE_DEBUG_LOG ?= true
USE_COMPILER_DEBUG_OPTS ?= true USE_COMPILER_DEBUG_OPTS ?= true
#USE_COMPILER_OPTIMIZATION_OPTS ?= true USE_COMPILER_OPTIMIZATION_OPTS ?= true
USE_STACK_PROTECTOR ?= true
#USE_STACK_CHECKER ?= true
#USE_FUSE ?= true #USE_FUSE ?= true
#USE_SNDFILE ?= true #USE_SNDFILE ?= true

View file

@ -842,9 +842,20 @@ endif
ifeq ($(USE_STACK_PROTECTOR),true) ifeq ($(USE_STACK_PROTECTOR),true)
BUILD_CFLAGS += -fstack-protector-all BUILD_CFLAGS += -fstack-protector-all
BUILD_CPPFLAGS += -fstack-protector-all
# BUILD_CFLAGS += -fstack-protector # BUILD_CFLAGS += -fstack-protector
endif endif
ifeq ($(USE_STACK_CHECKER),true)
ifeq "$(COMPILER_SUITE)" "clang"
BUILD_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
BUILD_CPPFLAGS += -fsanitize=address -fno-omit-frame-pointer
BUILD_LDFLAGS += -fsanitize=address
else
endif
endif
ifeq ($(USE_DBMALLOC),true) ifeq ($(USE_DBMALLOC),true)
CONTRIB_LIBS += dbmalloc CONTRIB_LIBS += dbmalloc
BUILD_CFLAGS+= -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc BUILD_CFLAGS+= -DDBMALLOC -DEXITFUN=_exit -I$(TOPDIR)/contrib/dbmalloc