projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4e10e3
)
workaround clang deficiency affecting thread pointer access on powerpc
author
Rich Felker
<dalias@aerifal.cx>
Mon, 2 Dec 2013 07:45:10 +0000
(
02:45
-0500)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 2 Dec 2013 07:45:10 +0000
(
02:45
-0500)
based on patch by Richard Pennington, who initially reported the
issue.
arch/powerpc/pthread_arch.h
patch
|
blob
|
history
diff --git
a/arch/powerpc/pthread_arch.h
b/arch/powerpc/pthread_arch.h
index
cb2a70b
..
2d1ee43
100644
(file)
--- 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));
}