From 02d361b4359fde9b6646129980f1484f7aa5b09e Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Tue, 2 Jun 2026 08:58:11 -0400 Subject: [PATCH] arm/ts-sp-common: Workaround unused-but-set-variable errors With the new GCC, we're seeing the following error: | In file included from /builder/meta-arm/build/tmp/work/armv8-5a-poky-linux/ts-sp-smm-gateway/git/sources/ts/components/common/dlmalloc/malloc_wrapper.c:62: | /builder/meta-arm/build/tmp/work/armv8-5a-poky-linux/ts-sp-smm-gateway/git/sources/ts/components/common/dlmalloc/malloc.c: In function 'add_segment': | /builder/meta-arm/build/tmp/work/armv8-5a-poky-linux/ts-sp-smm-gateway/git/sources/ts/components/common/dlmalloc/malloc.c:4002:7: error: variable 'nfences' set but not used [-Werror=unused-but-set-variable=] | 4002 | int nfences = 0; | | ^~~~~~~ To workaround this issue, add "-Wno-error=unused-but-set-variable" to TARGET_CFLAGS Signed-off-by: Jon Mason --- meta-arm/recipes-security/trusted-services/ts-sp-common.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-arm/recipes-security/trusted-services/ts-sp-common.inc b/meta-arm/recipes-security/trusted-services/ts-sp-common.inc index eb89127b..114e5700 100644 --- a/meta-arm/recipes-security/trusted-services/ts-sp-common.inc +++ b/meta-arm/recipes-security/trusted-services/ts-sp-common.inc @@ -33,6 +33,7 @@ INSANE_SKIP:${PN}-dev += "ldflags" TOOLCHAIN = "gcc" # FORTIFY_SOURCE is a glibc feature. Disable it for all SPs as these do not use glibc. +TARGET_CFLAGS += "-Wno-error=unused-but-set-variable" TARGET_CFLAGS:remove = "-D_FORTIFY_SOURCE=2" OECMAKE_C_FLAGS:remove = "-D_FORTIFY_SOURCE=2" OECMAKE_CXX_FLAGS:remove = "-D_FORTIFY_SOURCE=2"