1
0
mirror of https://gitlab.com/qemu-project/qemu synced 2024-07-08 20:17:27 +00:00

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>
This commit is contained in:
Avi Kivity 2011-11-23 11:24:25 +02:00 committed by Anthony Liguori
parent c1b71a1df6
commit 21d4a791da

12
configure vendored
View File

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