2008/12/30 srs <span dir="ltr"><<a href="mailto:skaflotten@gmail.com">skaflotten@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Óscar Fuentes wrote:<br>
> srs <<a href="mailto:skaflotten@gmail.com">skaflotten@gmail.com</a>> writes:<br>
><br>
><br>
>>>> While testing my compiler on win32 in JIT mode, I ran into a couple of<br>
>>>> issues:<br>
>>>><br>
>>>> 1. I linked the compiler with the lib files resulting from the cmake<br>
>>>> created <a href="http://VS.NET" target="_blank">VS.NET</a> build. While everything built just fine, the<br>
>>>> ExecutionEngine::create call always returned NULL. The fix was to also<br>
>>>> link with JIT.obj (thanks aKor for pointing me in the right direction).<br>
>>>> I would have thought that linking with LLVMJIT.lib should suffice... a<br>
>>>> VC++ linker issue?<br>
>>>><br>
>>>><br>
>>> Try adding this to the link command of your executable:<br>
>>><br>
>>> /INCLUDE:_X86TargetMachineModule<br>
>>><br>
>>> I should document this somehow.<br>
>>><br>
>> Yeah, this is necessary, but not sufficient. I also had to link with<br>
>> ExecutionEngineBindings.obj (not JIT.obj as first stated)<br>
>><br>
><br>
> So you are using the C bindings. Okay, could someone advise what to do<br>
> here? Something like the _X86TargetMachineModule trick on<br>
> lib/Target/X86/X86TargetMachine.cpp line 26, but on<br>
> lib/ExecutionEngine/ExecutionEngineBindings.cpp?<br>
><br>
> Why is not the linker automatically pulling that code? If you are using<br>
> the C bindings, I suppose that your executable refers to the functions<br>
> defined on ExecutionEngineBindings.cpp. It is not the same case as<br>
> X86TargetMachine.cpp, which has a self-registering static C++ object and<br>
> nothing refers to it from the user's code<br>
<br>
</div>I'm actually not using C bindings; I'm using the C++ API directly. I<br>
have no idea why I have to link that object file.</blockquote><div><br>Would either of you be willing to prepare a patch for this document once you've settled on the proper way to get JIT to work on Visual Studio?<br>
<br><a href="http://llvm.org/docs/GettingStartedVS.html">http://llvm.org/docs/GettingStartedVS.html</a><br></div></div>