fix(ios): define BLAKE3_NO_* macros for x86_64 simulator#917
Merged
boorad merged 1 commit intomargelo:mainfrom Feb 12, 2026
Merged
Conversation
PR margelo#884 excluded blake3_neon.c for x86_64 simulator, but the x86 SIMD implementations (AVX-512, AVX2, SSE4.1, SSE2) still cause linker errors. The .c source files (blake3_avx512.c, etc.) are already excluded from compilation via exclude_files. However, blake3_dispatch.c forward-declares and calls those functions guarded by #if !defined(BLAKE3_NO_AVX512), so the compiler still emits references to symbols whose implementations don't exist — causing "Undefined symbols" at link time. Android's CMakeLists.txt already handles this correctly (lines 18-22) by defining -DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 etc. for x86/x86_64. This commit mirrors that approach for iOS via xcconfig preprocessor definitions scoped to iphonesimulator SDK + x86_64 arch. Fixes margelo#918
84d1dd6 to
fd24f0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to #884. That PR excluded
blake3_neon.cfor x86_64 simulator (compile-time fix), but x86 SIMD symbols (AVX-512, AVX2, SSE4.1, SSE2) still cause linker errors:The
.cimplementation files (blake3_avx512.c, etc.) are correctly excluded viaexclude_files, butblake3_dispatch.cstill references those symbols — it forward-declares and calls them unlessBLAKE3_NO_*macros are defined:Android's
CMakeLists.txtalready handles this (lines 18-22) with-DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 ..., but the iOS podspec doesn't.This PR adds conditional
GCC_PREPROCESSOR_DEFINITIONSscoped to[sdk=iphonesimulator*][arch=x86_64], mirroring the Android approach. Blake3 falls back to its portable C implementation (the SIMD paths were never reachable on the simulator anyway).Related
Testing
pnpm patchon v1.0.9, ran EAS Build withdevelopment-simulatorprofile (x86_64 iOS Simulator) — build now succeeds where it previously failed with undefined symbols