Can't build OSL with llvm 3.5(svn build)
Error in the llvm_util.cpp. Whether it is possible to build the project without using llvm?
In file included from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:70:0: /usr/local/include/llvm/PassManager.h:34:15: error: ‘PassManager’ is already declared in this scope using legacy::PassManager; ^ /usr/local/include/llvm/PassManager.h:35:15: error: ‘FunctionPassManager’ is already declared in this scope using legacy::FunctionPassManager; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t* OSL::pvt::OSL_Dummy_JITMemoryManager::startExceptionTable(const llvm::Function_, uintptr_t&)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:180:20: error: ‘class llvm::JITMemoryManager’ has no member named ‘startExceptionTable’ return mm->startExceptionTable (F, ActualSize); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual void OSL::pvt::OSL_Dummy_JITMemoryManager::endExceptionTable(const llvm::Function_, uint8_t_, uint8_t_, uint8_t_)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:184:13: error: ‘class llvm::JITMemoryManager’ has no member named ‘endExceptionTable’ mm->endExceptionTable (F, TableStart, TableEnd, FrameRegister); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t_ OSL::pvt::OSL_Dummy_JITMemoryManager::allocateCodeSection(uintptr_t, unsigned int, unsigned int)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:211:66: error: no matching function for call to ‘llvm::JITMemoryManager::allocateCodeSection(uintptr_t&, unsigned int&, unsigned int&)’ return mm->allocateCodeSection(Size, Alignment, SectionID); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:211:66: note: candidate is: In file included from /usr/local/include/llvm/ExecutionEngine/RuntimeDyld.h:19:0, from /usr/local/include/llvm/ExecutionEngine/JITMemoryManager.h:13, from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:73: /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:44:20: note: virtual uint8_t* llvm::RTDyldMemoryManager::allocateCodeSection(uintptr_t, unsigned int, unsigned int, llvm::StringRef) virtual uint8_t allocateCodeSection( ^ /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:44:20: note: candidate expects 4 arguments, 3 provided /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t OSL::pvt::OSL_Dummy_JITMemoryManager::allocateDataSection(uintptr_t, unsigned int, unsigned int, bool)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:216:78: error: no matching function for call to ‘llvm::JITMemoryManager::allocateDataSection(uintptr_t&, unsigned int&, unsigned int&, bool&)’ return mm->allocateDataSection(Size, Alignment, SectionID, IsReadOnly); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:216:78: note: candidate is: In file included from /usr/local/include/llvm/ExecutionEngine/RuntimeDyld.h:19:0, from /usr/local/include/llvm/ExecutionEngine/JITMemoryManager.h:13, from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:73: /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:51:20: note: virtual uint8_t* llvm::RTDyldMemoryManager::allocateDataSection(uintptr_t, unsigned int, unsigned int, llvm::StringRef, bool) virtual uint8_t allocateDataSection( ^ /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:51:20: note: candidate expects 5 arguments, 4 provided /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual bool OSL::pvt::OSL_Dummy_JITMemoryManager::applyPermissions(std::string)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:219:20: error: ‘class llvm::JITMemoryManager’ has no member named ‘applyPermissions’ return mm->applyPermissions(ErrMsg); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In constructor ‘OSL::pvt::LLVM_Util::LLVM_Util()’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:257:71: error: cannot allocate an object of abstract type ‘OSL::pvt::OSL_Dummy_JITMemoryManager’ m_llvm_jitmm = new OSL_Dummy_JITMemoryManager(m_thread->llvm_jitmm); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:146:7: note: because the following virtual functions are pure within ‘OSL::pvt::OSL_Dummy_JITMemoryManager’: class OSL_Dummy_JITMemoryManager : public llvm::JITMemoryManager { ^ In file included from /usr/local/include/llvm/ExecutionEngine/RuntimeDyld.h:19:0, from /usr/local/include/llvm/ExecutionEngine/JITMemoryManager.h:13, from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:73: /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:44:20: note: virtual uint8_t* llvm::RTDyldMemoryManager::allocateCodeSection(uintptr_t, unsigned int, unsigned int, llvm::StringRef) virtual uint8_t allocateCodeSection( ^ /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:51:20: note: virtual uint8_t llvm::RTDyldMemoryManager::allocateDataSection(uintptr_t, unsigned int, unsigned int, llvm::StringRef, bool) virtual uint8_t allocateDataSection( ^ /usr/local/include/llvm/ExecutionEngine/RTDyldMemoryManager.h:103:16: note: virtual bool llvm::RTDyldMemoryManager::finalizeMemory(std::string) virtual bool finalizeMemory(std::string ErrMsg = 0) = 0; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In destructor ‘OSL::pvt::LLVM_Util::~LLVM_Util()’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:292:12: warning: possible problem detected in invocation of delete operator: [enabled by default] delete m_llvm_passes; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:292:12: warning: invalid use of incomplete type ‘class llvm::PassManager’ [enabled by default] In file included from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:33:0: /home/maxis11/projects/OpenShadingLanguage/src/include/llvm_util.h:51:9: warning: forward declaration of ‘class llvm::PassManager’ [enabled by default] class PassManager; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:292:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined delete m_llvm_passes; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:293:12: warning: possible problem detected in invocation of delete operator: [enabled by default] delete m_llvm_func_passes; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:293:12: warning: invalid use of incomplete type ‘class llvm::FunctionPassManager’ [enabled by default] In file included from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:33:0: /home/maxis11/projects/OpenShadingLanguage/src/include/llvm_util.h:45:9: warning: forward declaration of ‘class llvm::FunctionPassManager’ [enabled by default] class FunctionPassManager; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:293:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined delete m_llvm_func_passes; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In static member function ‘static void OSL::pvt::LLVM_Util::SetupLLVM()’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:310:5: error: ‘DisablePrettyStackTrace’ is not a member of ‘llvm’ llvm::DisablePrettyStackTrace = true; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘void OSL::pvt::LLVM_Util::setup_optimization_passes(int)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:415:24: error: cannot convert ‘llvm::legacy::FunctionPassManager’ to ‘llvm::FunctionPassManager_’ in assignment m_llvm_func_passes = new llvm::FunctionPassManager(module()); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:416:56: error: invalid initialization of reference of type ‘llvm::legacy::FunctionPassManager&’ from expression of type ‘llvm::FunctionPassManager’ llvm::FunctionPassManager &fpm (m_llvm_func_passes); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:425:19: error: cannot convert ‘llvm::legacy::PassManager’ to ‘llvm::PassManager_’ in assignment m_llvm_passes = new llvm::PassManager; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:426:46: error: invalid initialization of reference of type ‘llvm::legacy::PassManager&’ from expression of type ‘llvm::PassManager’ llvm::PassManager &passes (m_llvm_passes); ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘void OSL::pvt::LLVM_Util::do_optimize()’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:485:18: error: invalid use of incomplete type ‘class llvm::PassManager’ m_llvm_passes->run (module()); ^ In file included from /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:33:0: /home/maxis11/projects/OpenShadingLanguage/src/include/llvm_util.h:51:9: error: forward declaration of ‘class llvm::PassManager’ class PassManager; ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t* OSL::pvt::OSL_Dummy_JITMemoryManager::startExceptionTable(const llvm::Function, uintptr_t&)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:181:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t OSL::pvt::OSL_Dummy_JITMemoryManager::allocateCodeSection(uintptr_t, unsigned int, unsigned int)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:212:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual uint8_t* OSL::pvt::OSL_Dummy_JITMemoryManager::allocateDataSection(uintptr_t, unsigned int, unsigned int, bool)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:217:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp: In member function ‘virtual bool OSL::pvt::OSL_Dummy_JITMemoryManager::applyPermissions(std::string*)’: /home/maxis11/projects/OpenShadingLanguage/src/liboslexec/llvm_util.cpp:220:5: warning: control reaches end of non-void function [-Wreturn-type] }
It's not quite working with LLVM 3.4, either, but it turns out I'm working on getting that fixed right now!
Stay tuned, I am literally already working on this today.
I think that pull request #320 makes it work with LLVM 3.4. Probably 3.5svn as well, you should pull that patch and give it a try on your end.
And now [ 78%] Built target oslc [ 79%] Generating ubersurface.oso Illegal instruction (core dumped)
Closing, I use OSL with LLVM 3.5 all the time, so this has obviously been fixed.