workaround clang deficiency affecting thread pointer access on powerpc

based on patch by Richard Pennington, who initially reported the
issue.