From 4466cf8255aef834e79e5d69ddc4fbd71f6e3236 Mon Sep 17 00:00:00 2001 From: Daniel Boulby Date: Tue, 3 May 2022 16:46:16 +0100 Subject: [PATCH] fix(build): use DWARF 4 when building debug GCC 11 and Clang 14 now use the DWARF 5 standard by default however Arm-DS currently only supports up to version 4. Therefore, for debug builds, ensure the DWARF 4 standard is used. Also update references for Arm DS-5 to it's successor Arm-DS (Arm Development Studio). Change-Id: Ica59588de3d121c1b795b3699f42c31f032cee49 Signed-off-by: Daniel Boulby --- Makefile | 9 ++------- docs/getting_started/build-options.rst | 12 ++++++------ docs/getting_started/prerequisites.rst | 5 ++--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 05d97b006..6e72f751e 100644 --- a/Makefile +++ b/Makefile @@ -307,13 +307,8 @@ endif $(eval $(call add_define,DEBUG)) ifneq (${DEBUG}, 0) BUILD_TYPE := debug - TF_CFLAGS += -g - - ifneq ($(findstring clang,$(notdir $(CC))),) - ASFLAGS += -g - else - ASFLAGS += -g -Wa,--gdwarf-2 - endif + TF_CFLAGS += -g -gdwarf-4 + ASFLAGS += -g -Wa,-gdwarf-4 # Use LOG_LEVEL_INFO by default for debug builds LOG_LEVEL := 40 diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst index be50e5edf..cfd7201c3 100644 --- a/docs/getting_started/build-options.rst +++ b/docs/getting_started/build-options.rst @@ -1051,11 +1051,11 @@ To compile a debug version and make the build more verbose use make PLAT= DEBUG=1 V=1 all -AArch64 GCC uses DWARF version 4 debugging symbols by default. Some tools (for -example DS-5) might not support this and may need an older version of DWARF -symbols to be emitted by GCC. This can be achieved by using the -``-gdwarf-`` flag, with the version being set to 2 or 3. Setting the -version to 2 is recommended for DS-5 versions older than 5.16. +AArch64 GCC 11 uses DWARF version 5 debugging symbols by default. Some tools +(for example Arm-DS) might not support this and may need an older version of +DWARF symbols to be emitted by GCC. This can be achieved by using the +``-gdwarf-`` flag, with the version being set to 2, 3, 4 or 5. Setting +the version to 4 is recommended for Arm-DS. When debugging logic problems it might also be useful to disable all compiler optimizations by using ``-O0``. @@ -1080,7 +1080,7 @@ It is also possible to introduce an infinite loop to help in debugging the post-BL2 phase of TF-A. This can be done by rebuilding BL1 with the ``SPIN_ON_BL1_EXIT=1`` build flag. Refer to the :ref:`build_options_common` section. In this case, the developer may take control of the target using a -debugger when indicated by the console output. When using DS-5, the following +debugger when indicated by the console output. When using Arm-DS, the following commands can be used: :: diff --git a/docs/getting_started/prerequisites.rst b/docs/getting_started/prerequisites.rst index c625090e7..0b8a71cbc 100644 --- a/docs/getting_started/prerequisites.rst +++ b/docs/getting_started/prerequisites.rst @@ -7,7 +7,6 @@ AArch32 and AArch64 target platforms. It may possible to build |TF-A| with combinations of software packages that are different from those listed below, however only the software described in this document can be officially supported. - Build Host ---------- @@ -71,7 +70,7 @@ These tools are optional: source files (``.dts`` files). DTC is available for Linux through the package repositories of most distributions. -- Arm `Development Studio 5 (DS-5)`_ +- Arm `Development Studio (Arm-DS)`_ The standard software package used for debugging software on Arm development platforms and |FVP| models. @@ -166,5 +165,5 @@ documentation, available `here `_. .. _Gerrit Code Review: https://www.gerritcodereview.com/ .. _Linaro Release Notes: https://community.arm.com/dev-platforms/w/docs/226/old-release-notes .. _Linaro instructions: https://community.arm.com/dev-platforms/w/docs/304/arm-reference-platforms-deliverables -.. _Development Studio 5 (DS-5): https://developer.arm.com/products/software-development-tools/ds-5-development-studio +.. _Development Studio (Arm-DS): https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio .. _Linaro Release 20.01: http://releases.linaro.org/members/arm/platforms/20.01