1# 2# Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7# Boolean macro to be used in C code 8STACK_PROTECTOR_ENABLED := 0 9 10ifeq (${ENABLE_STACK_PROTECTOR},0) 11 ENABLE_STACK_PROTECTOR := none 12endif 13 14ifeq (${ENABLE_STACK_PROTECTOR},none) 15 TF_CFLAGS += -fno-stack-protector 16else 17 STACK_PROTECTOR_ENABLED := 1 18 BL_COMMON_SOURCES += lib/stack_protector/stack_protector.c \ 19 lib/stack_protector/${ARCH}/asm_stack_protector.S 20 21 ifeq (${ENABLE_STACK_PROTECTOR},default) 22 TF_CFLAGS += -fstack-protector 23 else 24 TF_CFLAGS += -fstack-protector-${ENABLE_STACK_PROTECTOR} 25 endif 26endif 27 28$(eval $(call add_define,STACK_PROTECTOR_ENABLED)) 29