From: Peter Maydell <peter.maydell@linaro.org>
To: "Tj (Elloe Linux)" <ml.linux@elloe.vision>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: Are user static builds really dynamically linked ?
Date: Wed, 16 Dec 2020 11:07:41 +0000 [thread overview]
Message-ID: <CAFEAcA8L2gHB6HMPO8YHNZff4pfp+VTrgK++3DH--OeqCZh-3w@mail.gmail.com> (raw)
In-Reply-To: <8732c6f5-34ac-dcce-ee9f-69e7dd612e4e@elloe.vision>
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
next prev parent reply other threads:[~2020-12-16 11:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 6:27 Are user static builds really dynamically linked ? Tj (Elloe Linux)
2020-12-16 11:07 ` Peter Maydell [this message]
2020-12-16 11:39 ` Paolo Bonzini
2020-12-16 14:18 ` Tj (Elloe Linux)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA8L2gHB6HMPO8YHNZff4pfp+VTrgK++3DH--OeqCZh-3w@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=ml.linux@elloe.vision \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).