]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gnu-efi: Fix build break on riscv64
authorKhem Raj <raj.khem@gmail.com>
Sun, 30 Jul 2023 21:38:28 +0000 (14:38 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 1 Aug 2023 08:49:03 +0000 (09:49 +0100)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch [new file with mode: 0644]
meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch [new file with mode: 0644]
meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb

diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch
new file mode 100644 (file)
index 0000000..3475606
--- /dev/null
@@ -0,0 +1,34 @@
+From 1de509497826faa0ad84b82f5e2c3d21ee613459 Mon Sep 17 00:00:00 2001
+From: Moody Liu <mooodyhunter@outlook.com>
+Date: Sat, 13 May 2023 17:39:16 +0100
+Subject: [PATCH] riscv64: adjust type definitions
+
+CHAR8 needs to be defined while BOOLEAN should be removed
+here to prevent typedef conflicts
+
+Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/1de509497826faa0ad84b82f5e2c3d21ee613459/]
+Signed-off-by: Moody Liu <mooodyhunter@outlook.com>
+---
+ inc/riscv64/efibind.h | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/inc/riscv64/efibind.h b/inc/riscv64/efibind.h
+index 4fdf81d..d8b4f39 100644
+--- a/inc/riscv64/efibind.h
++++ b/inc/riscv64/efibind.h
+@@ -32,11 +32,9 @@ typedef uint16_t                UINT16;
+ typedef int16_t                 INT16;
+ typedef uint8_t                 UINT8;
+ typedef int8_t                  INT8;
++typedef char                    CHAR8;
+ typedef wchar_t                 CHAR16;
+ #define WCHAR                   CHAR16
+-#ifndef BOOLEAN
+-typedef uint8_t                 BOOLEAN;
+-#endif
+ #undef VOID
+ typedef void                    VOID;
+ typedef int64_t                 INTN;
+-- 
+2.41.0
+
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch
new file mode 100644 (file)
index 0000000..5b3c152
--- /dev/null
@@ -0,0 +1,32 @@
+From 708f66acfec9a86f237726d45095cbd380fd83ca Mon Sep 17 00:00:00 2001
+From: Callum Farmer <gmbr3@opensuse.org>
+Date: Wed, 21 Jun 2023 11:32:28 +0100
+Subject: [PATCH] riscv64: ignore unknown relocs
+
+Sometimes ld emits relocs such as R_RISCV_64 for unwind symbols
+these don't need to be handled yet so just can be skipped otherwise
+the binary will never load
+
+Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/708f66acfec9a86f237726d45095cbd380fd83ca/]
+Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
+---
+ gnuefi/reloc_riscv64.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gnuefi/reloc_riscv64.c b/gnuefi/reloc_riscv64.c
+index 0b02d83..e429602 100644
+--- a/gnuefi/reloc_riscv64.c
++++ b/gnuefi/reloc_riscv64.c
+@@ -81,8 +81,7 @@ EFI_STATUS EFIAPI _relocate(long ldbase, Elf_Dyn *dyn)
+                       *addr = ldbase + rel->r_addend;
+                       break;
+               default:
+-                      /* Panic */
+-                      while (1) ;
++                              break;
+               }
+               rel = (Elf_Rela *)((char *)rel + relent);
+               relsz -= relent;
+-- 
+2.41.0
+
index 547c469d19f1283c4db09b7b54e23b59e1edab69..d37d638e097550e90c60b6f26bcbc35916aebb34 100644 (file)
@@ -15,6 +15,8 @@ LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \
            file://parallel-make-archives.patch \
            file://gnu-efi-3.0.9-fix-clang-build.patch \
+           file://0001-riscv64-adjust-type-definitions.patch \
+           file://0001-riscv64-ignore-unknown-relocs.patch \
            "
 
 SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4"