Hello again, My partner and I am modifying a PEG parser generator to produce LLVM bitcode from a version of a parsing expression grammar that takes LLVM Assembly as code. It accepts external libraries in its current state so we are writing an external library in C++ using C bindings for the linkage. Trying to get it to link is proving to be more challenging than expected. My partner is trying to link on a Win32 system so the Gold plugin is not an option. He also doesn't have Perl installed so using llvm-config is also not an option. Here is the command line of trying to compile the resultant amos.bc file from our parser generator with the main program that hosts it: llvm-link -o out.bc main.bc amos.bc llc -f out.bc ..\..\..\..\llvm-gcc\bin\llvm-g++ out.s -L..\..\..\..\llvm\lib -L..\..\..\..\llvm-gcc\lib -lgcc -lLLVMLinker -lLLVMipo -lLLVMInstrumentation -lLLVMDebugger -lLLVMBitWriter -lLLVMAsmParser -lLLVMArchive -lLLVMBitReader -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMSupport -lLLVMSystem -lsupc++ It is complaining about not being able to find __gxx_personality_sj0 and the LLVM command line parser-related files. What else do we need to link? --Sam
Hello> It is complaining about not being able to find __gxx_personality_sj0 and the LLVM command line parser-related files. What else do we need to link?This is personality function for sjlj eh. How the source bitcode files in questions were generated? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Hello Anton, Our main.bc was generated with the following command line: llvm-g++ -Illvm\include -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -c -emit-llvm -omain.bc main.cpp The amos.bc file was generated by our experimental llvm-peg parser generator whose internal workings are assembled internally using LLVM Assembly. The parser generator links a C++ library bitcode with C bindings called libBasicFrontends.bc internally. The command line for the libBasicFrontends.bc is similar to the llvm-g++ command line given above. Is there anything we should be doing differently for the libBasicFrontends.bc file? Also, as a quick update, the command line parser is now linking properly so only the SJ/LJ stuff is not linking correctly. Kind regards, --Sam Crow ----- Original Message ----> From: Anton Korobeynikov <anton at korobeynikov.info> > To: Samuel Crow <samuraileumas at yahoo.com> > Cc: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Fri, December 4, 2009 3:30:02 PM > Subject: Re: [LLVMdev] linking a parser bitcode > > Hello > > > It is complaining about not being able to find __gxx_personality_sj0 and the > LLVM command line parser-related files. What else do we need to link? > This is personality function for sjlj eh. How the source bitcode files > in questions were generated? > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University