[Toybox] Where does the dynamic linker live in cross compile toolchains?
Rob Landley
rob at landley.net
Mon Jul 20 23:33:03 UTC 2026
On 7/20/26 13:51, enh wrote:
> On Sun, Jul 19, 2026 at 5:57 PM Rob Landley via Toybox
> <toybox at lists.landley.net> wrote:
>>
>> I'm trying to update mkroot/packages/dynamic and in theory I can
>> ${CROSS_COMPILE}cc --print-file-name=libc.so and then copy all the
>> shared libraries and symlinks out of that directory, but I don't know
>> how to find and install the dynamic linker out of a compiler toolchain.
>
> you can't, because it's not there.
And you wonder why I've only been able to test static linked binaries
all this time. :(
>> In musl-libc it's a symlink to libc.so so I can just do that, and I've
>> got to admit I don't care about glibc that much, but I can't find the
>> dynamic linker binary anywhere under the Android NDK?
>>
>> Bionic's libc.so is executable so maybe it pulls the same trick, but I
>> have yet to find a way to invoke it that isn't an immediate segfault
>> so... dunno?
>
> no, /system/bin/linker (for ilp32) or /system/bin/linker64 on the
> device are the dynamic linker for that device's version of the os.
I can find the paths it expects them at with readelf -a, but couldn't
figure out what to put/link there. Alas, now I know why...
Is there an obvious way to build bionic from source as a standalone
package? I've presumably built it as part of the whole AOSP
constellation way back when, but I've been using the NDK as an excuse
not to ship an LLVM+bionic toolchain in https://landley.net/bin/toolchains.
I should really re-engage with llvm toolchain builds, especially now the
hexagon guys have updated
https://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux.git/tree/Documentation/arch/hexagon/qemu-boot.rst?h=hexagon-qemu-boot-04-july-2026
I'm trying to chip away at that again. I think you linked me to the NDK
build repo once upon a time, and should probably dig back through old
email to find it, although what I'd _want_ to do is combine the two LLVM
builds into one build, which seems unlikely to be easy but I've done
worse...
Rob
More information about the Toybox
mailing list