-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix arm64 macOS build with Homebrew #1678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,11 @@ else ifneq "$(COMPILE_ASM)" "false" | |
| OBJSEX += ../Crypto/sha512_avx1.oo | ||
| OBJSEX += ../Crypto/sha512_avx2.oo | ||
| OBJSEX += ../Crypto/sha512_sse4.oo | ||
| else | ||
| else ifeq "$(CPU_ARCH)" "arm64" | ||
| # Local arm64 MacOSX build (no universal binary / no yasm x86 asm) | ||
| OBJARMV8CRYPTO += ../Crypto/Aes_hw_armv8.oarmv8crypto | ||
| OBJS += ../Crypto/Aescrypt.o | ||
| OBJARMV8CRYPTO += ../Crypto/sha256_armv8.oarmv8crypto | ||
| endif | ||
| else ifeq "$(CPU_ARCH)" "x86" | ||
| OBJS += ../Crypto/Aes_x86.o | ||
|
|
@@ -95,6 +98,14 @@ else | |
| OBJS += ../Crypto/Aescrypt.o | ||
| endif | ||
|
|
||
| ifeq "$(CPU_ARCH)" "arm64" | ||
| # x86-only intrinsics sources are compiled as plain objects on arm64 | ||
| # (their bodies are #ifdef-gated to x86/x64 and become empty translation units) | ||
| OBJS += ../Crypto/blake2s_SSE41.o | ||
| OBJS += ../Crypto/blake2s_SSSE3.o | ||
| OBJS += ../Crypto/Sha2Intel.o | ||
| OBJS += ../Crypto/Argon2/src/opt_avx2.o | ||
| else | ||
|
Comment on lines
+101
to
+108
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition is too broad. |
||
| ifeq "$(GCC_GTEQ_430)" "1" | ||
| OBJSSSE41 += ../Crypto/blake2s_SSE41.osse41 | ||
| OBJSSSSE3 += ../Crypto/blake2s_SSSE3.ossse3 | ||
|
|
@@ -112,6 +123,7 @@ ifeq "$(GCC_GTEQ_470)" "1" | |
| else | ||
| OBJS += ../Crypto/Argon2/src/opt_avx2.o | ||
| endif | ||
| endif | ||
| else | ||
| OBJS += ../Crypto/wolfCrypt.o | ||
| endif | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the same scoping issue as the
Volume.makechange:CPU_ARCH=arm64is true on Apple Silicon even for the normal non-local macOS build, which still targets a universalx86_64 + arm64binary.For that universal path, the x86_64 slice still needs these feature flags. In particular, clearing
X86_SHANI_FLAGSmakesSha2Intel.oshanicompile without-msha: with Apple clang this fails because_mm_sha256msg1_epu32requires theshatarget feature.Please either leave these pattern rules unchanged and avoid selecting the x86-specific suffix objects for local arm64-only builds, or gate this flag clearing on the local arm64-only case, e.g.
LOCAL_DEVELOPMENT_BUILD=trueplusCPU_ARCH=arm64, notCPU_ARCH=arm64alone.