Hello,
Am I only one who getting link errors in libDispatch after recent updates .)
The issue in missed libutil
referenced in glibc.modulemap
file generated from bionic.modulemap.gyb
.
// File: stdlib/public/Platform/bionic.modulemap.gyb
module SwiftGlibc [system] {
// FIXME: util contains rarely used functions and not usually needed.
// Unfortunately link directive doesn't work in the submodule yet.
link "util"
link "dl"
...
I don't see libutil
in Android NDK:
find . -type f -iname *.a -or -iname *.so | grep arch-arm/ | grep dl
./platforms/android-23/arch-arm/usr/lib/libdl.a
./platforms/android-23/arch-arm/usr/lib/libdl.so
...
./platforms/android-28/arch-arm/usr/lib/libdl.a
./platforms/android-28/arch-arm/usr/lib/libdl.so
find . -type f -iname *.a -or -iname *.so | grep arch-arm/ | grep util
NO RESULTS
Is that libutil
is something really exists in Android NDK or it is artefact from Linux. Should we remove link "util"
from file bionic.modulemap.gyb
?
Thank you!
UPDATE 1: Additional info:
Native libraries must use only public API, and must not link against
non-NDK platform libraries. Starting with API 24 this rule is enforced
and applications are no longer able to load non-NDK platform libraries.
The rule is enforced by the dynamic linker, so non-public libraries are
not accessible regardless of the way code tries to loa
them: System.loadLibrary, DT_NEEDED entries, and
direct calls to dlopen(3) will all work exactly the same.
Taken from: Android linker changes for NDK developers
References: