public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Yoann Congal" <yoann.congal@smile.fr>
To: "Yoann Congal" <yoann.congal@smile.fr>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][scarthgap 37/66] ovmf: backport a fix for build with gcc-16
Date: Fri, 24 Apr 2026 23:15:45 +0200	[thread overview]
Message-ID: <DI1P39S0V3L3.3HVBRCKGI9CPF@smile.fr> (raw)
In-Reply-To: <7de54889b3547a94bc7c6015731ec1c099e4d629.1777064068.git.yoann.congal@smile.fr>

On Fri Apr 24, 2026 at 10:55 PM CEST, Yoann Congal wrote:
> From: Martin Jansa <martin.jansa@gmail.com>
>
> Fixes build on host with gcc-16:
>
> StringFuncs.c: In function ‘SplitStringByWhitespace’:
> StringFuncs.c:113:15: error: variable ‘Item’ set but not used [-Werror=unused-but-set-variable=]
>   113 |   UINTN       Item;
>       |               ^~~~
>
> and
>
> EfiRom.c: In function ‘main’:
> EfiRom.c:78:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
>    78 |       if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
>       |                 ^
>
> and one more for older version used in scarthgap
>
> main.c: In function ‘ProcessArgs’:
> main.c:163:42: error: too many arguments to function ‘p->process’; expected 0, have 2
>   163 |                                         (*p->process)( *argv, *(argv+1) );
>       |                                         ~^~~~~~~~~~~~  ~~~~~
> main.c:120:34: note: declared here
>   120 |                         WildFunc process;
>       |                                  ^~~~~~~
> main.c:168:42: error: too many arguments to function ‘p->process’; expected 0, have 1
>   168 |                                         (*p->process)( *argv );
>       |                                         ~^~~~~~~~~~~~  ~~~~~
> main.c:120:34: note: declared here
>   120 |                         WildFunc process;
>       |                                  ^~~~~~~
>
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> [YC: upstream commit a1db482ecd2824a4ae67a3c2a8e607b607ab4a43]
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>

This patch contains weird line endings and might fail to apply when
using mails.

You will find it on my branch here:
ovmf: backport a fix for build with gcc-16 - openembedded-core-contrib - OpenEmbedded Core user contribution trees
https://git.openembedded.org/openembedded-core-contrib/commit/?h=stable/scarthgap-nut&id=7de54889b3547a94bc7c6015731ec1c099e4d629

Regards,

> ---
>  ...Tools-StringFuncs-fix-gcc-16-warning.patch | 42 ++++++++++++++++++
>  ...aseTools-EfiRom-fix-compiler-warning.patch | 44 +++++++++++++++++++
>  .../0008-BaseTools-Pccts-set-C-standard.patch | 44 +++++++++++++++++++
>  meta/recipes-core/ovmf/ovmf_git.bb            |  3 ++
>  4 files changed, 133 insertions(+)
>  create mode 100644 meta/recipes-core/ovmf/ovmf/0006-BaseTools-StringFuncs-fix-gcc-16-warning.patch
>  create mode 100644 meta/recipes-core/ovmf/ovmf/0007-BaseTools-EfiRom-fix-compiler-warning.patch
>  create mode 100644 meta/recipes-core/ovmf/ovmf/0008-BaseTools-Pccts-set-C-standard.patch
>
> diff --git a/meta/recipes-core/ovmf/ovmf/0006-BaseTools-StringFuncs-fix-gcc-16-warning.patch b/meta/recipes-core/ovmf/ovmf/0006-BaseTools-StringFuncs-fix-gcc-16-warning.patch
> new file mode 100644
> index 00000000000..a465dede9c3
> --- /dev/null
> +++ b/meta/recipes-core/ovmf/ovmf/0006-BaseTools-StringFuncs-fix-gcc-16-warning.patch
> @@ -0,0 +1,42 @@
> +From 015c26aea52a54e96319887ea542870b4804fb91 Mon Sep 17 00:00:00 2001
> +From: Gerd Hoffmann <kraxel@redhat.com>
> +Date: Thu, 29 Jan 2026 09:23:32 +0100
> +Subject: [PATCH] BaseTools/StringFuncs: fix gcc 16 warning
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +StringFuncs.c: In function ‘SplitStringByWhitespace’:
> +StringFuncs.c:113:15: error: variable ‘Item’ set but not used [-Werror=unused-but-set-variable=]
> +  113 |   UINTN       Item;
> +      |               ^~~~
> +
> +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> +
> +Upstream-Status: Backport [edk2-stable202602 https://github.com/tianocore/edk2/commit/3597306191297b504683b83fe7750e49c6a2e836]
> +Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> +---
> + BaseTools/Source/C/Common/StringFuncs.c | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/BaseTools/Source/C/Common/StringFuncs.c b/BaseTools/Source/C/Common/StringFuncs.c
> +index 53e44365e9..df02d9c808 100644
> +--- a/BaseTools/Source/C/Common/StringFuncs.c
> ++++ b/BaseTools/Source/C/Common/StringFuncs.c
> +@@ -110,7 +110,6 @@ SplitStringByWhitespace (
> +   CHAR8       *EndOfSubString;
> +   CHAR8       *EndOfString;
> +   STRING_LIST *Output;
> +-  UINTN       Item;
> + 
> +   String = CloneString (String);
> +   if (String == NULL) {
> +@@ -120,7 +119,7 @@ SplitStringByWhitespace (
> + 
> +   Output = NewStringList ();
> + 
> +-  for (Pos = String, Item = 0; Pos < EndOfString; Item++) {
> ++  for (Pos = String; Pos < EndOfString;) {
> +     while (isspace ((int)*Pos)) {
> +       Pos++;
> +     }
> diff --git a/meta/recipes-core/ovmf/ovmf/0007-BaseTools-EfiRom-fix-compiler-warning.patch b/meta/recipes-core/ovmf/ovmf/0007-BaseTools-EfiRom-fix-compiler-warning.patch
> new file mode 100644
> index 00000000000..7aaafe6efbf
> --- /dev/null
> +++ b/meta/recipes-core/ovmf/ovmf/0007-BaseTools-EfiRom-fix-compiler-warning.patch
> @@ -0,0 +1,44 @@
> +From 4d2bdadcd6d45f6708b1b4827b0dc9b6e4b8edd2 Mon Sep 17 00:00:00 2001
> +From: Gerd Hoffmann <kraxel@redhat.com>
> +Date: Mon, 8 Dec 2025 10:28:50 +0100
> +Subject: [PATCH] BaseTools/EfiRom: fix compiler warning
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +New warning after updating gcc:
> +
> +EfiRom.c: In function ‘main’:
> +EfiRom.c:78:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
> +
> +The assigned value is not used, so fix the warning by just removing it.
> +
> +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> +
> +Upstream-Status: Backport [edk2-stable202602 https://github.com/tianocore/edk2/commit/9af06ef3cbb052b142f9660c2c01e7aeb401300c]
> +Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> +---
> + BaseTools/Source/C/EfiRom/EfiRom.c | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
> +index fa7bf0e62e..6e903b3504 100644
> +--- a/BaseTools/Source/C/EfiRom/EfiRom.c
> ++++ b/BaseTools/Source/C/EfiRom/EfiRom.c
> +@@ -44,7 +44,6 @@ Returns:
> +   FILE_LIST *FList;
> +   UINT32    TotalSize;
> +   UINT32    Size;
> +-  CHAR8     *Ptr0;
> + 
> +   SetUtilityName(UTILITY_NAME);
> + 
> +@@ -75,7 +74,7 @@ Returns:
> +   //
> +   if (mOptions.DumpOption == 1) {
> +     if (mOptions.FileList != NULL) {
> +-      if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
> ++      if (strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION) != NULL) {
> +         DumpImage (mOptions.FileList);
> +         goto BailOut;
> +       } else {
> diff --git a/meta/recipes-core/ovmf/ovmf/0008-BaseTools-Pccts-set-C-standard.patch b/meta/recipes-core/ovmf/ovmf/0008-BaseTools-Pccts-set-C-standard.patch
> new file mode 100644
> index 00000000000..de4ccb8a47d
> --- /dev/null
> +++ b/meta/recipes-core/ovmf/ovmf/0008-BaseTools-Pccts-set-C-standard.patch
> @@ -0,0 +1,44 @@
> +From 74bc6545e72707a47dd9dae42ce33b8877b10000 Mon Sep 17 00:00:00 2001
> +From: Gerd Hoffmann <kraxel@redhat.com>
> +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 <kraxel@redhat.com>
> +
> +Upstream-Status: Backport [edk2-stable202502 https://github.com/tianocore/edk2/commit/e063f8b8a53861043b9872cc35b08a3dc03b0942]
> +Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> +---
> + 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
> diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
> index 319f03a8d2a..badde30d97e 100644
> --- a/meta/recipes-core/ovmf/ovmf_git.bb
> +++ b/meta/recipes-core/ovmf/ovmf_git.bb
> @@ -26,6 +26,9 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
>             file://0004-reproducible.patch \
>             file://0001-MdePkg-Fix-overflow-issue-in-BasePeCoffLib.patch \
>             file://0001-MdeModulePkg-Potential-UINT32-overflow-in-S3-ResumeC.patch \
> +           file://0006-BaseTools-StringFuncs-fix-gcc-16-warning.patch \
> +           file://0007-BaseTools-EfiRom-fix-compiler-warning.patch \
> +           file://0008-BaseTools-Pccts-set-C-standard.patch \
>             "
>  
>  PV = "edk2-stable202402"


-- 
Yoann Congal
Smile ECS



  reply	other threads:[~2026-04-24 21:15 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 20:54 [OE-core][scarthgap 00/66] Patch review Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 01/66] spdx30_tasks: fix condition in create_spdx Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 02/66] tzdata/tzcode-native: upgrade 2025c -> 2026a Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 03/66] libarchive: Fix CVE-2026-4111 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 04/66] curl: patch CVE-2026-1965 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 05/66] curl: patch CVE-2026-3783 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 06/66] curl: patch CVE-2026-3784 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 07/66] ncurses: fix for CVE-2025-69720 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 08/66] tcl: skip http11 tests Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 09/66] busybox: fix for CVE-2026-26157, CVE-2026-26158 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 10/66] binutils: mark CVE-2025-69650 and CVE-2025-69651 as disputed Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 11/66] vim: Fix CVE-2026-25749 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 12/66] vim: Fix CVE-2026-26269 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 13/66] vim: Fix CVE-2026-33412 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 14/66] sqlite3: Fix CVE-2025-70873 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 15/66] unfs3: Fix race issue causing a glibc test hang Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 16/66] nghttp2: Fix CVE-2026-27135 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 17/66] linux/generate-cve-exclusions: backport script from master branch Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 18/66] python3: upgrade 3.12.12 -> 3.12.13 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 19/66] vim: Fix CVE-2026-28418 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 20/66] vim: Fix CVE-2026-28419 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 21/66] openssl: upgrade 3.5.5 -> 3.5.6 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 22/66] gi-docgen: fix CVE-2025-11687 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 23/66] python3-pyasn1: fix CVE-2026-23490 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 24/66] python3-wheel: fix CVE-2026-24049 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 25/66] gnupg: fix CVE-2026-24882 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 26/66] libxml2: Fix CVE-2026-1757 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 27/66] base-passwd: upgrade 3.6.3 -> 3.6.8 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 28/66] mesa: fix build on host with glibc-2.43 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 29/66] virglrenderer: Fix build with glibc 2.43+ Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 30/66] cmake: backport a fix for gcc-16 on host Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 31/66] gcc: backport a fix for building with gcc-16 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 32/66] libxcrypt: avoid discarded-qualifiers build failure with glibc 2.43 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 33/66] libxcrypt: Fix build wrt C23 support Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 34/66] libxcrypt: Use configure knob to disable warnings as errors Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 35/66] spirv-tools: backport a fix for building with gcc-16 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 36/66] ca-certificates: upgrade 20250419 -> 20260223 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 37/66] ovmf: backport a fix for build with gcc-16 Yoann Congal
2026-04-24 21:15   ` Yoann Congal [this message]
2026-04-24 20:55 ` [OE-core][scarthgap 38/66] ltp: fix epoll_ctl04 failed Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 39/66] kernel-devsrc: make tools/Build optional Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 40/66] dbus: use ${PN} in pkg_postinst instead of 'dbus' Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 41/66] linux-yocto/6.6: update CVE exclusions (6.6.123) Yoann Congal
2026-04-24 21:12   ` Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 42/66] build-appliance-image: switch SRC_URI to https protocol Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 43/66] scripts: Default to https git protocol for YP/OE repos Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 44/66] oeqa/selftest/git-submodule-test: " Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 45/66] meta/files/layers.example.json: switch to https clone URIs Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 46/66] oeqa/sdk: Default to https git protocol for YP/OE repos Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 47/66] selftest/scripts: Update old git protocol references Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 48/66] dtc: backport fix for build with glibc-2.43 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 49/66] pseudo: Add fix for glibc 2.43 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 50/66] yocto-uninative: Update to 5.0 for needed patchelf updates Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 51/66] yocto-uninative: Update to 5.1 for glibc 2.43 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 52/66] elfutils: don't add -Werror to avoid discarded-qualifiers Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 53/66] binutils: backport patch to fix build with glibc-2.43 on host Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 54/66] texinfo: Backport patches for hosts with newer GCC Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 55/66] qemu: backport patches to support python 3.14 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 56/66] db: Pin to use C99 std Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 57/66] apt: Fix build with GCC 15 Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 58/66] lib/oeqa/utils/httpserver: use multiprocessing from bb Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 59/66] archiver: Don't try to preserve all attributes when copying files Yoann Congal
2026-04-24 20:55 ` [OE-core][scarthgap 60/66] selftest/minidebuginfo: extract files from tar archive using tarfile module Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 61/66] selftest/gdbserver: replace shutil.unpack_archive with tarfile extract Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 62/66] license.py: Drop visit_Str from SeenVisitor in selftest Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 63/66] sudo: upgrade 1.9.17p1 -> 1.9.17p2 Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 64/66] lttng-ust: upgrade 2.13.8 -> 2.13.10 Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 65/66] libatomic-ops: upgrade 7.8.2 -> 7.8.4 Yoann Congal
2026-04-24 20:56 ` [OE-core][scarthgap 66/66] liburcu: upgrade 0.14.0 -> 0.14.2 Yoann Congal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DI1P39S0V3L3.3HVBRCKGI9CPF@smile.fr \
    --to=yoann.congal@smile.fr \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox