public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Dynamic loader path on x86_64
@ 2022-01-02 17:29 Ilya Trukhanov
  2022-01-03 17:31 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Trukhanov @ 2022-01-02 17:29 UTC (permalink / raw)
  To: libc-help

Hello!

I'm building glibc-2.34 on x86_64 for a no-multilib prefix like so:

$ mkdir build && cd build
$ ../configure --prefix=/pfx
$ make -j16
$ make install

After looking at sysdeps/unix/sysv/linux/x86_64/ldconfig.h:

#define SYSDEP_KNOWN_INTERPRETER_NAMES \
  { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
  { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
  { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },

I'd expect the loader to be installed to
/pfx/lib64/ld-linux-x86-64.so.2, but it is instead installed to
/pfx/lib/ld-linux-x86-64.so.2, breaking (at least) /pfx/bin/ldd, which
gives me "not a dynamic executable" for all files. Strace hints at the
problem:

...
faccessat2(AT_FDCWD, "/pfx/lib/ld-linux.so.2", X_OK, AT_EACCESS) = -1 ENOENT (No such file or directory)
faccessat2(AT_FDCWD, "/pfx/lib64/ld-linux-x86-64.so.2", X_OK, AT_EACCESS) = -1 ENOENT (No such file or directory)
faccessat2(AT_FDCWD, "/pfx/libx32/ld-linux-x32.so.2", X_OK, AT_EACCESS) = -1 ENOENT (No such file or directory)
...

Indeed, symlinking /pfx/lib64 to /pfx/lib makes it work.

Is this some sort of multilib quirk? Aarch64 and riscv ldconfig.h seem
to have theirs at /lib just fine.

Is the lib64->lib symlink the intended way to solve this?

Would things break if I simply patch ldconfig.h to add
{ "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 }?

Is there better way to do this that I'm not aware of, maybe?

Best,
Ilya Trukhanov.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-03 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-02 17:29 Dynamic loader path on x86_64 Ilya Trukhanov
2022-01-03 17:31 ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).