From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQDkg-0006gt-Ij for qemu-devel@nongnu.org; Tue, 15 Nov 2011 02:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQDkf-00013Y-Be for qemu-devel@nongnu.org; Tue, 15 Nov 2011 02:48:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQDkf-00012J-3e for qemu-devel@nongnu.org; Tue, 15 Nov 2011 02:48:17 -0500 Message-ID: <4EC2193A.7070702@redhat.com> Date: Tue, 15 Nov 2011 09:48:10 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1321284665-19356-1-git-send-email-avi@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.0 v4] configure: build position independent executables across the board, by default List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Blue Swirl , Paul Moore , qemu-devel@nongnu.org On 11/14/2011 06:03 PM, Peter Maydell wrote: > On 14 November 2011 15:31, Avi Kivity wrote: > > @@ -1099,6 +1099,22 @@ for flag in $gcc_flags; do > > fi > > done > > > > +if test "$pie" = "yes" ; then > > + cat > $TMPC << EOF > > +int main(void) { return 0; } > > +EOF > > + if compile_prog "-fPIE -dPIE" "-Wl,-pie"; then > > Surely "-DPIE" ? > gcc complains in the config.log: > cc1: warning: unrecognized gcc debugging option: E Ugh. > > + QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" > > + LDFLAGS="-Wl,-pie $LDFLAGS" > > + if compile_prog "-fPIE -DPIE" "-Wl,-pie -Wl,-z,relro -Wl,-z,now"; then > > + LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" > > + fi > > + else > > + echo "Diabling PIE due missing toolchain support" > > "Disabling". "due to". Maybe I'm developing dyslexia. > Something in this patch is causing problems if you configure > with --target-list=arm-linux-user --static. configure complains: > ./configure: 1159: /tmp/qemu-conf--25989-.exe: not found > > because something about how we've built the test executable for > the endianness test means it compiled successfully but won't > run: > cam-vm-266:maverick:qemu$ file /tmp/qemu-conf--25297-.exe > /tmp/qemu-conf--25297-.exe: ELF 32-bit LSB shared object, Intel 80386, > version 1 (GNU/Linux), dynamically linked (uses shared libs), for > GNU/Linux 2.6.15, not stripped > cam-vm-266:maverick:qemu$ ldd /tmp/qemu-conf--25297-.exe > statically linked > cam-vm-266:maverick:qemu$ /tmp/qemu-conf--25297-.exe > -bash: /tmp/qemu-conf--25297-.exe: No such file or directory > > If you let it go ahead and build the whole arm-linux-user/qemu-arm > binary then that has the same problem: it won't run. > > ...and this is all just on x86-32 hosts! I'll disable PIE on static builds. So we'll be left with PIE enabled by default on x86 dynamic builds, which ought to work, or I'll go crazy. -- error compiling committee.c: too many arguments to function