# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/grub2/hotfix-riscv64-codemodel.patch # Copyright (C) 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- From: Jason Montleon Date: Fri, 3 May 2024 13:18:37 -0400 Subject: [PATCH] Use medany instead of large model for RISCV Signed-off-by: Jason Montleon --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d223fe3ef6e..6a6688e362a 100644 --- a/configure.ac +++ b/configure.ac @@ -1313,7 +1313,7 @@ AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) LDFLAGS="$TARGET_LDFLAGS" -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" @@ -1323,9 +1323,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 if test "$target_cpu"-"$platform" = x86_64-efi; then