From patchwork Mon Oct 6 15:25:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 71716 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 03783CCA471 for ; Mon, 6 Oct 2025 15:25:40 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.36647.1759764332176117957 for ; Mon, 06 Oct 2025 08:25:32 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); 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 7E6621515 for ; Mon, 6 Oct 2025 08:25:23 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.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 0E2543F66E for ; Mon, 6 Oct 2025 08:25:30 -0700 (PDT) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH] arm-bsp/edk2-firmware: backport a patch to fix builds with host gcc15 Date: Mon, 6 Oct 2025 16:25:26 +0100 Message-ID: <20251006152526.2401666-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 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 ; Mon, 06 Oct 2025 15:25:40 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/6725 Backport a patch from upstream to fix the build of antlr with GCC 15 on the host. The build still fails with clang, so update the message with the current error message. Signed-off-by: Ross Burton --- .../recipes-bsp/uefi/edk2-firmware_202408.bb | 7 ++- .../0001-BaseTools-Pccts-set-C-standard.patch | 47 +++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 meta-arm-bsp/recipes-bsp/uefi/files/0001-BaseTools-Pccts-set-C-standard.patch diff --git a/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_202408.bb b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_202408.bb index ea03d47ba1..fa44e28f7f 100644 --- a/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_202408.bb +++ b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_202408.bb @@ -1,9 +1,12 @@ SRCREV_edk2 ?= "b158dad150bf02879668f72ce306445250838201" SRCREV_edk2-platforms ?= "a3c898956a4d48dc5980336fa6ce6eeb23c4f72b" -SRC_URI += "file://0001-Platform-StMmRpmb-Fix-build.patch;patchdir=edk2-platforms" +SRC_URI += "file://0001-Platform-StMmRpmb-Fix-build.patch;patchdir=edk2-platforms \ + file://0001-BaseTools-Pccts-set-C-standard.patch" -# FIXME - clang is having issues with antlr +# FIXME: +# ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c:146:37: +# error: variable 'ContainedElements' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] TOOLCHAIN:aarch64 = "gcc" require recipes-bsp/uefi/edk2-firmware.inc diff --git a/meta-arm-bsp/recipes-bsp/uefi/files/0001-BaseTools-Pccts-set-C-standard.patch b/meta-arm-bsp/recipes-bsp/uefi/files/0001-BaseTools-Pccts-set-C-standard.patch new file mode 100644 index 0000000000..058073c9d8 --- /dev/null +++ b/meta-arm-bsp/recipes-bsp/uefi/files/0001-BaseTools-Pccts-set-C-standard.patch @@ -0,0 +1,47 @@ +From e063f8b8a53861043b9872cc35b08a3dc03b0942 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 20 Jan 2025 09:40:31 +0100 +Subject: [PATCH] BaseTools/Pccts: set C standard + +The prehistoric code base doesn't build with ISO C23. Set the C +standard to C11 (for both clang and gcc) so it continues to build with +gcc 15 (which uses C23 by default). + +Signed-off-by: Gerd Hoffmann + +Upstream-Status: Backport [e063f8b8a53861043b9872cc35b08a3dc03b0942] +Signed-off-by: Ross Burton +--- + BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 2 +- + BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +index 746d58b5e2..b47c8a37af 100644 +--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +@@ -169,7 +169,7 @@ ANTLR=${BIN_DIR}/antlr + DLG=${BIN_DIR}/dlg + OBJ_EXT=o + OUT_OBJ = -o +-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536 ++CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536 -std=gnu11 + CPPFLAGS= + # + # SGI Users, use this CFLAGS +diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +index e45ac98e04..d72bee3d70 100644 +--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +@@ -123,7 +123,7 @@ endif + COPT=-O + ANTLR=${BIN_DIR}/antlr + DLG=${BIN_DIR}/dlg +-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 ++CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536 -std=gnu11 + CPPFLAGS= + OBJ_EXT=o + OUT_OBJ = -o +-- +2.43.0 +