When macos-latest changed to ARM64 runners, the mac-build-x64 job started
producing arm64 libz3.dylib inside x86_64-tagged wheels, causing import
failures on macOS x86_64.
Root cause: mk_make.py subprocess detects the ARM64 host at module level
(IS_ARCH_ARM64=True), and without --arm64=false override it adds -arch arm64
to SLIBEXTRAFLAGS, overriding the -arch x86_64 set via environment variables.
Fix 1 (mk_unix_dist.py): Pass --arm64=false to mk_make.py subprocess when
building x64 on an ARM64 host, preventing the arm64 flag inheritance.
Fix 2 (mk_util.py): When IS_ARCH_ARM64=False on an ARM64 macOS host, add
-arch x86_64 to SLIBEXTRAFLAGS so the shared library linker also targets
x86_64 (LDFLAGS already receives this flag from the env var).
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Initial plan
* Add support for ARM to X64 cross-compilation on macOS
- Initialize LINUX_X64 from mk_util.LINUX_X64
- Add support for --arch=x64 flag to force x64 builds
- Handle cross-compilation from ARM64 to x64 on macOS using -arch x86_64 flags
- Update help text to reflect both arm64 and x64 architecture options
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* 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>
* Address code review: improve arch flag handling
- Extract target_arch_flag to variable to reduce duplication
- Add .strip() calls to handle trailing spaces in environment variables
- Ensure proper spacing in concatenated flags
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>