From 5055382f0840f4617573cacdab275043fad39e84 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 15 Apr 2026 03:00:00 +0200 Subject: [PATCH] macOS: fix macOS local arm64 build affecting Volume archive Local macOS builds disable universal binaries. On Apple Silicon, that means the regular objects are built for arm64 only, but Volume.make still selected the macOS assembly bundle. Several of those assembly outputs are x86_64 only, which makes ranlib reject Volume.a because it contains mixed cputypes. Make local arm64 macOS builds use the existing arm64 crypto object path and have the macOS build wrapper export CPU_ARCH/COMPILE_ASM consistently for local builds. --- src/Build/build_veracrypt_macosx.sh | 2 ++ src/Volume/Volume.make | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Build/build_veracrypt_macosx.sh b/src/Build/build_veracrypt_macosx.sh index d96121e7..f784df4f 100755 --- a/src/Build/build_veracrypt_macosx.sh +++ b/src/Build/build_veracrypt_macosx.sh @@ -100,6 +100,8 @@ fi if [ "$local_build" = true ]; then echo "Building VeraCrypt with local wxWidgets support and no universal binary" export LOCAL_DEVELOPMENT_BUILD=true + export CPU_ARCH=$(uname -m) + export COMPILE_ASM=$( if [[ "$CPU_ARCH" != "arm64" ]]; then echo true; else echo false; fi ) fi # Check the condition of wxBuildConsole and wxWidgets-$WX_VERSION in the original PARENTDIR diff --git a/src/Volume/Volume.make b/src/Volume/Volume.make index 3beb4e4f..114c704e 100644 --- a/src/Volume/Volume.make +++ b/src/Volume/Volume.make @@ -41,7 +41,11 @@ endif ifeq "$(ENABLE_WOLFCRYPT)" "0" ifeq "$(PLATFORM)" "MacOSX" -ifneq "$(COMPILE_ASM)" "false" +ifeq "$(LOCAL_DEVELOPMENT_BUILD):$(CPU_ARCH)" "true:arm64" + OBJARMV8CRYPTO += ../Crypto/Aes_hw_armv8.oarmv8crypto + OBJS += ../Crypto/Aescrypt.o + OBJARMV8CRYPTO += ../Crypto/sha256_armv8.oarmv8crypto +else ifneq "$(COMPILE_ASM)" "false" OBJSEX += ../Crypto/Aes_asm.oo OBJS += ../Crypto/Aes_hw_cpu.o OBJSEX += ../Crypto/Aes_hw_armv8.oo @@ -58,6 +62,8 @@ ifneq "$(COMPILE_ASM)" "false" OBJSEX += ../Crypto/sha512_avx1.oo OBJSEX += ../Crypto/sha512_avx2.oo OBJSEX += ../Crypto/sha512_sse4.oo +else + OBJS += ../Crypto/Aescrypt.o endif else ifeq "$(CPU_ARCH)" "x86" OBJS += ../Crypto/Aes_x86.o