All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	aliguori@us.ibm.com, qemu-devel@nongnu.org,
	peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH v2] build: replace weak symbols with a static library
Date: Sun, 18 Nov 2012 23:12:02 +0100	[thread overview]
Message-ID: <50A95D32.2090300@weilnetz.de> (raw)
In-Reply-To: <CAAu8pHvV1Tp1xngp-7K9Cr+PnXxcNYQyq049Hb=Lur=HQ=McXw@mail.gmail.com>

Am 18.11.2012 22:09, schrieb Blue Swirl:
> Thanks, applied.
>
> On Fri, Nov 16, 2012 at 5:35 PM, Paolo Bonzini<pbonzini@redhat.com>  wrote:
>    
>> Weak symbols were a nice idea, but they turned out not to be a good one.
>> Toolchain support is just too sparse, in particular llvm-gcc is totally
>> broken.
>>
>> This patch uses a surprisingly low-tech approach: a static library.
>> Symbols in a static library are always overridden by symbols in an
>> object file.  Furthermore, if you place each function in a separate
>> source file, object files for unused functions will not be taken in.
>> This means that each function can use all the dependencies that it needs
>> (especially QAPI stuff such as error_setg).
>>
>> Thus, all stubs are placed in separate object files and put together in
>> a static library.  The library then is linked to all programs.
>>
>> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>> ---
>>   Makefile                   | 16 +++++++++++-----
>>   Makefile.objs              |  5 +++++
>>   Makefile.target            |  4 ++--
>>   compiler.h                 | 11 -----------
>>   osdep.c                    | 32 --------------------------------
>>   oslib-win32.c              |  7 -------
>>   qemu-sockets.c             | 22 ----------------------
>>   qmp.c                      |  9 ---------
>>   rules.mak                  |  2 +-
>>   stubs/Makefile.objs        |  8 ++++++++
>>   stubs/arch-query-cpu-def.c |  9 +++++++++
>>   stubs/fd-register.c        |  6 ++++++
>>   stubs/fdset-add-fd.c       |  7 +++++++
>>   stubs/fdset-find-fd.c      |  7 +++++++
>>   stubs/fdset-get-fd.c       |  7 +++++++
>>   stubs/fdset-remove-fd.c    |  7 +++++++
>>   stubs/get-fd.c             |  8 ++++++++
>>   stubs/set-fd-handler.c     | 11 +++++++++++
>>   18 file modificati, 89 inserzioni(+), 89 rimozioni(-)
>>   create mode 100644 stubs/Makefile.objs
>>   create mode 100644 stubs/arch-query-cpu-def.c
>>   create mode 100644 stubs/fd-register.c
>>   create mode 100644 stubs/fdset-add-fd.c
>>   create mode 100644 stubs/fdset-find-fd.c
>>   create mode 100644 stubs/fdset-get-fd.c
>>   create mode 100644 stubs/fdset-remove-fd.c
>>   create mode 100644 stubs/get-fd.c
>>   create mode 100644 stubs/set-fd-handler.c
>>
>>      


Parallel builds need an additional dependency.
Otherwise libqemustub.a is built too late.

I just sent a patch which fixes this.

Stefan

      reply	other threads:[~2012-11-18 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16 17:35 [Qemu-devel] [PATCH v2] build: replace weak symbols with a static library Paolo Bonzini
2012-11-16 18:18 ` Peter Maydell
2012-11-18 16:10   ` Paolo Bonzini
2012-11-18 18:31     ` Stefan Weil
2012-11-18 21:09 ` Blue Swirl
2012-11-18 22:12   ` Stefan Weil [this message]

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=50A95D32.2090300@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.