[LLVMdev] Compile programs with the LLVM Compiler as a gsoc project
Török Edwin
edwintorok at gmail.com
Sun Mar 30 23:40:44 PDT 2008
Sean Soria wrote:
> On Sun, Mar 30, 2008 at 10:26 AM, Török Edwin <edwintorok at gmail.com
> <mailto:edwintorok at gmail.com>> wrote:
>
> If this tool could be a drop-in wrapper for CC/CXX, it would be
> excellent, since nearly every autotooled package could be tested
> this way.
>
>
> How exactly do can LLVM be used with autotooled packages (with
> -emit-llvm)? I've tried setting CC, CXX, CFLAGS, CXXFLAGS. I usually
> can't get past "./configure" because it tries to compile test programs
> to make sure gcc works. Adding the "-c" option allows it to compile
> but it outputs as filename.o instead of a.out as the script expects.
> Without the "-c" option I get ld errors:
> ld: Unknown command line argument '-m'. Try:
> '/home/ssoria/llvm/gcc/ld --help'
> ld: Unknown command line argument '-dynamic-linker'. Try:
> '/home/ssoria/llvm/gcc/ld --help'
> ld: Unknown command line argument '-emit-llvm'. Try:
> '/home/ssoria/llvm/gcc/ld --help'
> collect2: ld returned 1 exit status
This should work (if you used --program-prefix=llvm-, otherwise just
give the full path to the gcc you built)
CC=llvm-gcc CXX=llvm-g++ ./configure
Note, that llvm-gcc4.x will generate native code, and you won't see the
intermediate IR files.
If you need the IR files, you can try -O4 (but linking doesn't work on
Linux yet in this case), or use a wrapper script (utils/ccc from clang
does the job with little adjustments).
Best regards,
--Edwin
More information about the llvm-dev
mailing list