[LLVMdev] Compile programs with the LLVM Compiler as a gsoc project

Joachim Durchholz jo at durchholz.org
Sun Mar 30 23:41:57 PDT 2008


Am Montag, den 31.03.2008, 10:04 +0530 schrieb Kumaripaba Miyurusara
Atukorala:

> 1) I thought of taking the gcc compiler and compiling it with llvm
> since it is easier to make test cases to test the system. Is gcc
> compiler already built with llvm?

The frontend of GCC is already part of the LLVM project. It is used
inside of LLVM to compile C++ and C to an intermediate format that the
LLVM infrastructure then takes to machine code.
IOW the frontend is already built, the backend (which generates machine
code) isn't used (and as far as I can tell from a quick look at the
llvm-gcc sources, it was pruned from the sources, too).

>  if so I have the linux kernel as the second option.

The Linux kernel requires some very special precautions.
* It does not link against the standard C runtime (which expects things
like an environment and command-line parameters, stuff that's not
available when booting).
* It requires some tiny but essential bits of assembly for things like virtual memory and scheduling. (I don't know whether LLVM's bitcode files can carry machine code; if yes, this would probably not be a problem.)

Regards,
Jo





More information about the llvm-dev mailing list