I am trying to use llvm-ld but when I try to link several bytecode files into a single bytecode file, it gives me the following error: llvm-ld -o benchmarks/bc-1.06/src/bc.c.bc benchmarks/bc-1.06/src/bc.i.bc benchmarks/bc-1.06/src/execute.i.bc benchmarks/bc-1.06/src/getopt1.i.bc benchmarks/bc-1.06/src/getopt.i.bc benchmarks/bc-1.06/src/global.i.bc benchmarks/bc-1.06/src/load.i.bc benchmarks/bc-1.06/src/main.i.bc benchmarks/bc-1.06/src/number.i.bc benchmarks/bc-1.06/src/scan.i.bc benchmarks/bc-1.06/src/storage.i.bc benchmarks/bc-1.06/src/util.i.bc benchmarks/bc-1.06/src/vfprintf.i.bc -link-as-library llvm-ld: error: Cannot load file 'benchmarks/bc-1.06/src/bc.i.bc'Bytecode file 'benchmarks/bc-1.06/src/bc.i.bc' could not be loaded: Don't know how to deserialize primitive type 16 (Vers=0, Pos=15) I am using llvm-ld built from the cvs checked out yesterday. llvm-gcc was used to build the bytecode files passed as input to llvm-ld, and its version is: llvm-gcc (GCC) 4.0.1 LLVM (Apple Computer, Inc. build 5421) Does anyone know what the problem is? Thanks, Ryan
I get a similar error when I try to disassemble a bytecode file generated by llvm-gcc released for llvm 1.9. Do I need to upgrade to a new llvm-gcc? Ryan M. Lefever wrote:> I am trying to use llvm-ld but when I try to link several bytecode files > into a single bytecode file, it gives me the following error: > > llvm-ld -o benchmarks/bc-1.06/src/bc.c.bc benchmarks/bc-1.06/src/bc.i.bc > benchmarks/bc-1.06/src/execute.i.bc benchmarks/bc-1.06/src/getopt1.i.bc > benchmarks/bc-1.06/src/getopt.i.bc benchmarks/bc-1.06/src/global.i.bc > benchmarks/bc-1.06/src/load.i.bc benchmarks/bc-1.06/src/main.i.bc > benchmarks/bc-1.06/src/number.i.bc benchmarks/bc-1.06/src/scan.i.bc > benchmarks/bc-1.06/src/storage.i.bc benchmarks/bc-1.06/src/util.i.bc > benchmarks/bc-1.06/src/vfprintf.i.bc -link-as-library > llvm-ld: error: Cannot load file > 'benchmarks/bc-1.06/src/bc.i.bc'Bytecode file > 'benchmarks/bc-1.06/src/bc.i.bc' could not be loaded: Don't know how to > deserialize primitive type 16 (Vers=0, Pos=15) > > I am using llvm-ld built from the cvs checked out yesterday. llvm-gcc > was used to build the bytecode files passed as input to llvm-ld, and its > version is: > > llvm-gcc (GCC) 4.0.1 LLVM (Apple Computer, Inc. build 5421) > > Does anyone know what the problem is? > > Thanks, > Ryan > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- Ryan M. Lefever [http://www.ews.uiuc.edu/~lefever]
I was able to correct this problem by checking out the latest version of llvm-gcc4 from svn and compiling it from source. One note, in order to get llvm-gcc4 to compile, I had to add #include "llvm/Analysis/LoopPass.h" to gcc/llvm-backend.cpp Ryan M. Lefever wrote:> I get a similar error when I try to disassemble a bytecode file > generated by llvm-gcc released for llvm 1.9. Do I need to upgrade to a > new llvm-gcc? > > Ryan M. Lefever wrote: >> I am trying to use llvm-ld but when I try to link several bytecode files >> into a single bytecode file, it gives me the following error: >> >> llvm-ld -o benchmarks/bc-1.06/src/bc.c.bc benchmarks/bc-1.06/src/bc.i.bc >> benchmarks/bc-1.06/src/execute.i.bc benchmarks/bc-1.06/src/getopt1.i.bc >> benchmarks/bc-1.06/src/getopt.i.bc benchmarks/bc-1.06/src/global.i.bc >> benchmarks/bc-1.06/src/load.i.bc benchmarks/bc-1.06/src/main.i.bc >> benchmarks/bc-1.06/src/number.i.bc benchmarks/bc-1.06/src/scan.i.bc >> benchmarks/bc-1.06/src/storage.i.bc benchmarks/bc-1.06/src/util.i.bc >> benchmarks/bc-1.06/src/vfprintf.i.bc -link-as-library >> llvm-ld: error: Cannot load file >> 'benchmarks/bc-1.06/src/bc.i.bc'Bytecode file >> 'benchmarks/bc-1.06/src/bc.i.bc' could not be loaded: Don't know how to >> deserialize primitive type 16 (Vers=0, Pos=15) >> >> I am using llvm-ld built from the cvs checked out yesterday. llvm-gcc >> was used to build the bytecode files passed as input to llvm-ld, and its >> version is: >> >> llvm-gcc (GCC) 4.0.1 LLVM (Apple Computer, Inc. build 5421) >> >> Does anyone know what the problem is? >> >> Thanks, >> Ryan >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Ryan M. Lefever [http://www.ews.uiuc.edu/~lefever]