[LLVMdev] Can we use llvm-gcc to compile large project and generate IR?

gauss gausszhch at gmail.com
Mon Sep 14 01:32:29 PDT 2009


Hi, all.
I have written a pass to do some inter-procedure work.  Then I tried to
apply it to currently existing software.  But I failed to compile most of
them using llvm-gcc.

When I run   * ./configure CC=llvm-gcc CFLAGS="-emit-llvm -c"*,    it
reports "*cannot run C compiled programs*" and so on and then exit.
( I use CFLAGS="-emit-llvm -c" to produce LLVM bitcode so that my pass can
run on it. )

My solution is using the default CC and CFLAGS to *configure*, and before we
*make*, I write a shell script to replace the default gcc. This script will
invoke *llvm-gcc* later and pass arguments "*-emit-llvm -c*" to the
compiler.

However, there still exists many errors when I *make*, many of them are very
strange.

What's wrong here? It confused me a few days.  Can we use llvm-gcc to
compile large project and generate IR?  How?

Thanks!


Gauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090914/dac421ed/attachment.html>


More information about the llvm-dev mailing list