diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2025-08-01 18:29:12 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-07 12:11:15 +0100 |
commit | dd43f638e9cf1e60064a1d268b4e9e43334ddb58 (patch) | |
tree | 1bbf18fc6ada58e8d82ed04a50949ea315924860 /meta/recipes-core | |
parent | cf32779ebd5dd4dc31107e32bba25e741f155ccb (diff) | |
download | poky-dd43f638e9cf1e60064a1d268b4e9e43334ddb58.tar.gz |
ovmf: Don't define bool type if building in C23 mode
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
(From OE-Core rev: 24600013b65c954bd704a6eb673197ac06b87f69)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch | 35 | ||||
-rw-r--r-- | meta/recipes-core/ovmf/ovmf_git.bb | 1 |
2 files changed, 36 insertions, 0 deletions
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 0000000000..a555070ca5 --- /dev/null +++ b/meta/recipes-core/ovmf/ovmf/0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 772fa11ac82579a8f6fa171e6b835f68af3f64be Mon Sep 17 00:00:00 2001 | ||
2 | From: Rebecca Cran <rebecca@bsdio.com> | ||
3 | Date: Mon, 26 May 2025 08:01:39 -0600 | ||
4 | Subject: [PATCH] SecurityPkg: Don't define bool type if building in C23 mode | ||
5 | |||
6 | In C23 bool is a built-in type, so it's not necessary to typedef | ||
7 | bool in LibspdmStdBoolAlt.h. | ||
8 | |||
9 | Signed-off-by: Rebecca Cran <rebecca@bsdio.com> | ||
10 | |||
11 | Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/772fa11ac82579a8f6fa171e6b835f68af3f64be] | ||
12 | |||
13 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
14 | --- | ||
15 | .../DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h | 3 +++ | ||
16 | 1 file changed, 3 insertions(+) | ||
17 | |||
18 | diff --git a/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h b/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h | ||
19 | index 08af7296d0..395ef22d43 100644 | ||
20 | --- a/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h | ||
21 | +++ b/SecurityPkg/DeviceSecurity/SpdmLib/Include/hal/LibspdmStdBoolAlt.h | ||
22 | @@ -10,7 +10,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent | ||
23 | #ifndef LIBSPDM_STDBOOL_ALT_H | ||
24 | #define LIBSPDM_STDBOOL_ALT_H | ||
25 | |||
26 | +// In C23, bool is a built-in type | ||
27 | +#if __STDC_VERSION__ < 202311L | ||
28 | typedef BOOLEAN bool; | ||
29 | +#endif | ||
30 | |||
31 | #ifndef true | ||
32 | #define true TRUE | ||
33 | -- | ||
34 | 2.34.1 | ||
35 | |||
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 08879966c3..a8efcc2a46 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 \ | |||
30 | file://CVE-2024-38797-2.patch \ | 30 | file://CVE-2024-38797-2.patch \ |
31 | file://CVE-2024-38797-3.patch \ | 31 | file://CVE-2024-38797-3.patch \ |
32 | file://CVE-2024-38797-4.patch \ | 32 | file://CVE-2024-38797-4.patch \ |
33 | file://0001-SecurityPkg-Don-t-define-bool-type-if-building-in-C2.patch \ | ||
33 | " | 34 | " |
34 | 35 | ||
35 | PV = "edk2-stable202502" | 36 | PV = "edk2-stable202502" |