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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080215/19497ab6/attachment.html>
Fernando Magno Quintao Pereira
2008-Feb-15 23:15 UTC
[LLVMdev] llvm-gcc is generating native code
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 > >
On Feb 15, 2008, at 3:15 PM, Fernando Magno Quintao Pereira wrote:> > 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-llvmOr you can pass -O4, which is -O3 + -emit-llvm. -Chris
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/libThe 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>