[LLVMdev] llvm-gcc is generating native code

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Fri Feb 15 15:15:33 PST 2008


Hi, Ashwin,

     I think what you want is to add -emit-llvm after llvm-gcc, like:

$> llvm-gcc foo.c -o foo.bc -c -emit-llvm

Fernando

> Hello,
>
> I downloaded llvm-gcc4.2-2.2.source.tar.gz and followed instructions in
> README.LLVM, I used this to configure it:
>
> ../configure --prefix=/opt/llvm --enable-threads --disable-nls
> --enable-languages=c,c++ --enable-sjlj-exceptions
> --enable-llvm=/home/kashyapa/llvm-2.2 --program-prefix=llvm-
> --disable-bootstrap
>
>
>
> I have already installed llvm-2.2 in /opt/llvm.
>
> The compilation goes thru fine. /opt/llvm/bin/llvm-gcc -v, prints this:
>
>
>
> Using built-in specs.
>
> Target: i686-pc-linux-gnu
>
> Configured with: ../configure --prefix=/opt/llvm --enable-threads
> --disable-nls --disable-shared --enable-languages=c,c++
> --enable-sjlj-exceptions --enable-llvm=/opt/llvm/ --program-prefix=llvm-
> --disable-multilib --disable-bootstrap : (reconfigured) ../configure
> --prefix=/opt/llvm --enable-threads --disable-nls --disable-shared
> --enable-languages=c,c++ --enable-sjlj-exceptions
> --enable-llvm=/home/kashyapa/llvm-2.2 --program-prefix=llvm-
> --disable-multilib --disable-bootstrap
>
> Thread model: posix
>
> gcc version 4.2.1 (Based on Apple Inc. build 5546) (LLVM build)
>
>
>
> When I compile using this compiler, I do not get a *.bc file. Instead
> the binary generated seems to be a i386 binary. I also made sure
> /opt/llvm/bin is in path and LD_LIBRARY_PATH=/opt/llvm/lib
>
>
>
> I am using Ubuntu and have also uninstalled the stock (old v1.8, but
> generates *.bc correctly) llvm that is shipped.
>
>
>
> Is there anything I missed?
>
>
>
> Thanks,
>
> Ashwin
>
>



More information about the llvm-dev mailing list