From patchwork Tue Jun 2 12:58:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 89193 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 90EAECD6E60 for ; Tue, 2 Jun 2026 12:58:17 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.24538.1780405092764136992 for ; Tue, 02 Jun 2026 05:58:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=vLQ42xK4; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@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 17C41169C for ; Tue, 2 Jun 2026 05:58:07 -0700 (PDT) Received: from H24V3P4C17.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 DEB473F632 for ; Tue, 2 Jun 2026 05:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1780405092; bh=VdeZniOnK/tgy9T7x1lK8kwKZlD8YTZ9y5UFaxovUo0=; h=From:To:Subject:Date:From; b=vLQ42xK45DxNRoFNLaSkhxR/M+t0Bb9wM1l0BJw2iBrCsSBwHABMC8eXHXkWuzIfi s9aUt8XndGsLmz52gkEdzmY2SCKgKFVYqxhquS1bJwe8zJI67LFqnQoQR36sNLapGH xSJKAeSYCakJMkcJ9/042sKrizfmq+WcOBV3uCBA= From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 1/2] arm/tf-a-tests: Workaround GCC errors for 'unused-but-set-variable' Date: Tue, 2 Jun 2026 08:58:10 -0400 Message-ID: <20260602125811.54843-1-jon.mason@arm.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Jun 2026 12:58:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/7067 New GCC is logging errors for unused-but-set-variable in tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c Workaround this by adding -Wno-unused-but-set-variable to the Makefile Refer to https://github.com/TrustedFirmware-A/tf-a-tests/issues/4 For the upstream resolution, if/when that arrives. Signed-off-by: Jon Mason --- ...1-Fix-GCC-errors-in-test_psci_stat.c.patch | 41 +++++++++++++++++++ .../trusted-firmware-a/tf-a-tests_2.14.0.bb | 2 + 2 files changed, 43 insertions(+) create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-Fix-GCC-errors-in-test_psci_stat.c.patch diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-Fix-GCC-errors-in-test_psci_stat.c.patch b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-Fix-GCC-errors-in-test_psci_stat.c.patch new file mode 100644 index 000000000000..a03fb8405832 --- /dev/null +++ b/meta-arm/recipes-bsp/trusted-firmware-a/files/0001-Fix-GCC-errors-in-test_psci_stat.c.patch @@ -0,0 +1,41 @@ +From 042dcbc95249a2311e8a784fa7193299aa2ad651 Mon Sep 17 00:00:00 2001 +From: Jon Mason +Date: Sat, 30 May 2026 10:24:53 -0400 +Subject: [PATCH] Fix GCC errors in test_psci_stat.c + +With the latest GCC, we're seeing the errors: + +| tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c: In function 'test_psci_stats_cpu_off': +| tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c:681:23: error: variable 'off_cpu_count' set but not used [-Werror=unused-but-set-variable=] +| 681 | int cpu_node, off_cpu_count = 0, ret; +| | ^~~~~~~~~~~~~ +| tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c: In function 'test_psci_stats_system_suspend': +| tftf/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c:800:23: error: variable 'off_cpu_count' set but not used [-Werror=unused-but-set-variable=] +| 800 | int cpu_node, off_cpu_count = 0; +| | ^~~~~~~~~~~~~ + +This is because assert is being #ifdef'ed out and thus the variable is +never being used. Add '-Wno-unused-but-set-variable' to the Makefile to +workaround the issue. + +See https://github.com/TrustedFirmware-A/tf-a-tests/issues/4 + +Signed-off-by: Jon Mason +Upstream-Status: Pending +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 9d222acc30b4..806329382da5 100644 +--- a/Makefile ++++ b/Makefile +@@ -277,7 +277,7 @@ GCC_ASFLAGS_aarch64 := -mgeneral-regs-only ${march64-directive} + + GCC_WARNINGS += -nostdinc -ffreestanding -Wall -Werror \ + -Wmissing-include-dirs $(GCC_CFLAGS_$(ARCH)) \ +- -std=gnu99 -Os ++ -Wno-unused-but-set-variable -std=gnu99 -Os + + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 + GCC_CFLAGS += $(call cc_option, --param=min-pagesize=0) diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.14.0.bb b/meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.14.0.bb index dcd97d1a196d..a65106f24ede 100644 --- a/meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.14.0.bb +++ b/meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.14.0.bb @@ -12,6 +12,8 @@ SRC_URI = "${SRC_URI_TRUSTED_FIRMWARE_A_TESTS};branch=${SRCBRANCH}" SRCBRANCH = "master" SRCREV = "3b3d800133081b48482b1205a32671b82bc2b640" +SRC_URI += "file://0001-Fix-GCC-errors-in-test_psci_stat.c.patch" + EXTRA_OEMAKE += "USE_NVM=0" EXTRA_OEMAKE += "SHELL_COLOR=1" EXTRA_OEMAKE += "DEBUG=1" From patchwork Tue Jun 2 12:58:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 89192 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 8E954CD6E64 for ; Tue, 2 Jun 2026 12:58:17 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.24539.1780405093052442347 for ; Tue, 02 Jun 2026 05:58:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=L6mBPnud; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jon.mason@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 592492364 for ; Tue, 2 Jun 2026 05:58:07 -0700 (PDT) Received: from H24V3P4C17.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 2A25D3F93E for ; Tue, 2 Jun 2026 05:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1780405092; bh=i4u9z82CPkRq2iiuduqF5HwVFNgewjcRKzWwaBeRA7s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L6mBPnud81jCtcau9CZ/E01B+9opA+UouCiZbIqC8W+W6l/NxwUA7Hg8xmf50KGY5 Lk4hNI/MRBnBqgPrUVsmLaBmzGCYG9nXQmzh41Pn1ctpEETn6ZNJDnciJZhSm9TVvy mYlb3ZNdzzswp11Pc2FmA8hXMd45cEHTVDKSspIs= From: Jon Mason To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/2] arm/ts-sp-common: Workaround unused-but-set-variable errors Date: Tue, 2 Jun 2026 08:58:11 -0400 Message-ID: <20260602125811.54843-2-jon.mason@arm.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260602125811.54843-1-jon.mason@arm.com> References: <20260602125811.54843-1-jon.mason@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 02 Jun 2026 12:58:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/7068 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 eb89127b766c..114e5700a16e 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"