summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorAvi Kivity2011-11-23 10:24:25 +0100
committerAnthony Liguori2011-11-28 23:20:52 +0100
commit21d4a791da47cf35956102d0b96208e3e595b617 (patch)
tree6bf7dfd326b9e2f5b2e4064aed93a56015a17c9e /configure
parentusb-redir: Don't try to write to the chardev after a close event (diff)
downloadqemu-21d4a791da47cf35956102d0b96208e3e595b617.tar.gz
qemu-21d4a791da47cf35956102d0b96208e3e595b617.tar.xz
qemu-21d4a791da47cf35956102d0b96208e3e595b617.zip
configure: tighten pie toolchain support test for tls variables
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 11 insertions, 1 deletions
diff --git a/configure b/configure
index f033438210..a7caf1e190 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"