[LLVMdev] llvm-gcc is generating native code

Dale Johannesen dalej at apple.com
Fri Feb 15 16:49:50 PST 2008


On Feb 15, 2008, at 3:05 PM, Kashyap Ashwin wrote:

> 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

The interface of llvm-gcc is like gcc:  by default it compiles as far  
as a.out, and stops earlier with -c or -S.
You need -emit-llvm -c  to get an llvm binary file; -emit-llvm -S  
produces the ASCII form.   The name defaults to *.s or *.o as usual  
for -c and -S, and is changed with -o as usual.

> 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
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

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


More information about the llvm-dev mailing list