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

Do you know why I might be getting this error?

[dconnors@eces-shell Hello]$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc
[dconnors@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

I am using:

LLVM-GCC 4.2 Front End Binaries for Red Hat Enterprise Linux4/x86

LLVM source code 2.2

I've looked everywhere for possible error explanations, and only find code logs having the line regarding bitcode.

All of the tools lli, etc also report the problem of 4 bytes in length.

thanks!

Dan

Hi,

Do you know why I might be getting this error?

[dconnors@eces-shell Hello]$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc
[dconnors@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).