From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQF7A-0001Ei-AI for qemu-devel@nongnu.org; Tue, 15 Nov 2011 04:15:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQF70-0006Qp-IS for qemu-devel@nongnu.org; Tue, 15 Nov 2011 04:15:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQF70-0006Qj-7m for qemu-devel@nongnu.org; Tue, 15 Nov 2011 04:15:26 -0500 Message-ID: <4EC22DA7.1030502@redhat.com> Date: Tue, 15 Nov 2011 11:15:19 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1321344044-21028-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 v5 1.0] configure: build position independent executables across for x86 hosts 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/15/2011 11:10 AM, Peter Maydell wrote: > On 15 November 2011 08:00, Avi Kivity wrote: > > > @@ -1099,6 +1099,37 @@ for flag in $gcc_flags; do > > fi > > done > > > > +if test "$pie" = "yes" -a "$static" = "yes" ; then > > + echo "static and pie are mutually incompatible" > > + exit 1 > > +fi > > The -a operator to test has been marked obsolescent in > POSIX -- please don't use it in new code. (Use > if test "$pie" = yes && test "$static" = yes; then ) Okay. For 1.1, I'll convert this script to python. > > +if test "$pie" = "yes" ; then > > + cat > $TMPC << EOF > > +int main(void) { return 0; } > > +EOF > > + if compile_prog "-fPIE -DPIE" "-Wl,-pie"; then > > + 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" > > Why does this second compile test put -fPIE -DPIE into > its local cflags and -Wl,-pie into its local ldflags > when we just put them into the global cflags/ldflags? Ah, I didn't realize compile_prog considered those. Will make parallelizing it harder. Will fix. > > + fi > > + else > > + echo "Disabling PIE due to missing toolchain support" > > + pie="no" > > This means that if the user explicitly asked for PIE (with > --enable-pie") we will carry on even if we couldn't do it. > Usually for configure if the user asked for something then > not providing it is a fatal error. Yeah. -- error compiling committee.c: too many arguments to function