Hi, I'm trying to instrument llvm bytecodes using opt. I performed the following commands: llvm-gcc -g -emit-llvm test.c -c -o test.bc opt -insert-edge-profiling test.bc -o output.bc llc output.bc -o output.s gcc output.s -o test.out However, it can't find symbol llvm_start_edge_profiling. /tmp/ccw7GH4c.o: In function `main': /home/raul/LLVM/tests//test.c:8: undefined reference to `llvm_start_edge_profiling' collect2: ld returned 1 exit status Does anybody know which is the problem? I'm using LLVM 2.1 and LLVM-GCC 4.2 (both were built from SVN source code). Thanks in advance, Raul. -- Raul Fernandes Herbster Embedded and Pervasive Computing Laboratory - embedded.ufcg.edu.br Electrical Engineering and Informatics Center - CEEI Federal University of Campina Grande - UFCG - www.ufcg.edu.br Caixa Postal 10105 58109-970 Campina Grande - PB - Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080207/a7b9efa2/attachment.html>
Hi,> llvm-gcc -g -emit-llvm test.c -c -o test.bc > opt -insert-edge-profiling test.bc -o output.bc > llc output.bc -o output.s > gcc output.s -o test.out > > However, it can't find symbol llvm_start_edge_profiling.-insert-edge-profiling inserts call to the llvm_start_edge_profiling function which is a part of a profiling runtime library. This library must be linked into your executable. The runtime library isn't built automatically. To build it, please, run make in the $LLVMOBJDIR/runtime directory. If it complains about LLVMGCCDIR not set, it means you have to reconfigure LLVM with --enable-llvmgccdir option. You may also find some useful information in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-January/012315.html -Wojtek
Compiling the runtime doesn't work with r46884: llvm[2]: Compiling CommonProfiling.c for Release build (PIC) /usr/src/llvm/obj.llvm/Release/bin/llvm-as: /usr/src/llvm/obj.llvm/runtime/GC/SemiSpace/Release/semispace.ll:3,0: /usr/src/llvm/obj.llvm/runtime/GC/SemiSpace/Release/semispace.ll:3: error: syntax error, unexpected $undefined, expecting GLOBAL or CONSTANT while reading token: '.'