qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5 2/9] make: ensure all members of libqemuutil.a are linked
Date: Wed, 26 Aug 2015 09:25:39 -0600	[thread overview]
Message-ID: <55DDDA73.8020507@redhat.com> (raw)
In-Reply-To: <1440601524-30316-3-git-send-email-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1739 bytes --]

On 08/26/2015 09:05 AM, Daniel P. Berrange wrote:
> The libqemuutil.a archive may contain QOM objects which are
> only indirectly referenced via __attribute__((constructor))
> annotations. Despite the constructor annotation the linker
> will think these objects are unused by the executable and
> so drop them when linking, to the system emulator. As a
> result the objects in question will be missing from QOM.
> 
> Using the -Wl,--whole-archive flag instructs the linker
> to pull in everything in libqemuutil.a regardless of
> whether it thinks it is used or not.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  Makefile.target | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.target b/Makefile.target
> index 3e7aafd..5b08f0f 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -180,8 +180,13 @@ all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
>  $(QEMU_PROG_BUILD): config-devices.mak
>  
>  # build either PROG or PROGW
> +# We must use --whole-archive with libqemuutil.a otherwise the
> +# linker will drop any objects from the archive which are only
> +# indirectly referenced via __attribute__(constructor) annotations
>  $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
> -	$(call LINK, $(filter-out %.mak, $^))
> +	$(call LINK, $(filter-out %.mak, $(sort $(all-obj-y)))) \

Why the added $(sort)? Should that be a separate patch?

> +		-Wl,--whole-archive ../libqemuutil.a -Wl,--no-whole-archive \
> +		../libqemustub.a

Otherwise makes sense to me.
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-08-26 15:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 15:05 [Qemu-devel] [PATCH v5 0/9] Extract TLS handling code from VNC server Daniel P. Berrange
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 1/9] qapi: allow override of default enum prefix naming Daniel P. Berrange
2015-08-26 15:22   ` Eric Blake
2015-08-27 11:04     ` Daniel P. Berrange
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 2/9] make: ensure all members of libqemuutil.a are linked Daniel P. Berrange
2015-08-26 15:25   ` Eric Blake [this message]
2015-08-26 15:42     ` Daniel P. Berrange
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 3/9] crypto: introduce new base module for TLS credentials Daniel P. Berrange
2015-08-26 16:56   ` Eric Blake
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 4/9] crypto: introduce new module for TLS anonymous credentials Daniel P. Berrange
2015-08-26 21:22   ` Eric Blake
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 5/9] crypto: introduce new module for TLS x509 credentials Daniel P. Berrange
2015-08-26 21:32   ` Eric Blake
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 6/9] crypto: add sanity checking of " Daniel P. Berrange
2015-08-26 21:53   ` Eric Blake
2015-08-27  8:48     ` Daniel P. Berrange
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 7/9] crypto: introduce new module for handling TLS sessions Daniel P. Berrange
2015-08-27 14:33   ` Eric Blake
2015-08-28 13:14     ` Daniel P. Berrange
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 8/9] ui: fix return type for VNC I/O functions to be ssize_t Daniel P. Berrange
2015-08-28 21:08   ` Eric Blake
2015-08-26 15:05 ` [Qemu-devel] [PATCH v5 9/9] ui: convert VNC server to use QCryptoTLSSession Daniel P. Berrange
2015-09-01 15:08   ` Eric Blake
2015-09-02 11:06     ` Daniel P. Berrange

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=55DDDA73.8020507@redhat.com \
    --to=eblake@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --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).