From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta7SR-0004Qx-AS for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ta7SO-0006Qt-8L for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:55 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:36648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta7SO-0006Qo-1S for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:52 -0500 Received: by mail-wg0-f53.google.com with SMTP id dr1so1934615wgb.10 for ; Sun, 18 Nov 2012 08:10:51 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50A90889.1090603@redhat.com> Date: Sun, 18 Nov 2012 17:10:49 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1353087327-16404-1-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] build: replace weak symbols with a static library List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: blauwirbel@gmail.com, sw@weilnetz.de, aliguori@us.ibm.com, qemu-devel@nongnu.org Il 16/11/2012 19:18, Peter Maydell ha scritto: > On 16 November 2012 17:35, Paolo Bonzini 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 > > 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 > Reviewed-by: Peter Maydell I did some Windows testing, too. Blue, can you apply? Paolo