diff mbox

[1.0] configure: tighten pie toolchain support test for tls variables

Message ID 1321965139-31265-1-git-send-email-avi@redhat.com
State New
Headers show

Commit Message

Avi Kivity Nov. 22, 2011, 12:32 p.m. UTC
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(-)

Comments

Gerd Hoffmann Nov. 22, 2011, 1:26 p.m. UTC | #1
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
diff mbox

Patch

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"