[LLVMdev] porting glibc

Francesco Spadini spadini at crhc.uiuc.edu
Sat Mar 8 14:49:01 PST 2003

> Note that compiling glibc with LLVM does not give you a solution to THIS
> problem: you'd still have to write a new backend for your ISA. There is
> currently a Sparc backend and an X86 backend. Depending on how similar
> your architecture is to one or the other, you might be able to leverage
> existing code. Take a look at llvm/lib/Target/{Sparc,X86}, though the
> X86 target codebase is smaller.

Yeah, that's the easy part.  My ISA is going to have a near 1:1 mapping to 
LLVM bytecode.

> Also note that having glibc compiled by LLVM isn't a prerequisite for
> your new ISA, as long as you either emulate the library calls or you
> have it compiled in some other manner for your target architecture.

The nasty thing about this, is that from my experience SPECInt spends a 
considerable amount of time in standard library calls (esp. the memory and 
string manipulation functions).   I think I'll try playing around with glibc 
for a bit.  At worst I'll end up adding a compatibility mode and hand-code 
some of the common simple ones (memcpy, memset, etc.).  Thanks for your help.

Francesco Spadini
spadini at crhc.uiuc.edu

"The universe is full of magical 
things, patiently waiting for our 
wits to grow sharper."
	- Eden Phillpots

More information about the llvm-dev mailing list