This is waaay not thread safe. The right way to fix all of this is to implement the *_l functions in newlib, and skip all of this awkward and not-so-correct shim business. For now it makes more sense to just xfail the tests that would otherwise need this. http://reviews.llvm.org/D5418