From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUz4q-0003eK-09 for qemu-devel@nongnu.org; Mon, 09 Mar 2015 10:54:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUz4l-00028o-Ut for qemu-devel@nongnu.org; Mon, 09 Mar 2015 10:54:39 -0400 Received: from smtp.citrix.com ([66.165.176.89]:59114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUz4l-00028h-Qa for qemu-devel@nongnu.org; Mon, 09 Mar 2015 10:54:35 -0400 From: Wei Liu Date: Mon, 9 Mar 2015 14:54:33 +0000 Message-ID: <1425912873-21215-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $LIBS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Wei Liu , stefano.stabellini@eu.citrix.com I discovered a problem when trying to build QEMU statically with gcc. libm is an element of LIBS while libpixman-1 is an element in libs_softmmu. Libpixman references functions in libm, so the original ordering makes linking fail. This fix is to reorder $libs_softmmu and $LIBS to make -lm appear after -lpixman-1. However I'm not quite sure if this is the right fix, hence the RFC tag. Normally QEMU is built with c++ compiler which happens to link in libm (at least this is the case with g++), so building QEMU statically normally just works and nobody notices this issue. Signed-off-by: Wei Liu --- Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.target b/Makefile.target index 2262d89..1083377 100644 --- a/Makefile.target +++ b/Makefile.target @@ -134,7 +134,7 @@ obj-$(CONFIG_KVM) += kvm-all.o obj-y += memory.o savevm.o cputlb.o obj-y += memory_mapping.o obj-y += dump.o -LIBS+=$(libs_softmmu) +LIBS := $(libs_softmmu) $(LIBS) # xen support obj-$(CONFIG_XEN) += xen-common.o -- 1.9.1