qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1.0] configure: tighten pie toolchain support test for tls variables
@ 2011-11-22 12:32 Avi Kivity
  2011-11-22 13:26 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2011-11-22 12:32 UTC (permalink / raw)
  To: Anthony Liguori, qemu-devel; +Cc: Paolo Bonzini, Gerd Hoffmann

Some toolchains don't support pie properly when tls variables are
in use.  Disallow pie when such toolchains are detected.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 configure |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 75e1f10..7e6c640 100755
--- a/configure
+++ b/configure
@@ -1120,7 +1120,10 @@ fi
 
 if test "$pie" != "no" ; then
   cat > $TMPC << EOF
-int main(void) { return 0; }
+
+static __thread tls_var;
+
+int main(void) { return tls_var; }
 EOF
   if compile_prog "-fPIE -DPIE" "-pie"; then
     QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH 1.0] configure: tighten pie toolchain support test for tls variables
  2011-11-22 12:32 [Qemu-devel] [PATCH 1.0] configure: tighten pie toolchain support test for tls variables Avi Kivity
@ 2011-11-22 13:26 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2011-11-22 13:26 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Paolo Bonzini, qemu-devel

On 11/22/11 13:32, Avi Kivity wrote:
> Some toolchains don't support pie properly when tls variables are
> in use.  Disallow pie when such toolchains are detected.
> 
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  configure |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/configure b/configure
> index 75e1f10..7e6c640 100755
> --- a/configure
> +++ b/configure
> @@ -1120,7 +1120,10 @@ fi
>  
>  if test "$pie" != "no" ; then
>    cat > $TMPC << EOF
> -int main(void) { return 0; }
> +
> +static __thread tls_var;
> +
> +int main(void) { return tls_var; }
>  EOF
>    if compile_prog "-fPIE -DPIE" "-pie"; then
>      QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"

Survived testbuild.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-22 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 12:32 [Qemu-devel] [PATCH 1.0] configure: tighten pie toolchain support test for tls variables Avi Kivity
2011-11-22 13:26 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).