[LLVMdev] LLVM error: "Bitcode stream should be a multiple of 4 bytes in length" (fwd)

Duncan Sands baldrick at free.fr
Fri Mar 21 01:23:12 PDT 2008


Hi,

> Do you know why I might be getting this error?
> 
> 
> [dconnors at eces-shell Hello]$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc
> [dconnors at eces-shell Hello]$ llc hello.bc -o hello.s
> llc: bitcode didn't read correctly.
> Reason: Bitcode stream should be a multiple of 4 bytes in length

this means that hello.bc doesn't contain bitcode, though I suppose it might
contain an out-of-date version of bitcode.  My guess is that you have an old
llvm-gcc or llc floating around in your path, which is getting used accidentally.
You might want to look inside hello.bc, and see what the first 10 characters or
so look like.  Also, try doing "file hello.bc".  If it is bitcode you should get
"hello.bc: data".

Ciao,

Duncan.

PS: I tried your command lines here and it worked fine (ubuntu x86-32).



More information about the llvm-dev mailing list