summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-02-17 15:10:32 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-20 16:45:25 +0000
commitd05e919d5ae8bf061d5a2645b913991999664106 (patch)
tree925c07075bf7bb959d991427d36623d9eec132a2 /meta/recipes-bsp/grub
parent995b971744404c0f1561347ea729923b3bda55f1 (diff)
downloadpoky-d05e919d5ae8bf061d5a2645b913991999664106.tar.gz
grub: Fix build with bintutils 2.38 on riscv
(From OE-Core rev: d42596457628f41baa5729545e2932c6692f73ee) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r--meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch47
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch
new file mode 100644
index 0000000000..c575a31161
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch
@@ -0,0 +1,47 @@
1From f1217c803cec90813eb834dde7829f4961b2a2e4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 17 Feb 2022 15:07:02 -0800
4Subject: [PATCH] configure.ac: Use _zicsr_zifencei extentions on riscv
5
6From version 2.38, binutils defaults to ISA spec version 20191213. This
7means that the csr read/write (csrr*/csrw*) instructions and fence.i
8instruction has separated from the `I` extension, become two standalone
9extensions: Zicsr and Zifencei.
10
11The fix is to specify those extensions explicitely in -march. Since we
12are now using binutils 2.38+ in OE this is ok, a more upstreamable fix for
13grub will be to detect these extentions, however thats not easy to
14implement
15
16Upstream-Status: Inappropriate [OE specific]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 configure.ac | 8 ++++----
20 1 file changed, 4 insertions(+), 4 deletions(-)
21
22diff --git a/configure.ac b/configure.ac
23index c7fc55a..072f2c9 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -849,14 +849,14 @@ if test x"$platform" != xemu ; then
27 [grub_cv_target_cc_soft_float="-mgeneral-regs-only"], [])
28 fi
29 if test "x$target_cpu" = xriscv32; then
30- CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror"
31+ CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror"
32 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
33- [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], [])
34+ [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], [])
35 fi
36 if test "x$target_cpu" = xriscv64; then
37- CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror"
38+ CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror"
39 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
40- [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], [])
41+ [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], [])
42 fi
43 if test "x$target_cpu" = xia64; then
44 CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror"
45--
462.35.1
47
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index ff7a84935b..193a92cb94 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
21 file://determinism.patch \ 21 file://determinism.patch \
22 file://0001-RISC-V-Restore-the-typcast-to-long.patch \ 22 file://0001-RISC-V-Restore-the-typcast-to-long.patch \
23 file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \ 23 file://CVE-2021-3981-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch \
24 file://0001-configure.ac-Use-_zicsr_zifencei-extentions-on-riscv.patch \
24" 25"
25 26
26SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" 27SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"