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 19:31:35 +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 17:10, schrieb Paolo Bonzini:
Il 16/11/2012 19:18, Peter Maydell ha scritto:
On 16 November 2012 17:35, 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>
This builds and runs OK on Linux and MacOS X.
(nb: only system and usermode executables tested, not the standalone
utility executables like qemu-ga).

Tested-by: Peter Maydell<address@hidden>
Reviewed-by: Peter Maydell<address@hidden>
I did some Windows testing, too.  Blue, can you apply?

Paolo

It also works for me (tested on Debian Linux and w32).

Tested-by: Stefan Weil <address@hidden>




reply via email to

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