Hello List, (apparently this list is moderated) Le/On Sun, Nov 07, 2004 at 03:45:41PM -0600, Misha Brukman écrivait/wrote:> On Sun, Nov 07, 2004 at 10:33:09PM +0100, Basile STARYNKEVITCH > wrote:Basile>> I want to try to use LLVM only for JIT only use (generating code in Basile>> memory for x86 and, when available PowerPC [32bits]) If you want to know I am experimenting some JIT generation for a experimental toy functional language [this is only a hobby] and I did write the OcamlJIT (a JIT translator of Ocaml bytecode using GNU lightning)> Cool! FYI, the PowerPC JIT needs work to make it operational, but the > x86 JIT is good to go.> Don't worry about the configure errors at the end, and just run > "make tools-only". That will build all the libraries and LLVM tools, > but not build the runtime libraries (which require llvm-gcc).First, I am extremely confused by the terminology. IMHO, the runtime libraries would include (from my JIT only perspective) 1. all the LLVM libraries required to JIT-generate machine code, and to build a representation of the LLVM instruction sequence or tree. Z. the garbage collection I'm coding for my toy language. So I really can't figure why is the LVM-GCC parser needed here! For me the runtime stuff of LLVM is the stuff I need to JIT (without C parsing) - but I am wrong! what exactluy is the "runtime" and why does it require llvm-gcc (I thought that LLVM is not a bootstrapped language: the compiler is not written in LLVM...) Second trivial question: only I "make tools-only" how can I install the stuff (in the standard /usr/local/ prefix)? Does "sudo make install" is enough? Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net 8, rue de la Faïencerie, 92340 Bourg La Reine, France
On Sun, Nov 07, 2004 at 11:04:58PM +0100, Basile STARYNKEVITCH wrote:> (apparently this list is moderated)Yes, we get too much spam, so it's moderated, but only with regard to spam, nothing else.> Basile>> I want to try to use LLVM only for JIT only use (generating > code in Basile>> memory for x86 and, when available PowerPC [32bits]) > > If you want to know I am experimenting some JIT generation for a > experimental toy functional language [this is only a hobby] and I did > write the OcamlJIT (a JIT translator of Ocaml bytecode using GNU > lightning)Sounds pretty neat.> First, I am extremely confused by the terminology. IMHO, the runtime > libraries would include (from my JIT only perspective) > > 1. all the LLVM libraries required to JIT-generate machine code, and > to build a representation of the LLVM instruction sequence or tree. > > Z. the garbage collection I'm coding for my toy language. > > So I really can't figure why is the LVM-GCC parser needed here!Sorry for the confusion. By 'runtime', I mean 'llvm/runtime' directory, which are C libraries for our purposes (profiling, tracing, a beginning of a garbage-collection library, zlib, etc.). Take a look inside -- you can tell what things are based on their names. The one important thing that the runtime/ directory provies is the crtend.o that is linked to any C/C++ program that LLVM-GCC compiles, but again, that is of no relevance to your project.> For me the runtime stuff of LLVM is the stuff I need to JIT (without C > parsing) - but I am wrong! what exactluy is the "runtime" and why does > it require llvm-gcc (I thought that LLVM is not a bootstrapped > language: the compiler is not written in LLVM...)In your list, (1) is llvm/lib/VMCore and a few others, (2) you provide. We just have a different terminology. Bottom line: you don't need llvm/runtime.> Second trivial question: only I "make tools-only" how can I install > the stuff (in the standard /usr/local/ prefix)? Does "sudo make > install" is enough?That should do it, but to be certain, I would defer that question to one of our Makefile gurus Reid Spencer. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
Le Sun, Nov 07, 2004 at 04:14:19PM -0600, Misha Brukman écrivait/wrote:> On Sun, Nov 07, 2004 at 11:04:58PM +0100, Basile STARYNKEVITCH wrote:Basile>> First, I am extremely confused by the terminology. IMHO, the runtime Basile>> libraries would include (from my JIT only perspective) Basile>> 1. all the LLVM libraries required to JIT-generate machine code, and Basile>> to build a representation of the LLVM instruction sequence or tree. Basile>> Z. the garbage collection I'm coding for my toy language. Basile>> So I really can't figure why is the LVM-GCC parser needed here!> > Sorry for the confusion. By 'runtime', I mean 'llvm/runtime' directory, > > In your list, (1) is llvm/lib/VMCore and a few others, (2) you provide. > We just have a different terminologyI did "make" inside llvm/examples/ and inside llvm/examples/HowToUseJIT/ and expected to get an ELF executable.. But I've only got the 2 Release/HowToUseJIT.[do] files.. But the llvm/examples/HowToUseJIT/HowToUseJIT.cpp has at line 47 a "int main()" function. So I was waiting for an executable which I would be able to run. (FYI, the GNU lightning library provide a tests/ directory which can easily compile a few test stuff, which build plain executables showing simple JIT generation&execution within the same process, and so does libjit).> Bottom line: you don't need llvm/runtime.What are the exact libraries I'll need from LLVM (to JIT generate machine code)? Where are these (I would like the list of all the lib*.{a,so} and all headers <*.h> in /usr/local/ on my Linux/Debian/Sid/x86 system)? How are these supposed to be installed (if possible, I want to avoid llvm-gcc, because I hpave trouble compiling the latest CVS of it, and because I believe I really don't need it)? How can I tell LLVM the address where I want the generated code to go (or how can I get this address, preferably with a "destructor" function to release the memory)? I coded a garbage collector which should garbege generated code... How do I plug my copying GC into LLVM? It has to know about the stack frames, etc... (I mostly need the location inside the stack frames of GC-ed pointers) I'm sorry to ask such basic questions, but the documentation don't help me much (and I am a bit lost in it.. I don't care about any kind of llvm-gcc or llvm-ld, I just want to generate and then run code in memory!) If some kind LLVM person is in charge of LLVM documentation, I am missing a "using LLVM for JIT machine-code generation for dummies" page -which would explain the examples/HowToUseJIT/ and similar- Apparently, JIT is a by-product of LLVM, but it is the main feature that attracts me here... BTW, are there some European LLVM users & developers (working & living in Europe) or is LLVM only a US software? Again, sorry for asking such basic questions... I'm a bit lost in the (intimidating) documentation.... Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net 8, rue de la Faïencerie, 92340 Bourg La Reine, France