From a4b51633cfdecf597c247afe028c08b520816590 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 Dec 2013 02:45:10 -0500 Subject: workaround clang deficiency affecting thread pointer access on powerpc based on patch by Richard Pennington, who initially reported the issue. --- arch/powerpc/pthread_arch.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/powerpc/pthread_arch.h') diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h index cb2a70b8..2d1ee43c 100644 --- a/arch/powerpc/pthread_arch.h +++ b/arch/powerpc/pthread_arch.h @@ -1,6 +1,11 @@ static inline struct pthread *__pthread_self() { - register char* tp __asm__("r2"); +#ifdef __clang__ + char *tp; + __asm__ __volatile__ ("mr %0, 2" : "=r"(tp) : : ); +#else + register char *tp __asm__("r2"); +#endif return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); } -- cgit v1.2.1