[LLVMdev] Problems with new bytecode format

Reid Spencer rspencer at reidspencer.com
Tue Dec 19 18:51:59 PST 2006


Hi Roman,

On Tue, 2006-12-19 at 17:32 -0800, Roman Levenstein wrote:
> Hi,
> 
> I just updated my LLVM sources from CVS/HEAD and rebuilt them. And I
> downloaded the GCC4 frontend from the 1.9 release. 
> 
> Now I cannot compile anything, since GCC frontend seems to produce BC
> files that cannot be read by llvm-dis, llc and other utils.
> 
> llvm-dis shows a following message:
> Bytecode formats < 7 are not longer supported. Use llvm-upgrade.
> (Vers=6, Pos=9)

That is correct. Bytecode format 6 corresponds to version 1.9. LLVM is
currently using version 7 and the definition of version 7 is still in
flux as the instruction set continues to change.

> 
> But since the new llvm-dis cannot disassemble, I cannot use
> llvm-upgrade, since I need a way to produce an *.ll file.

If you can't do as Bill suggested (get the latest llvm-gcc and compile
it), you can use this approach:

Compile with the 1.9 version of llvm-gcc4. Use the -emit-llvm -S
options. That will yield a 1.9 assembly (ll) file.

Run llvm-upgrade from the CVS head on on the produced llvm assembly.
That will produce another .ll file. Then that assembly file can be run
through the latest llvm-as.

Something like this:

cfe1.9/bin/llvm-gcc -S -emit-llvm source.c -o - | \
   HEAD/bin/llvm-upgrade | \
   HEAD/bin/llvm-as -o source.bc

> 
> What's wrong? I thought that LLVM 1.9 GCC4 frontend produces BC files
> in a new format already? 

It is, but the format continues to change rapidly in preparation for
release 2.0. Because of the rapid changes, we decided to break backwards
compatibility except through LLVM Assembly files. This has drastically
simplified our task and will get us to a faster/smaller/smarter bytecode
format for 2.0 more easily.

Sorry for any inconvenience this has caused, but it was necessary to
make progress.

> Or do I need to rebuild the front-end from the
> CVS?

That's definitely the simplest thing to do.

>  May be there are pre-built images available?

No, there's not. We only distribute them in accordance with a release.
The 2.0 release is not scheduled until the May time frame.

> 
> -Roman 

Reid.

> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list