#617821 Cross ldconfig doesn't preload libfakechroot

Package:
fakechroot
Source:
fakechroot
Submitter:
Raúl Sánchez Siles
Date:
2025-08-17 17:47:40 UTC
Severity:
normal
Tags:
#617821#5
Date:
2011-03-11 17:00:30 UTC
From:
To:
Hello:

  I'm building a cross filesystem image for armel on an amd64. I follow this
steps:
1) multistrap to create a initial filesystem
2) Install qemu static binary inside the filesystem
3) Install fakeroot/fakechroot target binaries
4) fakeroot+fakechroot into the filesystem to dpkg --configure it

The problem happens in the 4th step, where dpkg --configure tries to configure
libc6 which in turns tries to run target ldconfig. According the logs obtained
by strace (attached), ldconfig doesn't load libfakechroot as ls does.

I'm also attaching cross-multistrap.sh and arm.conf files to reproduce the
problem. Mind that I'm trying to generate an Emdebian Lenny Grip Leny
filesystem. The failure will also happen if you try with squeeze Grip.

Please, note that according to http://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=617669 you'll need to link /lib/ld-linux.so.3 with the
one on target filesystem.

In order to simplify things, once you get the failure in the step 4, you can
reproduce it more simply with:
PATH="/sbin:/usr/sbin:$PATH" DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C
LD_LIBRARY_PATH="$PWD/ttools/usr/lib/fakechroot/:
$PWD/ttools/usr/lib/libfakeroot/"
fakeroot fakechroot /usr/sbin/chroot $PWD/chroot_armel/ /bin/sh

And in the target shell you'll have to:
# ldconfig

I've been chatting for a while about this on #emdebian but we've been unable
to reckon what's the problem here.

Thanks,

#617821#10
Date:
2011-03-11 17:16:33 UTC
From:
To:
  Hello again:

  I've thought that it would be helpful to point out some important lines on
the log files, which by the way I remark are lzip compressed due to its size.

  On the ls.log.lz the line where libfakechroot is started to be loaded is
191, whereas the analogous line on ldconfig.log.lz would be line 211.

  HTH,

#617821#15
Date:
2011-03-15 15:38:48 UTC
From:
To:
  Hello:

  I've just read this on the LIMITATIONS section of the fakechroot manpage:

       o   Statically linked binaries doesn't work, especially ldconfig(8), so
you have to wrap this command with dummy version and i.e. set the dpkg
diversion, see: dpkg-divert(8).

  So I wonder, is there any other way to circumvent this problem.

  Thanks.