From 728f773592a4c1dadf90871f8e38fd8691ad4024 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 17 Jan 2026 14:16:17 +0000 Subject: [PATCH] Fix cross-compilation detection using HOST_IS_ARM64 Use separate HOST_IS_ARM64 variable to track the host architecture, allowing proper detection of ARM to x64 cross-compilation scenarios. This ensures the correct compiler flags are set when building x64 on ARM hosts. Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- scripts/mk_unix_dist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/mk_unix_dist.py b/scripts/mk_unix_dist.py index 7aebb6750..edd143f52 100644 --- a/scripts/mk_unix_dist.py +++ b/scripts/mk_unix_dist.py @@ -30,6 +30,7 @@ PYTHON_ENABLED=True MAKEJOBS=getenv("MAKEJOBS", '8') OS_NAME=None LINUX_X64=mk_util.LINUX_X64 +HOST_IS_ARM64=mk_util.IS_ARCH_ARM64 # Save the original host architecture def set_verbose(flag): global VERBOSE @@ -122,7 +123,7 @@ def check_build_dir(path): # Create a build directory using mk_make.py def mk_build_dir(path): - global LINUX_X64 + global LINUX_X64, HOST_IS_ARM64 if not check_build_dir(path) or FORCE_MK: env = os.environ opts = [sys.executable, os.path.join('scripts', 'mk_make.py'), "-b", path, "--staticlib"] @@ -148,7 +149,7 @@ def mk_build_dir(path): "CXX": "aarch64-none-linux-gnu-g++" } env.update(myvar) - elif not mk_util.IS_ARCH_ARM64 and not LINUX_X64: + elif HOST_IS_ARM64 and not mk_util.IS_ARCH_ARM64: # we are on arm64 machine but build for x64 # handle cross compilation on macOS (or other Unix systems) import platform