Skip to content

d/rules: fix qemu-user-static to really be static (LP: #1908331)

Since qemu 5.0 qemu-user-static is no more "fully static" due to the usage of --static-pie since this commit. They are static in regard to e.g. ldd, but they are a dynamic pie executable and thereby need glibc to match.

Formerly:

  $ file /usr/bin/qemu-aarch64-static
  /usr/bin/qemu-aarch64-static: ELF 64-bit LSB executable, x86-64, version 1
  (GNU/Linux), statically linked, BuildID[sha1]=..., for GNU/Linux 3.2.0,
  stripped
  $ ldd /usr/bin/qemu-aarch64-static
    statically linked

Now:

  $ file /usr/bin/qemu-aarch64-static
  /usr/bin/qemu-aarch64-static: ELF 64-bit LSB pie executable, x86-64, version 1
  (GNU/Linux), dynamically linked, BuildID[sha1]=..., for GNU/Linux 3.2.0,
  stripped
  $ ldd /usr/bin/qemu-aarch64-static
    statically linked

Some common use cases like the usage for debootstrapped environments are affected by that. Although they don't link to other shared libraries they are dynamically linked to glibc and therefore require the same version of the glibc shared libraries at runtime. This breaks many uses in foreign architecture chroots.

As mentioned by the commit this can be overwritten by setting --disable-pie where that behavior is not wanted. We already had --disable-pie for --static-pie being an issue on some architectures, but now we can generally set it in the qemu-user-static builds.

Edited by Christian Ehrhardt

Merge request reports

Loading