<div class="gmail_quote">On Wed, Mar 2, 2011 at 10:44 AM, Vincent De Bruyne <span dir="ltr"><<a href="mailto:vincent_de_bruyne@hotmail.com">vincent_de_bruyne@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
Hi<br><br>I'm trying to compile the "bh" C program from the Olden benchmark to one bc file.<br><br># compile source files into an LLVM bitcode file<br>llvm-gcc -emit-llvm -c args.c -o args.bc -w -DTORONTO<br>
llvm-gcc -emit-llvm -c newbh.c -o newbh.bc -w -DTORONTO<br>llvm-gcc -emit-llvm -c util.c -o util.bc -w -DTORONTO<br>llvm-gcc -emit-llvm -c walksub.c -o walksub.bc -w -DTORONTO<br><br># To link files together using llvm-ld<br>
llvm-ld -o bh.bc newbh.bc args.bc util.bc walksub.bc -lm<br></div></blockquote><div><br></div><div>llvm-link would be better suited for this purpose.  It takes in several byte-code files and combines them into a single byte-code file.  Also, you do not need the -lm flag until you generate the final executable.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br>But when I try to run my pass over bh.bc file or just compile it to native code<br>llc bh.bc -o bh.s<br>
<br>I get the following error.<br>llc: bh.bc:1:1:<b> error: expected top-level entity</b><br><br>Do you need to do some special stuff when you want to compile a C program with different files to one bc file.<br><br>Thx,<br>
Vincent<br><br>                                       </div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>