qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	"Tj (Elloe Linux)" <ml.linux@elloe.vision>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: Are user static builds really dynamically linked ?
Date: Wed, 16 Dec 2020 12:39:43 +0100	[thread overview]
Message-ID: <afa57723-2ea1-d381-e548-30bd73e2885d@redhat.com> (raw)
In-Reply-To: <CAFEAcA8L2gHB6HMPO8YHNZff4pfp+VTrgK++3DH--OeqCZh-3w@mail.gmail.com>

On 16/12/20 12:07, Peter Maydell wrote:
> 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...

Please send the (gzipped) build.ninja file.

Paolo

> 
> 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.



  reply	other threads:[~2020-12-16 11:41 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
2020-12-16 11:39   ` Paolo Bonzini [this message]
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=afa57723-2ea1-d381-e548-30bd73e2885d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ml.linux@elloe.vision \
    --cc=peter.maydell@linaro.org \
    --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).