diff --git a/1011-loongarch-Disable-vector-instructions.patch b/1011-loongarch-Disable-vector-instructions.patch new file mode 100644 index 0000000000000000000000000000000000000000..91630d93adcb0a4ba8bc226b8fa1bff4cc9f7f8f --- /dev/null +++ b/1011-loongarch-Disable-vector-instructions.patch @@ -0,0 +1,26 @@ +From f9b4c5a1f6de72482009594937d59f2858b971de Mon Sep 17 00:00:00 2001 +From: Xue Liu +Date: Fri, 17 Jan 2025 12:27:03 +0800 +Subject: [PATCH] loongarch: Disable vector instructions + +Pass the "-mno-lsx" CFLAGS to avoid generating vector instructions +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index fe9ebae..2a6423c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -953,7 +953,7 @@ if test "x$target_cpu" = xloongarch64; then + TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_mno_relax" + fi + +- TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mla-global-with-abs" ++ TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mla-global-with-abs -mno-lsx" + TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mla-global-with-abs" + fi + +-- +2.41.0 + diff --git a/grub.patches b/grub.patches index c50ea166af9213d7bea331d8b5a53bdefc2cea09..7c190ae14811f2730127d4be72274ef01ea45e9e 100644 --- a/grub.patches +++ b/grub.patches @@ -208,3 +208,4 @@ Patch1004: 1004-Revert-Add-support-for-Linux-EFI-stub-loading.patch Patch1008: 1008-loongarch-add-back-compatibility-for-linux-kernel.patch Patch1009: 1009-configure-Add-GRUB_CPU_LOONGARCH64-support.patch Patch1010: 1010-Clear-buffer-to-zero-for-screen-information.patch +Patch1011: 1011-loongarch-Disable-vector-instructions.patch diff --git a/grub2.spec b/grub2.spec index 35288e92cd838c591eb765f84096a5782ef7e7e0..1cba4bed35558989fed9df5ecf221c1606c8fbe2 100644 --- a/grub2.spec +++ b/grub2.spec @@ -1,4 +1,4 @@ -%define anolis_release 10 +%define anolis_release 11 %global _lto_cflags %{nil} %undefine _hardened_build @@ -506,6 +506,9 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Fri Jan 17 2025 Xue Liu - 2.12-11_2 +- Disable vector instructions for loongarch + * Tue Jan 14 2025 Xue Liu - 2.12-10_2 - Fix the introduced old code - Clear buffer for screen information