2017-02-24 18:14:15 +00:00
|
|
|
#
|
2019-03-26 16:59:26 +00:00
|
|
|
# Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
|
2017-02-24 18:14:15 +00:00
|
|
|
#
|
2017-05-03 09:38:09 +01:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2017-02-24 18:14:15 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Boolean macro to be used in C code
|
|
|
|
STACK_PROTECTOR_ENABLED := 0
|
|
|
|
|
2019-03-26 16:59:26 +00:00
|
|
|
ifeq (${ENABLE_STACK_PROTECTOR},0)
|
|
|
|
ENABLE_STACK_PROTECTOR := none
|
|
|
|
endif
|
|
|
|
|
2019-10-20 18:54:32 +01:00
|
|
|
ifeq (${ENABLE_STACK_PROTECTOR},none)
|
|
|
|
TF_CFLAGS += -fno-stack-protector
|
|
|
|
else
|
2019-03-26 16:59:26 +00:00
|
|
|
STACK_PROTECTOR_ENABLED := 1
|
|
|
|
BL_COMMON_SOURCES += lib/stack_protector/stack_protector.c \
|
2017-02-24 18:14:15 +00:00
|
|
|
lib/stack_protector/${ARCH}/asm_stack_protector.S
|
|
|
|
|
2019-03-26 16:59:26 +00:00
|
|
|
ifeq (${ENABLE_STACK_PROTECTOR},default)
|
|
|
|
TF_CFLAGS += -fstack-protector
|
|
|
|
else
|
|
|
|
TF_CFLAGS += -fstack-protector-${ENABLE_STACK_PROTECTOR}
|
|
|
|
endif
|
2017-02-24 18:14:15 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(call add_define,STACK_PROTECTOR_ENABLED))
|