ITADN

Build this SDK bundle for Android API 21: dlopen failed

#221Closedpurpln 创建于 2025-06-03
P
purplncommented
Got `libApplication.so` building my SwiftPM using `--hash-style=both` to run on my old android 5.0 device with ndk 21 and failed ``` dlopen failed: could not load library "libswiftCore.so" needed by "/data/app/<app-id>/lib/arm64/libApplication.so"; caused by empty/missing DT_HASH in "libswiftCore.so" (built with --hash-style=gnu?) ``` Anyway successfully launched SwiftPM executable using `--static-swift-stdlib` and linker setting `--hash-style=both` through `adb shell`. (It was only missing stdin, stdout & stderr, that I easily replicated, and missing process_vm_readv & __register_atfork symbols that I defined as empty functions) Why libraries for android versions 21, 22, 23 are included in your sdk and not supported? Why do you use minimal version 24 if versions prior it only miss stdin, stdout & stderr? (They were introduced in 23 and were [back ported](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/stdio/stdio.cpp#95)) (Also stdout is even not working on android in application mode because logs could be made only through `__android_log` symbols, so stdin, stdout & stderr are useless) Is it possible to ask you to use `-Wl,--hash-style=both` in runtime Swift shared libraries compilation for such crazy-heads like me wanted to use swift on ancient android?
关闭于 2025-11-08 3 条评论