Qun Fa
2013-Mar-14 01:06 UTC
[LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
Hi, I am trying to test my project and get the code coverage with a version of clang compiler that was built from the latest llvm/clang codebase. It worked for a while. But today, after I updated my local checkout, and re-build llvm, clang and compiler-rt, when I test my project again, I got the errors with undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', 'llvm_gcda_emit_function', and 'llvm_gcda_end_file'. I have searched the codebase, and have found the functions are defined in GCDAProfiling.c file, but not sure why this suddenly doesn't work for me. Anyone can give any suggestions? Thanks very much in advance. Qun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130313/24e31428/attachment.html>
Bill Wendling
2013-Mar-14 05:56 UTC
[LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
On Mar 13, 2013, at 6:06 PM, Qun Fa <testforqunfa at gmail.com> wrote:> Hi, > I am trying to test my project and get the code coverage with a version of clang compiler that was built from the latest llvm/clang codebase. > > It worked for a while. But today, after I updated my local checkout, and re-build llvm, clang and compiler-rt, when I test my project again, I got the errors with undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', 'llvm_gcda_emit_function', and 'llvm_gcda_end_file'. > > I have searched the codebase, and have found the functions are defined in GCDAProfiling.c file, but not sure why this suddenly doesn't work for me. > > Anyone can give any suggestions? >Hi Qun, The 'runtime' recently removed these. You'll need to download and build compiler-rt. Put it in the 'projects' directory and it should just build when you compile LLVM. -bw
Nick Lewycky
2013-Mar-14 06:11 UTC
[LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
Qun Fa wrote:> Hi, > I am trying to test my project and get the code coverage with a version > of clang compiler that was built from the latest llvm/clang codebase. > > It worked for a while. But today, after I updated my local checkout, and > re-build llvm, clang and compiler-rt, when I test my project again, I > got the errors with undefined reference to 'llvm_gcda_start_file', > 'llvm_gcda_emit_arcs', 'llvm_gcda_emit_function', and 'llvm_gcda_end_file'. > > I have searched the codebase, and have found the functions are defined > in GCDAProfiling.c file, but not sure why this suddenly doesn't work for me. > > Anyone can give any suggestions?Those symbols should be provided by compiler-rt/lib/profile/GCDAProfiling.c. There used to be a copy in llvm's tree, but I deleted that one recently. It's possible you used to be using the one from llvm, but now need to switch to using the one from compiler-rt? Nick
Qun Fa
2013-Mar-14 13:46 UTC
[LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
Thanks for your reply. May I know which is the recommended library that should be linked against? I am currently linking libprofile_rt.a. And I have noticed the differences that, if we do `nm libprofile_rt.a | grep llvm` with my old copy of the llvm/clang installation, I can see 00000000000005e0 T _llvm_gcda_emit_arcs 0000000000000b48 S _llvm_gcda_emit_arcs.eh 0000000000000430 T _llvm_gcda_emit_function 0000000000000aa8 S _llvm_gcda_emit_function.eh 00000000000006c0 T _llvm_gcda_end_file 0000000000000b98 S _llvm_gcda_end_file.eh 00000000000003d0 T _llvm_gcda_increment_indirect_counter 0000000000000a80 S _llvm_gcda_increment_indirect_counter.eh 0000000000000000 T _llvm_gcda_start_file 0000000000000a08 S _llvm_gcda_start_file.eh They are the symbols that my test build is looking for. But with the latest codebase, here is what I saw 00000000000000a8 T llvm_start_basic_block_tracing 0000000000000067 T llvm_trace_basic_block 0000000000000467 T llvm_decrement_path_count 000000000000042a T llvm_increment_path_count 0000000000000662 T llvm_start_path_profiling 0000000000000020 T llvm_start_edge_profiling 0000000000000020 T llvm_start_opt_edge_profiling Thanks again, Qun On Thu, Mar 14, 2013 at 1:11 AM, Nick Lewycky <nicholas at mxc.ca> wrote:> Qun Fa wrote: > >> Hi, >> I am trying to test my project and get the code coverage with a version >> of clang compiler that was built from the latest llvm/clang codebase. >> >> It worked for a while. But today, after I updated my local checkout, and >> re-build llvm, clang and compiler-rt, when I test my project again, I >> got the errors with undefined reference to 'llvm_gcda_start_file', >> 'llvm_gcda_emit_arcs', 'llvm_gcda_emit_function', and >> 'llvm_gcda_end_file'. >> >> I have searched the codebase, and have found the functions are defined >> in GCDAProfiling.c file, but not sure why this suddenly doesn't work for >> me. >> >> Anyone can give any suggestions? >> > > Those symbols should be provided by compiler-rt/lib/profile/**GCDAProfiling.c. > There used to be a copy in llvm's tree, but I deleted that one recently. > It's possible you used to be using the one from llvm, but now need to > switch to using the one from compiler-rt? > > Nick > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130314/a46188ec/attachment.html>
Reasonably Related Threads
- [LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
- [LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
- [LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
- [LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc
- [LLVMdev] undefined reference to 'llvm_gcda_start_file', 'llvm_gcda_emit_arcs', etc