qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Brad <brad@comstyle.com>
Subject: [Qemu-devel] [PATCH v3 1.0] configure: tighten pie toolchain support test for tls variables
Date: Wed, 23 Nov 2011 11:24:25 +0200	[thread overview]
Message-ID: <1322040265-14530-1-git-send-email-avi@redhat.com> (raw)

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>
---

v3: only check __thread on Linux, where we require it, and where the
    toolchain fails

v2: give tls_var a type; avoids invisible warning

 configure |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 75e1f10..1a2c55f 100755
--- a/configure
+++ b/configure
@@ -1120,7 +1120,17 @@ fi
 
 if test "$pie" != "no" ; then
   cat > $TMPC << EOF
-int main(void) { return 0; }
+
+#ifdef __linux__
+#  define THREAD __thread
+#else
+#  define THREAD
+#endif
+
+static THREAD int 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

             reply	other threads:[~2011-11-23  9:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  9:24 Avi Kivity [this message]
2011-11-23 21:02 ` [Qemu-devel] [PATCH v3 1.0] configure: tighten pie toolchain support test for tls variables Brad
2011-11-28 22:36 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322040265-14530-1-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=brad@comstyle.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).