From 9171569eb355878c806add4f6895e1256bfb4168 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 30 Mar 2023 17:38:14 +0100 Subject: [PATCH] arm/scp-firmware: improve debug packaging 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 Signed-off-by: Jon Mason --- .../recipes-bsp/scp-firmware/scp-firmware_2.10.0.bb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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" -LDFLAGS[unexport] = "1" -CFLAGS[unexport] = "1" +export CFLAGS = "${DEBUG_PREFIX_MAP}" +export ASMFLAGS = "${DEBUG_PREFIX_MAP}" -EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${SCP_BUILD_STR} \ +LDFLAGS[unexport] = "1" + +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 \