From 0d7cfd5cba173d944fd542ff737407df9a37bcf8 Mon Sep 17 00:00:00 2001 From: Jason Montleon Date: Thu, 1 Aug 2024 20:46:36 -0400 Subject: [PATCH] disable patches breaking riscv64 add mcmodel patch for riscv64 Signed-off-by: Jason Montleon --- ...any-instead-of-large-model-for-RISCV.patch | 36 +++++++++++++++++++ grub.patches | 5 ++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0263-Use-medany-instead-of-large-model-for-RISCV.patch diff --git a/0263-Use-medany-instead-of-large-model-for-RISCV.patch b/0263-Use-medany-instead-of-large-model-for-RISCV.patch new file mode 100644 index 0000000..4bfd468 --- /dev/null +++ b/0263-Use-medany-instead-of-large-model-for-RISCV.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +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 diff --git a/grub.patches b/grub.patches index bd7e596..9689905 100644 --- a/grub.patches +++ b/grub.patches @@ -252,11 +252,14 @@ Patch0251: 0251-grub-set-bootflag-Conservative-partial-fix-for-CVE-2.patch Patch0252: 0252-grub-set-bootflag-More-complete-fix-for-CVE-2024-104.patch Patch0253: 0253-grub-set-bootflag-Exit-calmly-when-not-running-as-ro.patch Patch0254: 0254-Makefile.core.def-fix-linux-module.patch +%ifnarch riscv64 Patch0255: 0255-Add-support-for-Linux-EFI-stub-loading-on-arm-archit.patch Patch0256: 0256-arm-arm64-loader-Better-memory-allocation-and-error-.patch Patch0257: 0257-arm64-Fix-EFI-loader-kernel-image-allocation.patch -Patch0258: 0258-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch Patch0259: 0259-Correct-BSS-zeroing-on-aarch64.patch Patch0260: 0260-arm64-Use-proper-memory-type-for-kernel-allocation.patch +%endif +Patch0258: 0258-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch Patch0261: 0261-normal-Remove-grub_env_set-prefix-in-grub_try_normal.patch Patch0262: 0262-fs-xfs-Handle-non-continuous-data-blocks-in-director.patch +Patch0263: 0263-Use-medany-instead-of-large-model-for-RISCV.patch