qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are user static builds really dynamically linked ?


From: Peter Maydell
Subject: Re: Are user static builds really dynamically linked ?
Date: Wed, 16 Dec 2020 11:07:41 +0000

On Wed, 16 Dec 2020 at 06:39, Tj (Elloe Linux) <ml.linux@elloe.vision> wrote:
>
> user --static builds are apparently resulting in dynamically linked
> executables (to the glibc library, not other shared objects )

I think you mean that you end up with an executable that's
dynamically linked but although it requires the dynamic
linker (ld.so) it has an empty list of dynamic libraries
(ie not even glibc).

> Concise summary:
>
> $ file ../qemu-aarch64_v*
>
> ../qemu-aarch64_v4.2.1: ELF 64-bit LSB executable, x86-64, version 1
> (GNU/Linux), statically linked,
> BuildID[sha1]=70f5e10ac0eb9b63d7758850e2f18d0a047d4b79, for GNU/Linux
> 3.2.0, with debug_info, not stripped
>
> ../qemu-aarch64_v5.2:   ELF 64-bit LSB shared object, x86-64, version 1
> (GNU/Linux), dynamically linked,
> BuildID[sha1]=91fda2fa08f46d1bb6d19b6f72a4819a7c20fd7e, for GNU/Linux
> 3.2.0, stripped
>
> $ ldd  ../qemu-aarch64_v*
>
> ../qemu-aarch64_v4.2.1:
>         not a dynamic executable
> ../qemu-aarch64_v5.2:
>         statically linked

Something has definitely changed here. What you had with 4.2.1
is what you should be getting. The obvious suspect is that
something weird happened in the meson conversion...

That said, there must be something specific to your setup which
is causing this. I just tried (on Ubuntu 18.04):

$ git clone  https://git.qemu.org/git/qemu.git
$ cd qemu
$ mkdir build
$ cd build
$ ../configure --disable-system --enable-linux-user --static
--target-list=aarch64-linux-user
$ make -j8

and 'file qemu-aarch64' says:
qemu-aarch64: ELF 64-bit LSB executable, x86-64, version 1
(GNU/Linux), statically linked, for GNU/Linux 3.2.0,
BuildID[sha1]=c3e1ffd0a2805a7043a40659ecbc7774cb42f7bf, with
debug_info, not stripped
and 'ldd qemu-aarch64' says:
        not a dynamic executable

as expected.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]