qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1.0 v4] configure: build position independent ex


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 1.0 v4] configure: build position independent executables across the board, by default
Date: Tue, 15 Nov 2011 09:48:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/14/2011 06:03 PM, Peter Maydell wrote:
> On 14 November 2011 15:31, Avi Kivity <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]