>> While testing my compiler on win32 in JIT mode, I ran into a couple of >> issues: >> >> 1. I linked the compiler with the lib files resulting from the cmake >> created VS.NET build. While everything built just fine, the >> ExecutionEngine::create call always returned NULL. The fix was to also >> link with JIT.obj (thanks aKor for pointing me in the right direction). >> I would have thought that linking with LLVMJIT.lib should suffice... a >> VC++ linker issue? >> > > Try adding this to the link command of your executable: > > /INCLUDE:_X86TargetMachineModule > > I should document this somehow. >Yeah, this is necessary, but not sufficient. I also had to link with ExecutionEngineBindings.obj (not JIT.obj as first stated) /Stein Roger
Óscar Fuentes
2008-Dec-31 01:53 UTC
[LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
srs <skaflotten at gmail.com> writes:>>> While testing my compiler on win32 in JIT mode, I ran into a couple of >>> issues: >>> >>> 1. I linked the compiler with the lib files resulting from the cmake >>> created VS.NET build. While everything built just fine, the >>> ExecutionEngine::create call always returned NULL. The fix was to also >>> link with JIT.obj (thanks aKor for pointing me in the right direction). >>> I would have thought that linking with LLVMJIT.lib should suffice... a >>> VC++ linker issue? >>> >> >> Try adding this to the link command of your executable: >> >> /INCLUDE:_X86TargetMachineModule >> >> I should document this somehow. > > Yeah, this is necessary, but not sufficient. I also had to link with > ExecutionEngineBindings.obj (not JIT.obj as first stated)So you are using the C bindings. Okay, could someone advise what to do here? Something like the _X86TargetMachineModule trick on lib/Target/X86/X86TargetMachine.cpp line 26, but on lib/ExecutionEngine/ExecutionEngineBindings.cpp? Why is not the linker automatically pulling that code? If you are using the C bindings, I suppose that your executable refers to the functions defined on ExecutionEngineBindings.cpp. It is not the same case as X86TargetMachine.cpp, which has a self-registering static C++ object and nothing refers to it from the user's code. -- Oscar
Óscar Fuentes wrote:> srs <skaflotten at gmail.com> writes: > > >>>> While testing my compiler on win32 in JIT mode, I ran into a couple of >>>> issues: >>>> >>>> 1. I linked the compiler with the lib files resulting from the cmake >>>> created VS.NET build. While everything built just fine, the >>>> ExecutionEngine::create call always returned NULL. The fix was to also >>>> link with JIT.obj (thanks aKor for pointing me in the right direction). >>>> I would have thought that linking with LLVMJIT.lib should suffice... a >>>> VC++ linker issue? >>>> >>>> >>> Try adding this to the link command of your executable: >>> >>> /INCLUDE:_X86TargetMachineModule >>> >>> I should document this somehow. >>> >> Yeah, this is necessary, but not sufficient. I also had to link with >> ExecutionEngineBindings.obj (not JIT.obj as first stated) >> > > So you are using the C bindings. Okay, could someone advise what to do > here? Something like the _X86TargetMachineModule trick on > lib/Target/X86/X86TargetMachine.cpp line 26, but on > lib/ExecutionEngine/ExecutionEngineBindings.cpp? > > Why is not the linker automatically pulling that code? If you are using > the C bindings, I suppose that your executable refers to the functions > defined on ExecutionEngineBindings.cpp. It is not the same case as > X86TargetMachine.cpp, which has a self-registering static C++ object and > nothing refers to it from the user's codeI'm actually not using C bindings; I'm using the C++ API directly. I have no idea why I have to link that object file. /Stein Roger
Reasonably Related Threads
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
- [LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?