In our llvm use case we are observing rare crashes inside MCContext constructor. Apparently they were caused by the non thread safe getenv call. This change handles this problem by moving getenv call into initialisation of a static command line option. It's slightly better then explicit locks and less complicated than adding new constructor argument.
This issue was already discussed sometime ago (see http://lists.llvm.org/pipermail/llvm-dev/2013-May/062367.html) but I haven't found any evidence that it was fixed back then.