From patchwork Thu Mar 30 16:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 21944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B86FDC6FD1D for ; Thu, 30 Mar 2023 16:38:22 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.30668.1680194300909721050 for ; Thu, 30 Mar 2023 09:38:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC5E41650; Thu, 30 Mar 2023 09:39:04 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2087D3F6C4; Thu, 30 Mar 2023 09:38:20 -0700 (PDT) From: Ross Burton To: meta-arm@lists.yoctoproject.org Cc: nd@arm.com Subject: [PATCH 5/6] arm/scp-firmware: improve debug packaging Date: Thu, 30 Mar 2023 17:38:14 +0100 Message-Id: <20230330163815.3677638-5-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230330163815.3677638-1-ross.burton@arm.com> References: <20230330163815.3677638-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 30 Mar 2023 16:38:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4516 Instead of a SCP_BUILD_RELEASE boolean, add CMAKE_BUILD_TYPE and default to RelWithDebInfo which gives us release (optimised) builds with debug symbols in the matching .elf files. To ensure that buildpaths don't leak into the debug symbols, pass the debug prefix maps via CFLAGS and ASMFLAGS. Signed-off-by: Ross Burton --- .../recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb index a1662d58..b9d0953a 100644 --- a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb +++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb @@ -14,7 +14,7 @@ SRCREV = "673d014f3861ad81cc5ab06d2884a314a610799b" PROVIDES += "virtual/control-processor-firmware" -SCP_BUILD_RELEASE ?= "1" +CMAKE_BUILD_TYPE ?= "RelWithDebInfo" SCP_PLATFORM ?= "invalid" SCP_COMPILER ?= "arm-none-eabi" SCP_LOG_LEVEL ?= "WARN" @@ -29,8 +29,6 @@ DEPENDS = "virtual/arm-none-eabi-gcc-native \ # For now we only build with GCC, so stop meta-clang trying to get involved TOOLCHAIN = "gcc" -SCP_BUILD_STR = "${@bb.utils.contains('SCP_BUILD_RELEASE', '1', 'Release', 'Debug', d)}" - inherit deploy B = "${WORKDIR}/build" @@ -39,13 +37,16 @@ S = "${WORKDIR}/git" # Allow platform specific copying of only scp or both scp & mcp, default to both FW_TARGETS ?= "scp mcp" FW_INSTALL ?= "ramfw romfw" + PACKAGE_ARCH = "${MACHINE_ARCH}" COMPATIBLE_MACHINE ?= "invalid" +export CFLAGS = "${DEBUG_PREFIX_MAP}" +export ASMFLAGS = "${DEBUG_PREFIX_MAP}" + LDFLAGS[unexport] = "1" -CFLAGS[unexport] = "1" -EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${SCP_BUILD_STR} \ +EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ -D SCP_LOG_LEVEL=${SCP_LOG_LEVEL} \ -D SCP_PLATFORM_FEATURE_SET=${SCP_PLATFORM_FEATURE_SET} \ -D DISABLE_CPPCHECK=1 \