Skip to content

Commit 5055382

Browse files
committed
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.
1 parent 07f0b5f commit 5055382

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/Build/build_veracrypt_macosx.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ fi
100100
if [ "$local_build" = true ]; then
101101
echo "Building VeraCrypt with local wxWidgets support and no universal binary"
102102
export LOCAL_DEVELOPMENT_BUILD=true
103+
export CPU_ARCH=$(uname -m)
104+
export COMPILE_ASM=$( if [[ "$CPU_ARCH" != "arm64" ]]; then echo true; else echo false; fi )
103105
fi
104106

105107
# Check the condition of wxBuildConsole and wxWidgets-$WX_VERSION in the original PARENTDIR

src/Volume/Volume.make

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ endif
4141

4242
ifeq "$(ENABLE_WOLFCRYPT)" "0"
4343
ifeq "$(PLATFORM)" "MacOSX"
44-
ifneq "$(COMPILE_ASM)" "false"
44+
ifeq "$(LOCAL_DEVELOPMENT_BUILD):$(CPU_ARCH)" "true:arm64"
45+
OBJARMV8CRYPTO += ../Crypto/Aes_hw_armv8.oarmv8crypto
46+
OBJS += ../Crypto/Aescrypt.o
47+
OBJARMV8CRYPTO += ../Crypto/sha256_armv8.oarmv8crypto
48+
else ifneq "$(COMPILE_ASM)" "false"
4549
OBJSEX += ../Crypto/Aes_asm.oo
4650
OBJS += ../Crypto/Aes_hw_cpu.o
4751
OBJSEX += ../Crypto/Aes_hw_armv8.oo
@@ -58,6 +62,8 @@ ifneq "$(COMPILE_ASM)" "false"
5862
OBJSEX += ../Crypto/sha512_avx1.oo
5963
OBJSEX += ../Crypto/sha512_avx2.oo
6064
OBJSEX += ../Crypto/sha512_sse4.oo
65+
else
66+
OBJS += ../Crypto/Aescrypt.o
6167
endif
6268
else ifeq "$(CPU_ARCH)" "x86"
6369
OBJS += ../Crypto/Aes_x86.o

0 commit comments

Comments
 (0)