1#
2# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Enable backtrace by default in DEBUG AArch64 builds
8ifeq (${ARCH},aarch32)
9        ENABLE_BACKTRACE 	:=	0
10else
11        ENABLE_BACKTRACE 	:=	${DEBUG}
12endif
13
14ifeq (${ENABLE_BACKTRACE},1)
15        # Force the compiler to include the frame pointer
16        TF_CFLAGS		+=	-fno-omit-frame-pointer
17
18        BL_COMMON_SOURCES	+=	common/backtrace/backtrace.c
19endif
20
21ifeq (${ARCH},aarch32)
22        ifeq (${ENABLE_BACKTRACE},1)
23                ifneq (${AARCH32_INSTRUCTION_SET},A32)
24                        $(error Error: AARCH32_INSTRUCTION_SET=A32 is needed \
25                        for ENABLE_BACKTRACE when compiling for AArch32.)
26                endif
27        endif
28endif
29
30$(eval $(call assert_boolean,ENABLE_BACKTRACE))
31$(eval $(call add_define,ENABLE_BACKTRACE))
32