Hi! I'm trying to run "llc" tool on files from "test" subdirectory of LLVM root. I compile source files with the following line: llvm-gcc -c -ocompiled.o ackermann.c Then I run llc like the following: llc compiled.o which outputs llc: bytecode didn't read correctly (I mean, I try it with different options but even the default ones aint working) My llvm-gcc version is Using built-in specs. Target: i686-pc-cygwin Configured with: ../src/configure --prefix=/llvm-gcc/install --enable-llvm=/llvm /obj --enable-languages=c,c++ --disable-threads --enable-checking Thread model: single gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5400) and LLVM version (as llc gives it) Low Level Virtual Machine (http://llvm.org/): llvm version 1.9cvs DEBUG build with assertions. I use cygwin. Thanks a lot for help. Tony. P.S. compiled.o from ackermann.c is attached. -- Nae king! Nae quin! Nae laird! Nae master! We willnae be fooled again! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060820/c8041d8d/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: compiled.o Type: application/octet-stream Size: 816 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060820/c8041d8d/attachment.o>
Anton Vayvod
2006-Aug-20 16:32 UTC
[LLVMdev] Re: bytecode didn't read correctly under cygwin
Sorry, these are my own test sources. So I attached ackerman.c to this letter. -- Nae king! Nae quin! Nae laird! Nae master! We willnae be fooled again! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060820/2b668f55/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: ackermann.c Type: application/octet-stream Size: 477 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060820/2b668f55/attachment.obj>
The 4.0 compiler produces a native .o by default. If you want the byte code file then you should; llvm-gcc -emit-llvm -c -o compiled.o ackermann.c Cheers, -- Jim On 20-Aug-06, at 1:26 PM, Anton Vayvod wrote:> Hi! > > I'm trying to run "llc" tool on files from "test" subdirectory of > LLVM root. I compile source files with the following line: > > llvm-gcc -c -ocompiled.o ackermann.c > > Then I run llc like the following: > > llc compiled.o > > which outputs > > llc: bytecode didn't read correctly > (I mean, I try it with different options but even the default ones > aint working) > > My llvm-gcc version is > > Using built-in specs. > Target: i686-pc-cygwin > Configured with: ../src/configure --prefix=/llvm-gcc/install -- > enable-llvm=/llvm > /obj --enable-languages=c,c++ --disable-threads --enable-checking > Thread model: single > gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5400) > > and LLVM version (as llc gives it) > > Low Level Virtual Machine (http://llvm.org/): > llvm version 1.9cvs > DEBUG build with assertions. > > I use cygwin. > > Thanks a lot for help. > > Tony. > > P.S. compiled.o from ackermann.c is attached. > > -- > Nae king! Nae quin! Nae laird! Nae master! We willnae be fooled again! > <compiled.o> > _______________________________________________ > 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/20060820/0d42833f/attachment.html>
Tony, By default, llvm-gcc4 does not produce bytecode, it produces a native object file, just like GCC does. So, if you try to pass it to llc, it is obviously going to report problems with the bytecode. Either skip the llc step or use the -emit-llvm option: llvm-gcc -c -emit-llvm -o compiled.o ackermann.c llc compiled.o -o compiled.s Reid. On Sun, 2006-08-20 at 20:26 +0400, Anton Vayvod wrote:> Hi! > > I'm trying to run "llc" tool on files from "test" subdirectory of LLVM > root. I compile source files with the following line: > > llvm-gcc -c -ocompiled.o ackermann.c > > Then I run llc like the following: > > llc compiled.o > > which outputs > > llc: bytecode didn't read correctly > > (I mean, I try it with different options but even the default ones > aint working) > > My llvm-gcc version is > > Using built-in specs. > Target: i686-pc-cygwin > Configured with: ../src/configure --prefix=/llvm-gcc/install > --enable-llvm=/llvm > /obj --enable-languages=c,c++ --disable-threads --enable-checking > Thread model: single > gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5400) > > and LLVM version (as llc gives it) > > Low Level Virtual Machine (http://llvm.org/): > llvm version 1.9cvs > DEBUG build with assertions. > > I use cygwin. > > Thanks a lot for help. > > Tony. > > P.S. compiled.o from ackermann.c is attached. > > -- > Nae king! Nae quin! Nae laird! Nae master! We willnae be fooled > again! > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Thanks Reid and Jim! That helped. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060820/6b5e31f2/attachment.html>