aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/stack_protector/stack_protector.mk19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/stack_protector/stack_protector.mk b/lib/stack_protector/stack_protector.mk
index 0f0d90fb8..94e804be9 100644
--- a/lib/stack_protector/stack_protector.mk
+++ b/lib/stack_protector/stack_protector.mk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -7,13 +7,20 @@
# Boolean macro to be used in C code
STACK_PROTECTOR_ENABLED := 0
-ifneq (${ENABLE_STACK_PROTECTOR},0)
-STACK_PROTECTOR_ENABLED := 1
-BL_COMMON_SOURCES += lib/stack_protector/stack_protector.c \
+ifeq (${ENABLE_STACK_PROTECTOR},0)
+ ENABLE_STACK_PROTECTOR := none
+endif
+
+ifneq (${ENABLE_STACK_PROTECTOR},none)
+ STACK_PROTECTOR_ENABLED := 1
+ BL_COMMON_SOURCES += lib/stack_protector/stack_protector.c \
lib/stack_protector/${ARCH}/asm_stack_protector.S
-TF_CFLAGS += -fstack-protector-${ENABLE_STACK_PROTECTOR}
+ ifeq (${ENABLE_STACK_PROTECTOR},default)
+ TF_CFLAGS += -fstack-protector
+ else
+ TF_CFLAGS += -fstack-protector-${ENABLE_STACK_PROTECTOR}
+ endif
endif
$(eval $(call add_define,STACK_PROTECTOR_ENABLED))
-