Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Q qemu
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • QEMU
  • qemu
  • Merge requests
  • !16

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Christian Ehrhardt requested to merge paelzer-guest/qemu:fix-static-builds-to-be-static into master Dec 16, 2020
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

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 Dec 16, 2020 by Christian Ehrhardt
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-static-builds-to-be-static