From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoylf-0000tc-LG for qemu-devel@nongnu.org; Thu, 13 Nov 2014 13:05:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoylY-0001dv-OR for qemu-devel@nongnu.org; Thu, 13 Nov 2014 13:05:15 -0500 Received: from fldsmtpe04.verizon.com ([140.108.26.143]:20648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoylY-0001bh-L6 for qemu-devel@nongnu.org; Thu, 13 Nov 2014 13:05:08 -0500 From: Don Slutz Message-ID: <5464F2D1.3040207@terremark.com> Date: Thu, 13 Nov 2014 13:05:05 -0500 MIME-Version: 1.0 References: <20131205142458.27451.98534.malonedeb@gac.canonical.com> <20141113164526.19570.34563.malone@gac.canonical.com> <5464F012.4080703@redhat.com> In-Reply-To: <5464F012.4080703@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Bug 1258168] Re: QEMU fails to build on CentOS 5.10 with --disable-pie reporting "/usr/bin/ld: -f may not be used without -shared " List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , dslutz@verizon.com, qemu-devel No change. LINK qemu-bridge-helper CC qmp-marshal.o lt LINK vscclient /usr/bin/ld: -f may not be used without -shared collect2: ld returned 1 exit status make: *** [vscclient] Error 1 make: *** Waiting for unfinished jobs.... dcs-xen-53:~/qemu/out/bug-1258168> -Don Slutz On 11/13/14 12:53, Paolo Bonzini wrote: > Here is a fixed version. I missed the -rpath /usr/local/lib in > the libtool_prog function: > > diff --git a/configure b/configure > index 47048f0..b7bf30a 100755 > --- a/configure > +++ b/configure > @@ -140,8 +140,10 @@ do_libtool() { > } > > libtool_prog() { > - do_libtool --mode=compile $QEMU_CFLAGS -c -fPIE -DPIE -o $TMPO $TMPC || return $? > - do_libtool --mode=link $LDFLAGS -o $TMPA $TMPL -rpath /usr/local/lib > + local_cflags="$1" > + local_ldflags="$2" > + do_libtool --mode=compile $QEMU_CFLAGS $local_cflags -c -fPIE -DPIE -o $TMPO $TMPC || return $? > + do_libtool --mode=link $LDFLAGS $local_ldflags -o $TMPA $TMPL > } > > # symbolically link $1 to $2. Portable version of "ln -sf". > @@ -1501,13 +1503,16 @@ if test "$stack_protector" != "no"; then > for flag in $gcc_flags; do > # We need to check both a compile and a link, since some compiler > # setups fail only on a .c->.o compile and some only at link time > - if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && > - compile_prog "-Werror $flag" ""; then > - QEMU_CFLAGS="$QEMU_CFLAGS $flag" > - LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag" > - sp_on=1 > - break > + do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC || continue > + compile_prog "-Werror $flag" "" || continue > + if test -n "$libtool"; then > + libtool_prog "-Werror $flag" "-Wc,$flag" || continue > fi > + > + QEMU_CFLAGS="$QEMU_CFLAGS $flag" > + LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag" > + sp_on=1 > + break > done > if test "$stack_protector" = yes; then > if test $sp_on = 0; then > @@ -1608,7 +1613,7 @@ g(unsigned char *buf, int len) > } > > EOF > - if ! libtool_prog; then > + if ! libtool_prog "" "-rpath /usr/local/lib"; then > echo "Disabling libtool due to broken toolchain support" > libtool= > fi