[LLVMdev] Re: Still can't compile backend or frontend on, Windows

Chris Lattner sabre at nondot.org
Tue Nov 1 14:54:58 PST 2005


On Tue, 1 Nov 2005, Matthew Bromberg wrote:
>> It is the goal to generate OBJ files directly, though that is not likely to 
>> happen in the near future.  But there are other options that do work today. 
>> The JIT does work, so you can execute programs compiled via LLVM right now. 
>> Additionally, you can generate C code that you can then compile with VC++, 
>> which provides an alternate route to stand-alone executables.

> The JIT compiler is of course of great interest, but I'm also interested in 
> static compilation and in fact this seems to me one of the intriguing 
> features of LLVM, the fact that it can support both static and dynamic 
> languages, with a common optimization infrastructure. (I want my  cake and to 
> eat it too.)

Sure.

> If I wanted just static compilation I could emit C as well, or 
> if I just wanted a JIT compiler I could emit the .NET CLR or Java bytecodes. 
> Just as an aside, how do you support tail calls or more general functional 
> language paradigms with your C backend?  What if I don't ever want to use a 
> call stack for my function arguments, for example?

Not well.  It depends on the C compiler to implement these, which means it 
probably won't happen.

> Pardon me for my woeful ignorance, but currently I presume that on Linux 
> using an X86 CPU you can emit either object code directly or some kind of 
> intermediate ASCII assembly code?  If that is the case, then apparently the 
> only problem is operating system specific calls in the backend of the LLVM 
> compiler.  Also I presume that the JIT compiler really is a JIT compiler and 
> compiles genuine machine readable object code for an x86 processor (among 
> others), that is executed in memory ; as opposed to compiling byte code that 
> is ultimately just interpreted.

Actually it is much simpler than that.  If you are willing to install 
'gas' on your windows box (part of cygwin, for example), you can use our 
native backend, with tail calls etc.  Being able to emit windows .o files 
directly only eliminates the need to have gas installed.

> I suppose therefore that I would be interested in Henrik's notes, at the 
> very least to see how deep the rabbit hole goes, so to speak. It would 
> be at least 2 weeks before I would be able to dig into this in earnest 
> however.

Great, help is certainly appreciated!

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list