edk2-firmware-tegra-36.4.0: Fix build with GCC15/C23

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2025-03-31 11:25:24 -07:00
committed by Matt Madison
parent 7400e5ef9b
commit cb3227f5ff
3 changed files with 84 additions and 0 deletions

View File

@@ -36,6 +36,8 @@ SRC_URI += "\
file://0002-L4TLauncher-allow-for-empty-missing-APPEND-line-in-e.patch;patchdir=../edk2-nvidia \ file://0002-L4TLauncher-allow-for-empty-missing-APPEND-line-in-e.patch;patchdir=../edk2-nvidia \
file://0003-XusbControllerDxe-use-BaseMemoryLib-functions.patch;patchdir=../edk2-nvidia \ file://0003-XusbControllerDxe-use-BaseMemoryLib-functions.patch;patchdir=../edk2-nvidia \
file://0004-MdePkg-Check-if-compiler-has-__has_builtin-before-tr.patch \ file://0004-MdePkg-Check-if-compiler-has-__has_builtin-before-tr.patch \
file://0005-BaseFdtLib-Define-bool-only-for-C17-or-lower.patch \
file://0006-XsubcontrollerDxe-Fix-build-with-gcc-15.patch;patchdir=../edk2-nvidia \
" "
S = "${WORKDIR}/edk2-tegra/edk2" S = "${WORKDIR}/edk2-tegra/edk2"

View File

@@ -0,0 +1,50 @@
From c0796335d3c6362b563844410499ff241d42ac63 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 20 Jan 2025 09:24:16 +0100
Subject: [PATCH] MdePkg/BaseFdtLib: fix build with gcc 15
gcc 15 switched to use the new ISO C23 standard by default.
'bool', 'true' and 'false' are keywords in C23, so do not
try to define them.
Upstream-Status: Backport [https://github.com/tianocore/edk2/pull/10647]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
MdePkg/Library/BaseFdtLib/LibFdtSupport.h | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
index 8a26fbfc3251..05f758a93dc9 100644
--- a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
+++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h
@@ -14,17 +14,21 @@
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
-typedef UINT8 uint8_t;
-typedef UINT16 uint16_t;
-typedef INT32 int32_t;
-typedef UINT32 uint32_t;
-typedef UINT64 uint64_t;
-typedef UINTN uintptr_t;
-typedef UINTN size_t;
-typedef BOOLEAN bool;
-
+typedef UINT8 uint8_t;
+typedef UINT16 uint16_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+typedef UINT64 uint64_t;
+typedef UINTN uintptr_t;
+typedef UINTN size_t;
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
+/* bool, true and false are keywords. */
+#else
+typedef BOOLEAN bool;
#define true (1 == 1)
#define false (1 == 0)
+#endif
//
// Definitions for global constants used by libfdt library routines

View File

@@ -0,0 +1,32 @@
From 4207e9d450a976baaa14835353d16116e3a15463 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 31 Mar 2025 11:14:14 -0700
Subject: [PATCH] XsubcontrollerDxe: Fix build with gcc-15
GCC-15 does not like the fact that the function signature does not match
when it is passed as a function pointer
Fixes
XusbControllerDxe.c:2403:19: error: passing argument 3 of 'gBS->CreateEvent' from incompatible pointer type [-Wincompatible-pointer-types]
XusbControllerDxe.c:2403:19: note: expected 'EFI_EVENT_NOTIFY' {aka 'void (*)(void *, void *)'} but argument is of type 'void (*)(UINT32)' {aka 'void (*)(unsigned int)'}
Upstream-Status: Submitted [https://github.com/NVIDIA/edk2-nvidia/pull/124]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Silicon/NVIDIA/Drivers/XusbControllerDxe/XusbControllerDxe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Silicon/NVIDIA/Drivers/XusbControllerDxe/XusbControllerDxe.c b/Silicon/NVIDIA/Drivers/XusbControllerDxe/XusbControllerDxe.c
index c6116f2f..0951f1a1 100644
--- a/Silicon/NVIDIA/Drivers/XusbControllerDxe/XusbControllerDxe.c
+++ b/Silicon/NVIDIA/Drivers/XusbControllerDxe/XusbControllerDxe.c
@@ -2280,6 +2280,8 @@ fail:
STATIC
VOID
XudcCheckInterrupts (
+ IN VOID *p,
+ IN VOID *q
)
{
XudcPollForEvent (0x10UL);