mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
workaround clang deficiency affecting thread pointer access on powerpc
based on patch by Richard Pennington, who initially reported the issue.
This commit is contained in:
parent
a4e10e304d
commit
a4b51633cf
@ -1,6 +1,11 @@
|
|||||||
static inline struct pthread *__pthread_self()
|
static inline struct pthread *__pthread_self()
|
||||||
{
|
{
|
||||||
|
#ifdef __clang__
|
||||||
|
char *tp;
|
||||||
|
__asm__ __volatile__ ("mr %0, 2" : "=r"(tp) : : );
|
||||||
|
#else
|
||||||
register char *tp __asm__("r2");
|
register char *tp __asm__("r2");
|
||||||
|
#endif
|
||||||
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
|
return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user