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 <jon.mason@arm.com>
This commit is contained in:
Jon Mason committed 2026-06-02 09:00:04 -04:00
1 parent f23b86a59c
commit 02d361b435
1 file changed
+1
@@ -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"