qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/8] tls: require compiler support for __thread


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH 1/8] tls: require compiler support for __thread
Date: Tue, 28 Apr 2015 17:04:57 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jan 13, 2015 at 22:07:19 +0000, Peter Maydell wrote:
> On 13 January 2015 at 20:27, Paolo Bonzini <address@hidden> wrote:
> > On 13/01/2015 21:00, Peter Maydell wrote:
> >> Hmm. That's a chunk of users who are now going to have to
> >> change the way they've been building QEMU. Does configure
> >> at least blow up on the old gcc, or will we just silently
> >> build a non-working QEMU?
> >
> > At least the build, if not configure, should blow up.
> 
> Yeah, it does:
> qemu-coroutine.c:29: error: thread-local storage not supported for this target
> (that's gcc 4.2.1 20070719 on OpenBSD 5.5.)
> 
> As a new requirement it might be polite to make configure
> insist on it rather than failing the build later, maybe.

Just noticed that this patch was eventually dropped.

Would the appended be the missing piece to have this patch finally merged?

Thanks,

                Emilio

commit ad45e590025c1197a7aef5164e1ae174894b0969
Author: Emilio G. Cota <address@hidden>
Date:   Tue Apr 28 16:54:44 2015 -0400

    configure: require __thread support
    
    The codebase doesn't build without __thread support.
    Formalise this requirement by adding a check for it in the
    configure script.
    
    Signed-off-by: Emilio G. Cota <address@hidden>

diff --git a/configure b/configure
index 6969f6f..3d6591f 100755
--- a/configure
+++ b/configure
@@ -1549,6 +1549,17 @@ if test "$static" = "yes" ; then
   fi
 fi
 
+# Unconditional check for compiler __thread support
+  cat > $TMPC << EOF
+static __thread int tls_var;
+int main(void) { return tls_var; }
+EOF
+
+if ! compile_prog "-Werror" "" ; then
+    error_exit "Your compiler does not support the __thread specifier for " \
+       "Thread-Local Storage (TLS). Please upgrade to a version that does."
+fi
+
 if test "$pie" = ""; then
   case "$cpu-$targetos" in
     i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]