Pārlūkot izejas kodu

workaround clang deficiency affecting thread pointer access on powerpc

based on patch by Richard Pennington, who initially reported the
issue.
Rich Felker 11 gadi atpakaļ
vecāks
revīzija
a4b51633cf
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      arch/powerpc/pthread_arch.h

+ 6 - 1
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));
 }