Hi,<div><div><br></div><div>I've been writing a 80's era-flavor of QuickBASIC compiler based on LLVM, and it's come surprisingly far very quickly, LLVM is working great. GOSUB's, GOTO's, FIELD statements.</div>
</div><div>I'm using Visual Studio 2010.</div><div>Here's my setup: I use LLVM to turn my AST into code, which, during debugging I then execute natively using "getPointerToFunction" and the runtime library it uses is a .lib in my VS2010 project that it calls into.</div>
<div>Then, to produce an EXE, I use addPassesToEmitFile to produce an .OBJ file for the native machine (x86 windows), which I then link with my runtime library using the Visual Studio linker:</div><div>   </div><div><div>
  link.exe test.bas.obj debug\BPRuntime.lib kernel32.lib /subsystem:console</div></div><div><br></div><div>Which produces a native executable that executes just fine under Windows.</div><div><br></div><div>All of that works great.</div>
<div><br></div><div>What I can't figure out, even after LOTS of searching, is how to replace that with a LLVM linker or some other linker so that I can give out my compiler and people could use it to make EXE files.  I found similar posts and questions but no good answers, and it seems that some of this (an LLVM linker) is in flux.</div>
<div><br></div><div>Or, am I going about this wrong?   Should I be generating bitcode and making my runtime lib be bitcode and then link them using LLVM tools?</div><div><br></div><div>Thanks!</div><div><br></div><div><br>
</div><div><br></div><div><br></div>