Comment 11 for bug 1701798

Revision history for this message
Bruno Haible (bruno-clisp) wrote :

> That patch would prevent us from picking up a legitimate ld.so.cache for the guest (in a chroot, for instance), so I don't think we should take it.
But in a chroot, QEMU_LD_PREFIX is most likely NOT set. So how about this pseudocode?

  if (strcmp (pathname, "/etc/ld.so.cache") == 0 && getenv ("QEMU_LD_PREFIX") != NULL) {
    pathname = concat (getenv ("QEMU_LD_PREFIX"), pathname);
  }

That is, redirect /etc/ld.so.cache to $QEMU_LD_PREFIX/etc/ld.so.cache if and only if $QEMU_LD_PREFIX is set.