[LLVMdev] Byte code libraries and linking
Pertti Kellomäki
pk at cs.tut.fi
Wed Nov 15 02:15:38 PST 2006
As I have explained in another thread, I am in the process of
porting portions of newlib to LLVM. The target system has no
operating system and a custom processor which may be changed from
compilation to compilation.
We intend to use LLVM as the front end and generate target specific
code from LLVM byte code. For various reasons (whole program
optimization being one of them), it would seem to make sense to
do most of linking at the byte code level.
I succesfully built a byte code version of newlib, so I tried to
use it like this:
$ llvm-link hello.bc $NEWLIB/libc.a -o linked.bc
but apparently llvm-link only understands byte code files.
Does it even make sense to try to use llvm-link as a ld replacement
this way? Or am I missing something else that could be used?
The other option is of course to link all of libc into one big
byte code file, and use llvm-link like this:
$ llvm-link hello.bc $NEWLIB/libc.bc -o linked.bc
The only concern here is that this brings in all of libc, but I
suppose it should be easy enough to run dead code elimination on
linked.bc to shake out the unused bits?
--
Pertti
More information about the llvm-dev
mailing list