Build fails for `ios` & `ios-simulator` on `arm64` with Apple LLVM >> Undefined symbols `___clear_cache`
Related: #40800 (closed)
make error output
Undefined symbols for architecture arm64:
"___clear_cache", referenced from:
_hashx_compile_a64 in libtor-testing.a(libhashx_a-compiler_a64.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:11733: src/test/test-slow] Error 1
make[1]: *** Waiting for unfinished jobs....
Undefined symbols for architecture arm64:
"___clear_cache", referenced from:
_hashx_compile_a64 in libtor-testing.a(libhashx_a-compiler_a64.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture arm64:
"___clear_cache", referenced from:
make[1]: *** [Makefile:11087: src/test/fuzz/fuzz-address] Error 1
_hashx_compile_a64 in libtor-testing.a(libhashx_a-compiler_a64.o)
Undefined symbols for architecture arm64:
Undefined symbols for architecture arm64:
"___clear_cache", referenced from:
"___clear_cache", referenced from:
_hashx_compile_a64 in libtor-testing.a(libhashx_a-compiler_a64.o)
_hashx_compile_a64 in libtor-testing.a(libhashx_a-compiler_a64.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: symbol(s) not found for architecture arm64
make[1]: *** [Makefile:11107: src/test/fuzz/fuzz-consensus] Error 1
ld: symbol(s) not found for architecture arm64
clangclang: : error: error: linker command failed with exit code 1 (use -v to see invocation)linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:11097: src/test/fuzz/fuzz-addressPTR] Error 1
make[1]: *** [Makefile:11117: src/test/fuzz/fuzz-descriptor] Error 1
make: *** [Makefile:7647: all] Error 2
The following patch results in a successful build for ios
and ios-simulator
arm64 using Apple LLVM (clang 17.0.6)
Patch was just to see if it worked for those 2 targets, and it does.
If you have Linux/macOS x86_64
machine and docker
, can play with the following:
git clone https://github.com/05nelsonm/kmp-tor-resource.git
cd kmp-tor-resource
git checkout issue/8-ios-aarch64-test-patch
./external/task.sh build:ios-simulator:aarch64
./external/task.sh build:ios:aarch64
Using iPhoneOS17.0.sdk
and iPhoneSimulator17.0.sdk
(darwin 23
)
Edited by 05nelsonm