Hi, Could anyone tell me how exactly can one convert a .bc file (bitcode file) to an executable in the native program. I was trying an instrumentation transform with the following workflow opt -insert-edge-profiling input.bc -o output.bc and then try and execute output.bc using lli output.bc however the program gives the following error : Program used external function 'llvm_start_edge_profiling' which could not be resolved!. Could anyone guide me to the correct workflow for doing such transforms and then executing them? Thanks Nipun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110401/a643e32a/attachment.html>
Hi, I was able to figure out this one, by checking out profile.pl. However, I am still interested in getting to know if there is anyway to compile from bitcode to a normal executable? Maybe I am missing something obvious... :P ? Thanks Nipun On Fri, Apr 1, 2011 at 1:34 PM, Nipun Arora <nipun2512 at gmail.com> wrote:> Hi, > > Could anyone tell me how exactly can one convert a .bc file (bitcode file) > to an executable in the native program. > > I was trying an instrumentation transform with the following workflow > > opt -insert-edge-profiling input.bc -o output.bc > > and then try and execute output.bc using > > lli output.bc > > however the program gives the following error : Program used external > function 'llvm_start_edge_profiling' which could not be resolved!. > > Could anyone guide me to the correct workflow for doing such transforms and > then executing them? > > Thanks > Nipun >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110401/a41fcf67/attachment.html>
The easiest way is just to invoke clang on the .bc file, since it understands it. clang file.bc -o file llc will get you native assembly, which you can assemble and link with gcc. llc file.bc -o file.s && gcc file.s -o file I couldn't find a way to convince llc to use MC to generate an object file. In any case, you'll need to invoke the system linker to produce the executable. Reid On Fri, Apr 1, 2011 at 2:12 PM, Nipun Arora <nipun2512 at gmail.com> wrote:> Hi, > > I was able to figure out this one, by checking out profile.pl. > However, I am still interested in getting to know if there is anyway to > compile from bitcode to a normal executable? > Maybe I am missing something obvious... :P ? > > Thanks > Nipun > > On Fri, Apr 1, 2011 at 1:34 PM, Nipun Arora <nipun2512 at gmail.com> wrote: >> >> Hi, >> >> Could anyone tell me how exactly can one convert a .bc file (bitcode file) >> to an executable in the native program. >> >> I was trying an instrumentation transform with the following workflow >> >> opt -insert-edge-profiling input.bc -o output.bc >> >> and then try and execute output.bc using >> >> lli output.bc >> >> however the program gives the following error : Program used external >> function 'llvm_start_edge_profiling' which could not be resolved!. >> >> Could anyone guide me to the correct workflow for doing such transforms >> and then executing them? >> >> Thanks >> Nipun > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >