diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-11-19 11:48:30 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-11-19 11:48:30 +0000 |
commit | 9c6d1c5070e1aee1376f7cd6c1eb6a4c35895305 (patch) | |
tree | 7522358aac22cc4589fcd5299d303e1dd0f90448 /common | |
parent | cabe0a31801e99e7abb84d2114ded6bb56f3c71e (diff) |
backtrace: Extract rules from root Makefile
It's better to have them in a separate file instead of having them spread
across the Makefile. This is what the stack protector is already doing.
Change-Id: Id30742c0af10de5ea6d10674ca25bf52b0f2b262
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/backtrace/backtrace.c (renamed from common/backtrace.c) | 0 | ||||
-rw-r--r-- | common/backtrace/backtrace.mk | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/common/backtrace.c b/common/backtrace/backtrace.c index a91d0657..a91d0657 100644 --- a/common/backtrace.c +++ b/common/backtrace/backtrace.c diff --git a/common/backtrace/backtrace.mk b/common/backtrace/backtrace.mk new file mode 100644 index 00000000..e669331c --- /dev/null +++ b/common/backtrace/backtrace.mk @@ -0,0 +1,31 @@ +# +# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +# Enable backtrace by default in DEBUG AArch64 builds +ifeq (${ARCH},aarch32) + ENABLE_BACKTRACE := 0 +else + ENABLE_BACKTRACE := ${DEBUG} +endif + +ifeq (${ENABLE_BACKTRACE},1) + # Force the compiler to include the frame pointer + TF_CFLAGS += -fno-omit-frame-pointer + + BL_COMMON_SOURCES += common/backtrace/backtrace.c +endif + +ifeq (${ARCH},aarch32) + ifeq (${ENABLE_BACKTRACE},1) + ifneq (${AARCH32_INSTRUCTION_SET},A32) + $(error Error: AARCH32_INSTRUCTION_SET=A32 is needed \ + for ENABLE_BACKTRACE when compiling for AArch32.) + endif + endif +endif + +$(eval $(call assert_boolean,ENABLE_BACKTRACE)) +$(eval $(call add_define,ENABLE_BACKTRACE)) |