aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch')
-rw-r--r--meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch b/meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch
new file mode 100644
index 00000000..69d62e64
--- /dev/null
+++ b/meta-amd-bsp/recipes-bsp/grub/files/0001-x86_64-amd-avoid-SSE-register-return-with-SSE-disabl.patch
@@ -0,0 +1,39 @@
+From d80b85dd61db9261b6cfd0d43a2f1c035627310b Mon Sep 17 00:00:00 2001
+From: "Arsalan H. Awan" <Arsalan_Awan@mentor.com>
+Date: Tue, 6 Apr 2021 15:01:41 +0500
+Subject: [PATCH] x86_64/amd: avoid SSE register return with SSE disabled
+
+When GRUB is compiled with -march=znver1 or -march=znver2 using the GCC
+v9.3 and above, the compilation fails with the following error:
+
+recipe-sysroot-native/usr/lib/x86_64-amd-linux/gcc/x86_64-amd-linux/
+ 10.2.0/include/shaintrin.h:40:1:
+ error: SSE register return with SSE disabled
+
+What's interesting, is that -march=skylake also implies -mbmi which
+defines __BMI__ but compilation succeeds.
+
+It is probably due to different BMI implementations on AMD and INTEL
+processors and the way compiler uses related instructions.
+
+Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0b1bc48..dbe7a71 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -833,7 +833,7 @@ fi
+ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
+ # Some toolchains enable these features by default, but they need
+ # registers that aren't set up properly in GRUB.
+- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387"
++ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387 -mno-bmi"
+ fi
+
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+--
+2.25.1
+