From 5b8a1314bdb48a7fca73d3072019a482b8c5b2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 8 Dec 2023 12:56:41 +0100 Subject: [PATCH] SCons: Fix Linux arm64 build for theora and libvpx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The architecture handling in 3.x is all over the place, and I'm not going to start a major refactor like I did for 4.0 so late in its life cycle. So let's add more hacks! ⚔️ This requires manually passing `arch=arm64` when compiling, but this is already the case for other parts of the codebase. --- modules/webm/libvpx/SCsub | 4 +++- platform/x11/detect.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 68b34698980..4170d5456ff 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -228,7 +228,9 @@ elif env["platform"] != "windows": # Disable for Windows, yasm SIMD optimizatio import platform is_x11_or_server_arm = (env["platform"] == "x11" or env["platform"] == "server") and ( - platform.machine().startswith("arm") or platform.machine().startswith("aarch") + platform.machine().startswith("arm") + or platform.machine().startswith("aarch") + or ("arch" in env and env["arch"].startswith("arm")) ) is_macos_x86 = env["platform"] == "osx" and ("arch" in env and (env["arch"] != "arm64")) is_ios_x86 = env["platform"] == "iphone" and ("arch" in env and env["arch"].startswith("x86")) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 347fb1dd396..943bae30c11 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -312,7 +312,7 @@ def configure(env): env.ParseConfig("pkg-config theora theoradec --cflags --libs") else: list_of_x86 = ["x86_64", "x86", "i386", "i586"] - if any(platform.machine() in s for s in list_of_x86): + if (env["arch"].startswith("x86") or env["arch"] == "") and any(platform.machine() in s for s in list_of_x86): env["x86_libtheora_opt_gcc"] = True if not env["builtin_libvpx"]: