bazzite/spec_files/waydroid/sse3.patch
2023-12-28 14:09:54 -08:00

33 lines
1.2 KiB
Diff

From 6eea5cf63f4a724e66a2857b8f67ee2bbc82f0bd Mon Sep 17 00:00:00 2001
From: sta-c0000 <37939220+sta-c0000@users.noreply.github.com>
Date: Tue, 19 Dec 2023 09:49:12 -0500
Subject: [PATCH] Add SSSE3 CPU check for arch x86/x86_64
---
tools/helpers/arch.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/helpers/arch.py b/tools/helpers/arch.py
index 735d344e..c74ef906 100644
--- a/tools/helpers/arch.py
+++ b/tools/helpers/arch.py
@@ -19,11 +19,14 @@ def host():
" architecture is not supported")
def maybe_remap(target):
- if target == "x86_64":
+ if target.startswith("x86"):
with open("/proc/cpuinfo") as f:
- if "sse4_2" not in f.read():
- logging.info("x86_64 CPU does not support SSE4.2, falling back to x86...")
- return "x86"
+ cpuinfo = f.read()
+ if "ssse3" not in cpuinfo:
+ raise ValueError("x86/x86_64 CPU must support SSSE3!")
+ if target == "x86_64" and "sse4_2" not in cpuinfo:
+ logging.info("x86_64 CPU does not support SSE4.2, falling back to x86...")
+ return "x86"
elif target == "arm64" and platform.architecture()[0] == "32bit":
return "arm"