gauss
2009-Sep-14 08:32 UTC
[LLVMdev] Can we use llvm-gcc to compile large project and generate IR?
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>
Andrew Lenharth
2009-Sep-14 14:17 UTC
[LLVMdev] Can we use llvm-gcc to compile large project and generate IR?
On Mon, Sep 14, 2009 at 3:32 AM, gauss <gausszhch at gmail.com> wrote:> 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. )Try dropping the -c and try again. The makefiles for the project should add -c, not the CFLAGS passed in. Andrew