
Pockr | Part 3 — Bundling 50 Native Libraries
Libraries Without Breaking the Android Linker Part 3 of 6 — building Pockr, a single APK that runs Docker on non-rooted Android. ← Part 2: Executing Binaries on Android QEMU Needs Friends QEMU from Termux doesn't link statically. It depends on a chain of ~50 shared libraries: libqemu.so ├── libcurl.so → libssl.so, libcrypto.so, libssh.so, libgnutls.so ... ├── libglib-2.0.so → libpcre2-8.so, libffi.so, libandroid-support.so ... ├── libbz2.so └── libzstd.so ... (44 more) All of these are bundled in Termux's own prefix at /data/data/com.termux/files/usr/lib/ — which doesn't exist on devices without Termux installed. Problem 1: RUNPATH Points to Nowhere Every Termux binary has a hardcoded RUNPATH in its ELF: readelf -d libqemu.so | grep RUNPATH ( RUNPATH ) Library runpath: [ /data/data/com.termux/files/usr/lib] Android's dynamic linker tries this path first. It doesn't exist → symbols not found → crash. Fix: Zero out the RUNPATH in every .so file. Why Not patchelf? The obvious tool is patc
Continue reading on Dev.to
Opens in a new tab


