diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -365,6 +365,7 @@ # FIXME: CMAKE_SIZEOF_VOID_P is still 8 add_definitions(-D_LARGEFILE_SOURCE) add_definitions(-D_FILE_OFFSET_BITS=64) + add_definitions(-DLLVM_BUILD_32_BITS) endif( LLVM_BUILD_32_BITS ) endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -148,6 +148,10 @@ } case Triple::x86_64: { +#if defined(LLVM_BUILD_32_BITS) + typedef orc::LocalJITCompileCallbackManager CCMgrT; + return CCMgrT::Create(ES, ErrorHandlerAddress); +#else if (T.getOS() == Triple::OSType::Win32) { typedef orc::LocalJITCompileCallbackManager CCMgrT; return CCMgrT::Create(ES, ErrorHandlerAddress); @@ -155,8 +159,8 @@ typedef orc::LocalJITCompileCallbackManager CCMgrT; return CCMgrT::Create(ES, ErrorHandlerAddress); } +#endif } - } } @@ -202,6 +206,11 @@ }; case Triple::x86_64: +#if defined(LLVM_BUILD_32_BITS) + return []() { + return std::make_unique>(); + }; +#else if (T.getOS() == Triple::OSType::Win32) { return [](){ return std::make_unique< @@ -213,8 +222,8 @@ orc::LocalIndirectStubsManager>(); }; } - - } +#endif + } } Constant* createIRTypedAddress(FunctionType &FT, JITTargetAddress Addr) { diff --git a/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp b/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp --- a/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp +++ b/llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp @@ -132,12 +132,16 @@ return LocalLazyCallThroughManager::Create(ES, ErrorHandlerAddr); case Triple::x86_64: +#if defined(LLVM_BUILD_32_BITS) + return LocalLazyCallThroughManager::Create(ES, ErrorHandlerAddr); +#else if (T.getOS() == Triple::OSType::Win32) return LocalLazyCallThroughManager::Create( ES, ErrorHandlerAddr); else return LocalLazyCallThroughManager::Create( ES, ErrorHandlerAddr); +#endif } }