From 356243729364ff4909102a3925dffafeb16e14f7 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 29 Oct 2025 14:38:16 +0500 Subject: [PATCH] build-all.py - fix missing mac cross compilation host args in gmp I guess something has changed in gmp 6.3.0 and this issue become more apparent. Example error: ``` tmp-cnd_sub_n.s:133:14: error: tmp-cnd_add_n.sbrackets expression not supported on this target: 130 stp x8, x9, [x1,#16] ^ :2tmp-cnd_sub_n.s: :error: 134invalid instruction mnemonic 'bic': 6 bic x7, x13, x0: error: invalid instruction mnemonic 'cset'^ ~Lrt: cset x0, cc~ ^~~tmp-cnd_add_n.s~: 131:2: error: invalid instruction mnemonic 'adcs' adcs x8, x10, x6 ^~~~ tmp-cnd_add_n.s:132:2: error: invalid instruction mnemonic 'adcs' adcs x9, x11, x7 ^~~~ tmp-cnd_add_n.s:133:14: error: brackets expression not supported on this target stp x8, x9, [x1,#16] ^ tmp-cnd_add_n.s:134:6: error: invalid instruction mnemonic 'cset' Lrt: cset x0, cs ^~~~ ``` --- nix/build-all.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nix/build-all.py b/nix/build-all.py index 9fda4f9513..5727b23647 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -382,11 +382,13 @@ if MAC_CROSS_COMPILE_INTEL: MAC_CROSS_COMPILE_INTEL_BJAM_ARGS = ["architecture=x86"] MAC_CROSS_COMPILE_INTEL_CXX = "clang++ -arch x86_64" MAC_CROSS_COMPILE_INTEL_CC = "clang -arch x86_64" + MAC_CROSS_COMPILE_INTEL_AUTOCONF_HOST_ARGS = ["--host=x86_64-apple-darwin"] else: MAC_CROSS_COMPILE_INTEL_ARGS = [] MAC_CROSS_COMPILE_INTEL_BJAM_ARGS = [] MAC_CROSS_COMPILE_INTEL_CXX = "" MAC_CROSS_COMPILE_INTEL_CC = "" + MAC_CROSS_COMPILE_INTEL_AUTOCONF_HOST_ARGS = [] OFF_ON = ["OFF", "ON"] BUILD_STATIC = "shared" not in flags @@ -1195,7 +1197,9 @@ if "cgal" in targets: OLD_CC = None if MAC_CROSS_COMPILE_INTEL: OLD_CC = os.environ.get("CC") + # Otherwise it's using arm64 `gcc` and fails to build gmp. os.environ["CC"] = MAC_CROSS_COMPILE_INTEL_CC + gmp_args.extend(MAC_CROSS_COMPILE_INTEL_AUTOCONF_HOST_ARGS) build_dependency( name=f"gmp-{GMP_VERSION}",