[llvm] r227414 - [LPM] Try again to appease powerpc64 in its self host. I've been unable

Hal Finkel hfinkel at anl.gov
Wed Jan 28 19:19:17 PST 2015


----- Original Message -----
> From: "Chandler Carruth" <chandlerc at gmail.com>
> To: llvm-commits at cs.uiuc.edu
> Sent: Wednesday, January 28, 2015 8:34:17 PM
> Subject: [llvm] r227414 - [LPM] Try again to appease powerpc64 in its self	host. I've been unable
> 
> Author: chandlerc
> Date: Wed Jan 28 20:34:17 2015
> New Revision: 227414
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=227414&view=rev
> Log:
> [LPM] Try again to appease powerpc64 in its self host. I've been
> unable
> to get a powerpc64 host so that I can reproduce and test this, but it
> only impacts that platform so trying the only other realistic option.
> 
> According to Ulrich, who debugged this initially, initial-exec is
> likely
> to be sufficient for our needs and not subject to this bug. Will
> watch
> the build bots to see.
> 
> If this doesn't work, I'll be forced to cut a really ugly
> pthread-based
> approach into the primary user (our stack trace printing) as that
> user
> cannot use the ThreadLocal implementation due to lifetime issues.

What about if we added -Wl,--no-tls-optimize -Wl,--no-tls-get-addr-optimize to our self-hosting build flags for now?

 -Hal

> 
> Modified:
>     llvm/trunk/include/llvm/Support/Compiler.h
> 
> Modified: llvm/trunk/include/llvm/Support/Compiler.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=227414&r1=227413&r2=227414&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/Compiler.h (original)
> +++ llvm/trunk/include/llvm/Support/Compiler.h Wed Jan 28 20:34:17
> 2015
> @@ -394,11 +394,12 @@
>  #elif defined(__clang__) && defined(__powerpc64__)
>  // Clang, GCC, and all compatible compilers tend to use __thread.
>  But we need
>  // to work aronud a bug in the combination of Clang's compilation of
> -// local-dynamic TLS and the ppc64 linker relocations which we do by
> forcing to
> -// global-dynamic (called in most documents "general dynamic").
> +// global-dynamic and local-dynamic TLS and the ppc64 linker
> relocations which
> +// we do by forcing initial-exec. While that mode isn't strictly
> sufficient for
> +// all possible DSO use cases, it will usually work with glibc.
>  // FIXME: Make this conditional on the Clang version once this is
>  fixed in
>  // top-of-tree.
> -#define LLVM_THREAD_LOCAL __thread
> __attribute__((tls_model("global-dynamic")))
> +#define LLVM_THREAD_LOCAL __thread
> __attribute__((tls_model("initial-exec")))
>  #else
>  #define LLVM_THREAD_LOCAL __thread
>  #endif
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list