[LLVMdev] Why llvm-gcc? Another beginner's question.

Matthijs Kooijman matthijs at stdin.nl
Tue Jun 3 07:55:41 PDT 2008

Hi Hendrik,

> What is the reason for llvm-gcc?  Will regular gcc work (except for the 
> releases that are broken, of course)?  Does llvm in any way depend on 
> features of llvm-gcc instead of gcc?
llvm-gcc is a frontend: It can compile various languages (C, C++ and probably
more) into llvm assembly / bitcode. Regular gcc can only compile into native
machine code, and is not really needed or useful with llvm.

LLVM can work fine without llvm-gcc, but you will have to have some other way
of creating llvm assembly / bitcode, such as writing assembly directly,
writing your own frontend, or using the clang frontend (also developed within
the llvm project).

LLVM does require binutils for assembling (and perhaps also linking?)
executables at the end of the chain. However, for the middle part (optimizing,
codegeneration and I think also linking) llvm is selfsufficient.

> -- might it be that that a compiler that uses llvm can only link with 
> ofher llvm-generated code?
llvm can codegen into normal object files, which can be linked against normal
libraries, also by other linkers. However, any llvm code that is still in
bitcode (LLVM IR) form can only be processed by LLVM of course.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080603/4e102e24/attachment.sig>

More information about the llvm-dev mailing list