Replace __thread TLS with functions which return pointers and macros.