From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaD60-0003mz-IK for qemu-devel@nongnu.org; Sun, 18 Nov 2012 17:12:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaD5x-0006nL-Gb for qemu-devel@nongnu.org; Sun, 18 Nov 2012 17:12:08 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:34213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaD5x-0006n8-56 for qemu-devel@nongnu.org; Sun, 18 Nov 2012 17:12:05 -0500 Message-ID: <50A95D32.2090300@weilnetz.de> Date: Sun, 18 Nov 2012 23:12:02 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1353087327-16404-1-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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: Blue Swirl Cc: Paolo Bonzini , aliguori@us.ibm.com, qemu-devel@nongnu.org, peter.maydell@linaro.org Am 18.11.2012 22:09, schrieb Blue Swirl: > Thanks, applied. > > On Fri, Nov 16, 2012 at 5:35 PM, 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 >> --- >> 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