From patchwork Mon Mar 9 14:54:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 448060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E104A14008F for ; Tue, 10 Mar 2015 01:55:03 +1100 (AEDT) Received: from localhost ([::1]:43662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUz5A-0003ve-TW for incoming@patchwork.ozlabs.org; Mon, 09 Mar 2015 10:55:00 -0400 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 X-IronPort-AV: E=Sophos;i="5.11,368,1422921600"; d="scan'208";a="241599034" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.210.2; Mon, 9 Mar 2015 10:54:34 -0400 Received: from dt47.uk.xensource.com ([10.80.229.47] helo=dt47.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1YUz4j-00070M-Tm; Mon, 09 Mar 2015 14:54:33 +0000 From: Wei Liu To: Date: Mon, 9 Mar 2015 14:54:33 +0000 Message-ID: <1425912873-21215-1-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: pbonzini@redhat.com, Wei Liu , stefano.stabellini@eu.citrix.com Subject: [Qemu-devel] [PATCH RFC] Makefile.target: prepend $libs_softmmu to $LIBS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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