John Criswell wrote:> You can compile library code into LLVM bytecode libraries and link them > with gccld. In general, LLVM provides tools equivalent to most of your > compiler tool chain (gccas, gccld, llvm-ar, llvm-nm, etc). You can, for > example, make an archive of LLVM bytecode files. > > The problem, in your case, is that no one has successfully compiled all > of libc into LLVM bytecode yet. Some libc functions are compiled to > LLVM bytecode (see llvm/runtime), but many others are not; for those, we > link against the native libraries after code generation. > > You can try compiling the parts of libc you need to LLVM bytecode, but > be forewarned that it'll be tedious. C libraries (glibc in particular) > seem to be designed to make life difficult for people who want to > compile them.I think to amount of glibc functions I need to support will be limited. We have some compiler experts in our research group, who will be able to help me when I experience serious problems (I think). I think it's worth a shot, atleast until I can really evaluate if the effort is worth it or not. Besides that, I can probably rely on the expierence of some people on this mailinglist? What is the best way to start such an ambitious project? Do I just check which external functions are called in the bytecode I get, and try to support those functions using LLVM code? Why has no-one supported printf yet? Is it that hard (I have no idea really, I'm only asking)? greetings, and thanks already for your replies Kenneth -- Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital (Aaron Levenstein) Kenneth Hoste ELIS - Ghent University kenneth.hoste at elis.ugent.be http://www.elis.ugent.be/~kehoste
On Fri, 14 Jul 2006, Kenneth Hoste wrote:> Besides that, I can probably rely on the expierence of some people on this > mailinglist?You can always ask, but realize you are at the mercy of people's goodwill, so you can't count on anything. In practice, we try to help, but are often very busy.> What is the best way to start such an ambitious project? Do I > just check which external functions are called in the bytecode I get, and try > to support those functions using LLVM code?llvm-dis < foo.bc | grep '^declare' will tell you all the external functions.> Why has no-one supported printf yet? Is it that hard (I have no idea really, > I'm only asking)?No one has needed it. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Chris Lattner wrote:> On Fri, 14 Jul 2006, Kenneth Hoste wrote: >> Besides that, I can probably rely on the expierence of some people on >> this mailinglist? > > You can always ask, but realize you are at the mercy of people's > goodwill, so you can't count on anything. In practice, we try to help, > but are often very busy.I understand, but any help I can get will be usefull I think. And, for what it's worth, my work will help LLVM growing, right? 2 more questions which can get me started: - Is there a particular version of glibc I should start from? llvm/runtime doesn't mention any version numbers (or I must have missed them). - If I'm correct, supporting new glibc functions means adding an implementation for them in llvm/runtime/GCCLibraries/libc/io.c (for example). Currently, only 'puts' is supported there. Only, in my current setup, the runtime libraries seem to be skipped: konijn:~/work/LLVM/bin boegel$ make Makefile:22: Skipping runtime libraries, llvm-gcc 4 detected. Why is that? Can I fix this by changing my configuration?> >> What is the best way to start such an ambitious project? Do I just >> check which external functions are called in the bytecode I get, and >> try to support those functions using LLVM code? > > llvm-dis < foo.bc | grep '^declare' will tell you all the external > functions. >OK, thanks.>> Why has no-one supported printf yet? Is it that hard (I have no idea >> really, I'm only asking)? > > No one has needed it. >Well, I guess other people will be able to benefit from it, if I get it to work that is :) Kenneth -- Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital (Aaron Levenstein) Kenneth Hoste ELIS - Ghent University kenneth.hoste at elis.ugent.be http://www.elis.ugent.be/~kehoste