xref: /rk3399_ARM-atf/lib/stack_protector/stack_protector.mk (revision 7e8b7096d12cb72f6ee5c24804d4da81d0595dc9)
1#
2# Copyright (c) 2017-2025, 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  cflags-common		+=      -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    cflags-common	+=	-fstack-protector
23  else
24    cflags-common	+=	-fstack-protector-${ENABLE_STACK_PROTECTOR}
25  endif
26endif
27
28$(eval $(call add_define,STACK_PROTECTOR_ENABLED))
29