* [PATCH] ovmf: Don't define bool type if building in C23 mode
@ 2025-08-01 10:29 mingli.yu
2025-08-04 8:26 ` [OE-core] " Mathieu Dubois-Briand
2025-08-07 10:01 ` Alexander Kanavin
0 siblings, 2 replies; 5+ messages in thread
From: mingli.yu @ 2025-08-01 10:29 UTC (permalink / raw)
To: openembedded-core
From: Mingli Yu <mingli.yu@windriver.com>
Backport a patch [1] to fix the below build failure:
/buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:17: error: two or more data types in declaration specifiers
13 | typedef BOOLEAN bool;
| ^~~~
/buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:1: error: useless type name in empty declaration [-Werror]
13 | typedef BOOLEAN bool;
[1] https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
...t-define-bool-type-if-building-in-C2.patch | 35 +++++++++++++++++++
meta/recipes-core/ovmf/ovmf_git.bb | 1 +
2 files changed, 36 insertions(+)
create mode 100644 meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
diff --git a/meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch b/meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
new file mode 100644
index 00000000000..a555070ca59
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
@@ -0,0 +1,35 @@
+From 772fa11ac82579a8f6fa171e6b835f68af3f64be Mon Sep 17 00:00:00 2001
+From: Rebecca Cran <rebecca@bsdio.com>
+Date: Mon, 26 May 2025 08:01:39 -0600
+Subject: [PATCH] SecurityPkg: Don't define bool type if building in C23 mode
+
+In C23 bool is a built-in type, so it's not necessary to typedef
+bool in LibspdmStdBoolAlt.h.
+
+Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
+
+Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ .../DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h b/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
+index 08af7296d0..395ef22d43 100644
+--- a/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
++++ b/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
+@@ -10,7 +10,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
+ #ifndef LIBSPDM_STDBOOL_ALT_H
+ #define LIBSPDM_STDBOOL_ALT_H
+
++// In C23, bool is a built-in type
++#if __STDC_VERSION__ < 202311L
+ typedef BOOLEAN bool;
++#endif
+
+ #ifndef true
+ #define true TRUE
+--
+2.34.1
+
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 08879966c34..a8efcc2a462 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -30,6 +30,7 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
file://CVE-2024-38797-2.patch \
file://CVE-2024-38797-3.patch \
file://CVE-2024-38797-4.patch \
+ file://0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch \
"
PV = "edk2-stable202502"
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [OE-core] [PATCH] ovmf: Don't define bool type if building in C23 mode
2025-08-01 10:29 [PATCH] ovmf: Don't define bool type if building in C23 mode mingli.yu
@ 2025-08-04 8:26 ` Mathieu Dubois-Briand
2025-08-04 9:14 ` Mikko Rapeli
2025-08-07 10:01 ` Alexander Kanavin
1 sibling, 1 reply; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2025-08-04 8:26 UTC (permalink / raw)
To: mingli.yu, openembedded-core
On Fri Aug 1, 2025 at 12:29 PM CEST, Mingli via lists.openembedded.org Yu wrote:
> From: Mingli Yu <mingli.yu@windriver.com>
>
> Backport a patch [1] to fix the below build failure:
> /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:17: error: two or more data types in declaration specifiers
> 13 | typedef BOOLEAN bool;
> | ^~~~
> /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:1: error: useless type name in empty declaration [-Werror]
> 13 | typedef BOOLEAN bool;
>
> [1] https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
Hi,
Thanks for the patch, but it looks like the embedded patch does not
apply cleanly:
ERROR: ovmf-native-edk2-stable202502-r0 do_patch: Applying patch '0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch' on target directory '/srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/sources/ovmf-edk2-stable202502'
CmdError('quilt --quiltrc /srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: Applying patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
patching file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
Hunk #1 FAILED at 10 (different line endings).
1 out of 1 hunk FAILED -- rejects in file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
Patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch does not apply (enforce with -f)
https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1998
Can you have a look at this issue please?
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [OE-core] [PATCH] ovmf: Don't define bool type if building in C23 mode
2025-08-04 8:26 ` [OE-core] " Mathieu Dubois-Briand
@ 2025-08-04 9:14 ` Mikko Rapeli
2025-08-04 11:16 ` Mathieu Dubois-Briand
0 siblings, 1 reply; 5+ messages in thread
From: Mikko Rapeli @ 2025-08-04 9:14 UTC (permalink / raw)
To: mathieu.dubois-briand; +Cc: mingli.yu, openembedded-core
Hi,
On Mon, Aug 04, 2025 at 10:26:23AM +0200, Mathieu Dubois-Briand via lists.openembedded.org wrote:
> On Fri Aug 1, 2025 at 12:29 PM CEST, Mingli via lists.openembedded.org Yu wrote:
> > From: Mingli Yu <mingli.yu@windriver.com>
> >
> > Backport a patch [1] to fix the below build failure:
> > /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:17: error: two or more data types in declaration specifiers
> > 13 | typedef BOOLEAN bool;
> > | ^~~~
> > /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:1: error: useless type name in empty declaration [-Werror]
> > 13 | typedef BOOLEAN bool;
> >
> > [1] https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be
> >
> > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > ---
>
> Hi,
>
> Thanks for the patch, but it looks like the embedded patch does not
> apply cleanly:
>
> ERROR: ovmf-native-edk2-stable202502-r0 do_patch: Applying patch '0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch' on target directory '/srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/sources/ovmf-edk2-stable202502'
> CmdError('quilt --quiltrc /srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: Applying patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
> patching file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
> Hunk #1 FAILED at 10 (different line endings).
> 1 out of 1 hunk FAILED -- rejects in file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
> Patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch does not apply (enforce with -f)
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1998
>
> Can you have a look at this issue please?
ovmf and edk2 are notorious for using Windows newlines so patches over
mailing lists may break when applying. I suggest using git to pull the
changes or manually applying simple changes.
Cheers,
-Mikko
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [OE-core] [PATCH] ovmf: Don't define bool type if building in C23 mode
2025-08-04 9:14 ` Mikko Rapeli
@ 2025-08-04 11:16 ` Mathieu Dubois-Briand
0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2025-08-04 11:16 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: mingli.yu, openembedded-core
On Mon Aug 4, 2025 at 11:14 AM CEST, Mikko Rapeli wrote:
> Hi,
>
> On Mon, Aug 04, 2025 at 10:26:23AM +0200, Mathieu Dubois-Briand via lists.openembedded.org wrote:
>> On Fri Aug 1, 2025 at 12:29 PM CEST, Mingli via lists.openembedded.org Yu wrote:
>> > From: Mingli Yu <mingli.yu@windriver.com>
>> >
>> > Backport a patch [1] to fix the below build failure:
>> > /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:17: error: two or more data types in declaration specifiers
>> > 13 | typedef BOOLEAN bool;
>> > | ^~~~
>> > /buildarea/tmp/work/corei7-64-wrs-linux/ovmf/edk2-stable202502/sources/ovmf-edk2-stable202502/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h:13:1: error: useless type name in empty declaration [-Werror]
>> > 13 | typedef BOOLEAN bool;
>> >
>> > [1] https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be
>> >
>> > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> > ---
>>
>> Hi,
>>
>> Thanks for the patch, but it looks like the embedded patch does not
>> apply cleanly:
>>
>> ERROR: ovmf-native-edk2-stable202502-r0 do_patch: Applying patch '0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch' on target directory '/srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/sources/ovmf-edk2-stable202502'
>> CmdError('quilt --quiltrc /srv/pokybuild/yocto-worker/qemux86-world-alt/build/build/tmp/work/x86_64-linux/ovmf-native/edk2-stable202502/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: Applying patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch
>> patching file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
>> Hunk #1 FAILED at 10 (different line endings).
>> 1 out of 1 hunk FAILED -- rejects in file SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h
>> Patch 0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch does not apply (enforce with -f)
>>
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/17/builds/1998
>>
>> Can you have a look at this issue please?
>
> ovmf and edk2 are notorious for using Windows newlines so patches over
> mailing lists may break when applying. I suggest using git to pull the
> changes or manually applying simple changes.
>
> Cheers,
>
> -Mikko
Makes sense. I believe I managed to fix the new line issues, so the
patch is back in testing queue.
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OE-core] [PATCH] ovmf: Don't define bool type if building in C23 mode
2025-08-01 10:29 [PATCH] ovmf: Don't define bool type if building in C23 mode mingli.yu
2025-08-04 8:26 ` [OE-core] " Mathieu Dubois-Briand
@ 2025-08-07 10:01 ` Alexander Kanavin
1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2025-08-07 10:01 UTC (permalink / raw)
To: mingli.yu; +Cc: openembedded-core
On Fri, 1 Aug 2025 at 12:29, Yu, Mingli via lists.openembedded.org
<mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
> +Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be]
> + file://0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch \
> PV = "edk2-stable202502"
There's already a newer 202505 version (and 202508 will come out
soon). Can you work on the version update please? Yocto master can
take backports up to a point, but not for much longer.
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-07 10:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 10:29 [PATCH] ovmf: Don't define bool type if building in C23 mode mingli.yu
2025-08-04 8:26 ` [OE-core] " Mathieu Dubois-Briand
2025-08-04 9:14 ` Mikko Rapeli
2025-08-04 11:16 ` Mathieu Dubois-Briand
2025-08-07 10:01 ` Alexander Kanavin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.