Antonio Nino Diaz | c3a2cf2 | 2018-11-19 11:48:30 +0000 | [diff] [blame] | 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 |
| 8 | ifeq (${ARCH},aarch32) |
| 9 | ENABLE_BACKTRACE := 0 |
| 10 | else |
| 11 | ENABLE_BACKTRACE := ${DEBUG} |
| 12 | endif |
| 13 | |
| 14 | ifeq (${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 |
| 19 | endif |
| 20 | |
| 21 | ifeq (${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 |
| 28 | endif |
| 29 | |
| 30 | $(eval $(call assert_boolean,ENABLE_BACKTRACE)) |
| 31 | $(eval $(call add_define,ENABLE_BACKTRACE)) |