- > why doesn't glibc create the link at installation?
- glibc intentionally omits /lib/ld.so on GNU/Hurd for historical ABI compatibility, while GCC's target configuration (gnu.h) hardcodes /lib/ld.so instead of /lib/ld.so.1.
- 1. Why glibc installs ld.so.1 instead of ld.so
- • Historical a.out vs. ELF separation: In the early days of GNU/Hurd and Linux, /lib/ld.so was reserved for the legacy a.out dynamic linker, while the newer ELF dynamic linker was given an explicit soname version (/lib/ld.so.1 on Hurd, /lib/ld-linux.so.2 on Linux) to avoid collisions.
- • Upstream glibc convention: In glibc's shlib-versions and sysdeps/mach/hurd/configure, the dynamic linker's rtld-installed-name is explicitly defined as ld.so.1. glibc never creates an unversioned ld.so symlink on any architecture because ld.so is considered a generic/legacy name rather than an ABI-versioned soname.
- 2. Why your binaries asked for /lib/ld.so
- • GCC's GNU_USER_DYNAMIC_LINKER macro: In GCC's source tree (gcc/config/gnu.h or gcc/config/i386/gnu.h), the default dynamic linker path for i686-gnu was historically defined as /lib/ld.so (unlike x86_64-gnu, which uses /lib/ld-x86-64.so.1).
- • Distribution packaging handles the symlink: In full distributions like Debian GNU/Hurd, the libc0.3 package's post-install/packaging rules (or /usr/lib compatibility symlinks) manually create /lib/ld.so -> ld.so.1 so binaries built with upstream GCC specs execute cleanly. When building a minimal sysroot from source without a distro package manager, you have to create that symlink yourself.
- If you'd like to avoid needing that symlink for newly compiled binaries, I can show you how to override DYNAMIC_LINKER in GCC's specs file so i686-gnu-gcc embeds /lib/ld.so.1 directly.