[LLVMdev] n00b question: From module/bitcode to Mach-O dylib file directly?

Luke Evans luke at eversosoft.com
Sun Mar 15 19:54:53 PDT 2009


> Aaah. Wasn't quite sure what you were doing here. I'm not positive
> what llvm can emit via the writers (there's support for all parts of
> the file format), but it could be extended to write one out. I'm just
> not quite sure why :)
>
> -eric

Well, ultimately I'm curious about what it would take to port a JVM  
based language (http://openquark.org) to LLVM.
A main motivator though is language/library/platform integration on  
the Mac (Cocoa, Objective-C, autozone).  I'm not too interested in a  
JIT at this point, but rather native code generation.

So far I can see a MachOWriter (with an "AddMachOWriter" in  
FileWriters.h) and it looks like I get to pass an appropriate  
TargetMachine to this.
I'm wondering if this is expected to be sufficient (added to a pass  
manager) to be able to output a library on the Mac - whether or not it  
actually works.

I only picked LLVM up yesterday, so I'm still trying to understand how  
the parts work together.  With my current lack of orientation I have  
very little
intuition as to whether I'm on the right track, and if it fails, how  
close (or otherwise) I might have been to getting something going.  So  
I suppose I've
been looking for hints at the vague 'shape' of the code I would expect  
to connect together to get the output I want, and while there are some  
nice samples for some parts of LLVM, I haven't found much to help  
learn how to emit native .o or .dylib (assuming this is possible).

In the meantime I'll spend some time trying to bang some of the  
aforementioned pieces together and see if I can get it to do anything  
interesting with a minimal module.

Thanks.

-- lwe






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090315/4b6d0655/attachment.html>


More information about the llvm-dev mailing list