From 2c4956c67ff50761d77524ec01a3d19c638495fd Mon Sep 17 00:00:00 2001 From: Xue Liu Date: Thu, 5 Jun 2025 10:58:21 +0800 Subject: [PATCH] loongarch: Pass option "-mno-lsx" to avoid generating vector --- ...oongarch-Disable-vector-instructions.patch | 26 +++++++++++++++++++ grub.macros | 2 +- grub.patches | 1 + grub2.spec | 5 +++- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 1014-loongarch-Disable-vector-instructions.patch diff --git a/1014-loongarch-Disable-vector-instructions.patch b/1014-loongarch-Disable-vector-instructions.patch new file mode 100644 index 0000000..91630d9 --- /dev/null +++ b/1014-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.macros b/grub.macros index 5ef8230..2d93fd0 100644 --- a/grub.macros +++ b/grub.macros @@ -342,7 +342,7 @@ git add . \ git commit -a -q -m "%{tarversion} baseline." \ git am --whitespace=nowarn %%{patches} - 2.12-13 +- Disable vector instructions for loongarch + * Fri May 30 2025 yechao-w - 2.12-12 - Use proper memory type for kernel allocation -- Gitee