From: Jason Montleon <[email protected]>

Upstream-Status: Submitted [https://savannah.gnu.org/bugs/?65909]

Signed-off-by: Jason Montleon <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
---
We have recently added this to the openembedded-core layer to help with RISC-V
builds on certain platforms (e.g. the VisionFive 2). I have left the patch as it
is there, including the link to the original bug submission and the author's
attribution. Jason, if you would like to change the attribution or anything
about the patch, let me know and I can re-submit.

 configure.ac | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d19fb625d..2a070c577 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1675,7 +1675,7 @@ fi]
 
 CFLAGS="$TARGET_CFLAGS"
 
-if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 || test 
"$target_cpu" = riscv64 ; then
+if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 ; then
   # Use large model to support 4G memory
   AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
     CFLAGS="$TARGET_CFLAGS -mcmodel=large"
@@ -1685,9 +1685,11 @@ if test "$target_cpu" = x86_64 || test "$target_cpu" = 
sparc64 || test "$target_
   ])
   if test "x$grub_cv_cc_mcmodel" = xyes; then
     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
-  elif test "$target_cpu" = sparc64 || test "$target_cpu" = riscv64; then
+  elif test "$target_cpu" = sparc64; then
     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany"
   fi
+elif test "$target_cpu" = riscv64 ; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany"
 fi
 
 # Stack smashing protector.
-- 
2.53.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to