From 6b2cfa416c1e67e22cd190c9afad91aba585d30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 23 Feb 2021 13:48:57 +0100 Subject: [PATCH] SCons: Work around compilation issue on Linux ARM64 Fixes #45687. This is really just a band-aid, our current buildsystem doesn't work well for cross-compilation and needs a thorough refactoring to do so. --- modules/denoise/config.py | 9 +++++++++ modules/raycast/config.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/denoise/config.py b/modules/denoise/config.py index 211b201fec7..3ad454414f9 100644 --- a/modules/denoise/config.py +++ b/modules/denoise/config.py @@ -8,6 +8,15 @@ def can_build(env, platform): supported_platform = platform in ["x11", "osx", "windows", "server"] supported_bits = env["bits"] == "64" supported_arch = env["arch"] != "arm64" + + # Hack to disable on Linux arm64. This won't work well for cross-compilation (checks + # host, not target) and would need a more thorough fix by refactoring our arch and + # bits-handling code. + from platform import machine + + if platform == "x11" and machine() != "x86_64": + supported_arch = False + return env["tools"] and supported_platform and supported_bits and supported_arch diff --git a/modules/raycast/config.py b/modules/raycast/config.py index 85416c16cc8..5307c62d066 100644 --- a/modules/raycast/config.py +++ b/modules/raycast/config.py @@ -6,6 +6,15 @@ def can_build(env, platform): supported_platform = platform in ["x11", "osx", "windows", "server"] supported_bits = env["bits"] == "64" supported_arch = env["arch"] != "arm64" + + # Hack to disable on Linux arm64. This won't work well for cross-compilation (checks + # host, not target) and would need a more thorough fix by refactoring our arch and + # bits-handling code. + from platform import machine + + if platform == "x11" and machine() != "x86_64": + supported_arch = False + return env["tools"] and supported_platform and supported_bits and supported_arch