Hi, I'd like to see what parts of LLVM/Clang are being executed. I know that "make ENABLE_COVERAGE=1" used to just work, but so far (on 64-bit Ubuntu 14.04) I've had no luck building either 3.4.x or SVN head using any of Clang 3.4, Clang head, or a recent GCC. The first error that I get when building with GCC is this: /home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:1304: error: undefined reference to '__gcov_init' The first error that I get when building with Clang 3.4.2 is this: /home/regehr/tmp/llvm/build/utils/FileCheck/Debug+Coverage+Asserts/FileCheck.o:/home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:function __llvm_gcov_writeout: error: undefined reference to 'llvm_gcda_start_file' Is this expected to work? Am I missing something obvious? Thanks, John Regehr
On Tue, Jun 17, 2014 at 12:48 PM, John Regehr <regehr at cs.utah.edu> wrote:> Hi, > > I'd like to see what parts of LLVM/Clang are being executed. > > I know that "make ENABLE_COVERAGE=1" used to just work, but so far (on > 64-bit Ubuntu 14.04) I've had no luck building either 3.4.x or SVN head > using any of Clang 3.4, Clang head, or a recent GCC. > > The first error that I get when building with GCC is this: > > /home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:1304: error: undefined > reference to '__gcov_init' > > The first error that I get when building with Clang 3.4.2 is this: > > /home/regehr/tmp/llvm/build/utils/FileCheck/Debug+Coverage+Asserts/FileCheck.o:/home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:function > __llvm_gcov_writeout: error: undefined reference to 'llvm_gcda_start_file' > > Is this expected to work? Am I missing something obvious? >Yes, and no. :) I fixed at least the linking problem here: Committing to https://llvm.org/svn/llvm-project/llvm/trunk ... M Makefile.rules Committed r211131 The build is still going on so I can't test whether or not the instrumented code is actually producing gcov notes, but it is taking forever to run clang when building compiler-rt ;) -eric
On 17 June 2014 12:48, John Regehr <regehr at cs.utah.edu> wrote:> Hi, > > I'd like to see what parts of LLVM/Clang are being executed. >By the way, there is http://buildd-clang.debian.net/coverage/ which is a regularly updated run of llvm and clang at head plus their regression test suites. That won't help you look at coverage for your own testcases of course, but you didn't actually say why you wanted it. Nick I know that "make ENABLE_COVERAGE=1" used to just work, but so far (on> 64-bit Ubuntu 14.04) I've had no luck building either 3.4.x or SVN head > using any of Clang 3.4, Clang head, or a recent GCC. > > The first error that I get when building with GCC is this: > > /home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:1304: error: > undefined reference to '__gcov_init' > > The first error that I get when building with Clang 3.4.2 is this: > > /home/regehr/tmp/llvm/build/utils/FileCheck/Debug+ > Coverage+Asserts/FileCheck.o:/home/regehr/tmp/llvm/utils/ > FileCheck/FileCheck.cpp:function __llvm_gcov_writeout: error: undefined > reference to 'llvm_gcda_start_file' > > Is this expected to work? Am I missing something obvious? > > Thanks, > > John Regehr > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140617/16c5c231/attachment.html>
Thanks Eric, I'm trying this out now! John On Tue, 17 Jun 2014, Eric Christopher wrote:> On Tue, Jun 17, 2014 at 12:48 PM, John Regehr <regehr at cs.utah.edu> wrote: >> Hi, >> >> I'd like to see what parts of LLVM/Clang are being executed. >> >> I know that "make ENABLE_COVERAGE=1" used to just work, but so far (on >> 64-bit Ubuntu 14.04) I've had no luck building either 3.4.x or SVN head >> using any of Clang 3.4, Clang head, or a recent GCC. >> >> The first error that I get when building with GCC is this: >> >> /home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:1304: error: undefined >> reference to '__gcov_init' >> >> The first error that I get when building with Clang 3.4.2 is this: >> >> /home/regehr/tmp/llvm/build/utils/FileCheck/Debug+Coverage+Asserts/FileCheck.o:/home/regehr/tmp/llvm/utils/FileCheck/FileCheck.cpp:function >> __llvm_gcov_writeout: error: undefined reference to 'llvm_gcda_start_file' >> >> Is this expected to work? Am I missing something obvious? >> > > Yes, and no. :) > > I fixed at least the linking problem here: > > Committing to https://llvm.org/svn/llvm-project/llvm/trunk ... > M Makefile.rules > Committed r211131 > > The build is still going on so I can't test whether or not the > instrumented code is actually producing gcov notes, but it is taking > forever to run clang when building compiler-rt ;) > > -eric >
> By the way, there is http://buildd-clang.debian.net/coverage/ which is a regularly updated run of llvm and clang at head plus their > regression test suites. That won't help you look at coverage for your own testcases of course, but you didn't actually say why you > wanted it.Yeah, sorry, I need to measure coverage for my own code. I've seen this site but it doesn't seem to give the recipe for building a coverage-enabled LLVM! John
> forever to run clang when building compiler-rt ;)You're not kidding, this is really slow. But I got working coverage by building w/o compiler-rt. Also Christian Holler pointed me to his LLCov which is really cool: https://github.com/choller/LLCov Thanks!! John