diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-07-30 14:38:28 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-01 09:51:20 +0100 |
| commit | 1a93346e4f77b539ebe658f7958ccdc1519a17e7 (patch) | |
| tree | 79bbcdc9ef6fe1027b92ff4c109646d825b18e26 | |
| parent | d0e4e116d30b7ec54798d81fe305767ae48d5a9c (diff) | |
| download | poky-1a93346e4f77b539ebe658f7958ccdc1519a17e7.tar.gz | |
gnu-efi: Fix build break on riscv64
(From OE-Core rev: 41b54ac83c756897f444b8fe651953e4feaa4571)
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>
3 files changed, 68 insertions, 0 deletions
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 index 0000000000..3475606264 --- /dev/null +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-adjust-type-definitions.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 1de509497826faa0ad84b82f5e2c3d21ee613459 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Moody Liu <mooodyhunter@outlook.com> | ||
| 3 | Date: Sat, 13 May 2023 17:39:16 +0100 | ||
| 4 | Subject: [PATCH] riscv64: adjust type definitions | ||
| 5 | |||
| 6 | CHAR8 needs to be defined while BOOLEAN should be removed | ||
| 7 | here to prevent typedef conflicts | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/1de509497826faa0ad84b82f5e2c3d21ee613459/] | ||
| 10 | Signed-off-by: Moody Liu <mooodyhunter@outlook.com> | ||
| 11 | --- | ||
| 12 | inc/riscv64/efibind.h | 4 +--- | ||
| 13 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/inc/riscv64/efibind.h b/inc/riscv64/efibind.h | ||
| 16 | index 4fdf81d..d8b4f39 100644 | ||
| 17 | --- a/inc/riscv64/efibind.h | ||
| 18 | +++ b/inc/riscv64/efibind.h | ||
| 19 | @@ -32,11 +32,9 @@ typedef uint16_t UINT16; | ||
| 20 | typedef int16_t INT16; | ||
| 21 | typedef uint8_t UINT8; | ||
| 22 | typedef int8_t INT8; | ||
| 23 | +typedef char CHAR8; | ||
| 24 | typedef wchar_t CHAR16; | ||
| 25 | #define WCHAR CHAR16 | ||
| 26 | -#ifndef BOOLEAN | ||
| 27 | -typedef uint8_t BOOLEAN; | ||
| 28 | -#endif | ||
| 29 | #undef VOID | ||
| 30 | typedef void VOID; | ||
| 31 | typedef int64_t INTN; | ||
| 32 | -- | ||
| 33 | 2.41.0 | ||
| 34 | |||
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 index 0000000000..5b3c152c5e --- /dev/null +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/0001-riscv64-ignore-unknown-relocs.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 708f66acfec9a86f237726d45095cbd380fd83ca Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Callum Farmer <gmbr3@opensuse.org> | ||
| 3 | Date: Wed, 21 Jun 2023 11:32:28 +0100 | ||
| 4 | Subject: [PATCH] riscv64: ignore unknown relocs | ||
| 5 | |||
| 6 | Sometimes ld emits relocs such as R_RISCV_64 for unwind symbols | ||
| 7 | these don't need to be handled yet so just can be skipped otherwise | ||
| 8 | the binary will never load | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://sourceforge.net/p/gnu-efi/code/ci/708f66acfec9a86f237726d45095cbd380fd83ca/] | ||
| 11 | Signed-off-by: Callum Farmer <gmbr3@opensuse.org> | ||
| 12 | --- | ||
| 13 | gnuefi/reloc_riscv64.c | 3 +-- | ||
| 14 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/gnuefi/reloc_riscv64.c b/gnuefi/reloc_riscv64.c | ||
| 17 | index 0b02d83..e429602 100644 | ||
| 18 | --- a/gnuefi/reloc_riscv64.c | ||
| 19 | +++ b/gnuefi/reloc_riscv64.c | ||
| 20 | @@ -81,8 +81,7 @@ EFI_STATUS EFIAPI _relocate(long ldbase, Elf_Dyn *dyn) | ||
| 21 | *addr = ldbase + rel->r_addend; | ||
| 22 | break; | ||
| 23 | default: | ||
| 24 | - /* Panic */ | ||
| 25 | - while (1) ; | ||
| 26 | + break; | ||
| 27 | } | ||
| 28 | rel = (Elf_Rela *)((char *)rel + relent); | ||
| 29 | relsz -= relent; | ||
| 30 | -- | ||
| 31 | 2.41.0 | ||
| 32 | |||
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb index 547c469d19..d37d638e09 100644 --- a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb +++ b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb | |||
| @@ -15,6 +15,8 @@ LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582 | |||
| 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ | 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ |
| 16 | file://parallel-make-archives.patch \ | 16 | file://parallel-make-archives.patch \ |
| 17 | file://gnu-efi-3.0.9-fix-clang-build.patch \ | 17 | file://gnu-efi-3.0.9-fix-clang-build.patch \ |
| 18 | file://0001-riscv64-adjust-type-definitions.patch \ | ||
| 19 | file://0001-riscv64-ignore-unknown-relocs.patch \ | ||
| 18 | " | 20 | " |
| 19 | 21 | ||
| 20 | SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4" | 22 | SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4" |
