Problems with instrumentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with instrumentation

Raul Fernandes Herbster-2
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
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Problems with instrumentation

Wojciech Matyjewicz
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Problems with instrumentation

Holger Schurig-2
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: '.'
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev