weird output of ldd on arm64

Bug #1553110 reported by Oliver Grawert
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fakechroot (Ubuntu)
New
Undecided
Unassigned

Bug Description

running ldd under fakechroot (we are building generic initrds in one of our packages where we have this setup in use) ldd returns a wrong library path (/lib64) instead of the actual path it returns under normal chroot conditions (/lib) on arm64:

running ldd under fakechroot inside a build chroot:

root@localhost:/# fakechroot chroot initramfs-tools-ubuntu-core-0.7.20/build ldd /usr/lib/initramfs-tools/bin/wait-for-root
 linux-vdso.so.1 => (0x0000000000000000)
 libfakechroot.so => /usr/lib/aarch64-linux-gnu/fakechroot/libfakechroot.so (0x0000000000000000)
 libudev.so.1 => /lib/aarch64-linux-gnu/libudev.so.1 (0x0000000000000000)
 libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000000000000000)
 libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000000000000000)
 /lib64/ld-linux-aarch64.so.1 (0x0000000000000000)

running ldd directly in the chroot:

root@localhost:/# ldd /usr/lib/initramfs-tools/bin/wait-for-root
 linux-vdso.so.1 => (0x0000007f9cefd000)
 libudev.so.1 => /lib/aarch64-linux-gnu/libudev.so.1 (0x0000007f9cec5000)
 libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f9cd7c000)
 /lib/ld-linux-aarch64.so.1 (0x0000005591a15000)
 libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f9cd50000)
root@localhost:/#

since there is no /lib64 directory at all on arm64 the copy_exec call from update-initrmfs fails in this case.

Oliver Grawert (ogra)
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote :

Looks like fakechroot wraps ldd with a perl script that makes silly assumptions:

                        if ($Format =~ /^elf64-/) {
                            push @Libs, 'linux-vdso.so.1';
                            $Libs{'linux-vdso.so.1'} = '';
                            $Ldsodir = "/lib64";
                        }

Revision history for this message
Oliver Grawert (ogra) wrote :

hmm, i just noticed that this seems to affect nearly every binary in our initrd (parted, sgdisk do not pull in their libs at all for example)

Revision history for this message
Oliver Grawert (ogra) wrote :

http://paste.ubuntu.com/15322243/ has the output of ldd vs ldd.REAL inside the build env, apart from the zeroed addresses they seem to match.
yet, if you check i.e. https://launchpadlibrarian.net/246864900/buildlog_ubuntu-xenial-arm64.initramfs-tools-ubuntu-core_0.7.35_BUILDING.txt.gz you will see that copy_exec /sbin/parted does not pull libs in at all.

Revision history for this message
Oliver Grawert (ogra) wrote :

also note this latter bit does not seem limited to arm64 at all ... these libs are missing on all arches for initramfs-tools-ubuntu-core

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.