chh added a comment. I see. It's probably more a package and license issue. GCC's code is small in https://github.com/gcc-mirror/gcc/blob/master/libgcc/emutls.c Maybe llvm compiler-rt expert can suggest a solution? Repository: rL LLVM http://reviews.llvm.org/D10522