diff --git a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp --- a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp @@ -264,10 +264,13 @@ } }; -DefaultMMapper DefaultMMapperInstance; +DefaultMMapper &getDefaultMMapperInstance() { + static DefaultMMapper Mapper; + return Mapper; +}; } // namespace SectionMemoryManager::SectionMemoryManager(MemoryMapper *MM) - : MMapper(MM ? *MM : DefaultMMapperInstance) {} + : MMapper(MM ? *MM : getDefaultMMapperInstance()) {} } // namespace llvm