qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] build: replace weak symbols with a static li


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH v2] build: replace weak symbols with a static library
Date: Sun, 18 Nov 2012 23:12:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20121027 Iceowl/1.0b1 Icedove/3.0.11

Am 18.11.2012 22:09, schrieb Blue Swirl:
Thanks, applied.

On Fri, Nov 16, 2012 at 5:35 PM, Paolo Bonzini<address@hidden>  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<address@hidden>
---
  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 via email to

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