From patchwork Mon Aug 3 12:45:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 30506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6D138B6F34 for ; Mon, 3 Aug 2009 22:58:00 +1000 (EST) Received: from localhost ([127.0.0.1]:42014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXx6x-00065L-2g for incoming@patchwork.ozlabs.org; Mon, 03 Aug 2009 08:57:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXwyi-00032m-Vf for qemu-devel@nongnu.org; Mon, 03 Aug 2009 08:49:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXwyd-0002zZ-5W for qemu-devel@nongnu.org; Mon, 03 Aug 2009 08:49:23 -0400 Received: from [199.232.76.173] (port=51636 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXwyc-0002zN-SE for qemu-devel@nongnu.org; Mon, 03 Aug 2009 08:49:18 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXwyb-0006pW-Un for qemu-devel@nongnu.org; Mon, 03 Aug 2009 08:49:18 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n73CnHT7006352; Mon, 3 Aug 2009 08:49:17 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n73CnGYn025930; Mon, 3 Aug 2009 08:49:16 -0400 Received: from localhost.localdomain (vpn-12-117.rdu.redhat.com [10.11.12.117]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n73Cn8M9009715; Mon, 3 Aug 2009 08:49:15 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 3 Aug 2009 14:45:56 +0200 Message-Id: <0c573a333609b380bd43d83752835b3facb69d7d.1249301360.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 05/81] move check_linker_flags sooner than starting of printing variables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- configure | 64 +++++++++++++++++++++++++++++++----------------------------- 1 files changed, 33 insertions(+), 31 deletions(-) diff --git a/configure b/configure index ebec8d6..2594bb2 100755 --- a/configure +++ b/configure @@ -1394,6 +1394,37 @@ if test "$rt" = "yes" ; then CLOCKLIBS="-lrt" fi +# Determine what linker flags to use to force archive inclusion +check_linker_flags() +{ + w2= + if test "$2" ; then + w2=-Wl,$2 + fi + $cc $ARCH_CFLAGS -o $TMPE $OS_CFLAGS $TMPC -Wl,$1 ${w2} >/dev/null 2>/dev/null +} + +cat > $TMPC << EOF +int main(void) { } +EOF +if check_linker_flags --whole-archive --no-whole-archive ; then + # GNU ld + arlibs_begin="-Wl,--whole-archive" + arlibs_end="-Wl,--no-whole-archive" +elif check_linker_flags -z,allextract -z,defaultextract ; then + # Solaris ld + arlibs_begin"=-Wl,-z,allextract" + arlibs_end="-Wl,-z,defaultextract" +elif check_linker_flags -all_load ; then + # Mac OS X + arlibs_begin="-all_load" + arlibs_end="" +else + echo "Error: your linker does not support --whole-archive or -z." + echo "Please report to qemu-devel@nongnu.org" + exit 1 +fi + if test "$mingw32" = "yes" ; then if test -z "$prefix" ; then prefix="c:\\\\Program Files\\\\Qemu" @@ -1702,37 +1733,6 @@ bsd) ;; esac -# Determine what linker flags to use to force archive inclusion -check_linker_flags() -{ - w2= - if test "$2" ; then - w2=-Wl,$2 - fi - $cc $ARCH_CFLAGS -o $TMPE $OS_CFLAGS $TMPC -Wl,$1 ${w2} >/dev/null 2>/dev/null -} - -cat > $TMPC << EOF -int main(void) { } -EOF -if check_linker_flags --whole-archive --no-whole-archive ; then - # GNU ld - echo "ARLIBS_BEGIN=-Wl,--whole-archive" >> $config_host_mak - echo "ARLIBS_END=-Wl,--no-whole-archive" >> $config_host_mak -elif check_linker_flags -z,allextract -z,defaultextract ; then - # Solaris ld - echo "ARLIBS_BEGIN=-Wl,-z,allextract" >> $config_host_mak - echo "ARLIBS_END=-Wl,-z,defaultextract" >> $config_host_mak -elif check_linker_flags -all_load ; then - # Mac OS X - echo "ARLIBS_BEGIN=-all_load" >> $config_host_mak - echo "ARLIBS_END=" >> $config_host_mak -else - echo "Error: your linker does not support --whole-archive or -z." - echo "Please report to qemu-devel@nongnu.org" - exit 1 -fi - tools= if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then tools="qemu-img\$(EXESUF) $tools" @@ -1772,6 +1772,8 @@ echo "OBJCOPY=$objcopy" >> $config_host_mak echo "LD=$ld" >> $config_host_mak echo "CFLAGS=$CFLAGS $OS_CFLAGS $ARCH_CFLAGS $EXTRA_CFLAGS" >> $config_host_mak echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $ARCH_LDFLAGS $EXTRA_LDFLAGS" >> $config_host_mak +echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak +echo "ARLIBS_END=$arlibs_end" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak echo "PTHREADLIBS=$PTHREADLIBS" >> $config_host_mak echo "CLOCKLIBS=$CLOCKLIBS" >> $config_host_mak