using code coverage with clang

Jeremy C. Reed reed at reedmedia.net
Mon Oct 6 14:47:25 UTC 2014


For a few years I have been building different code with
-fprofile-arcs -ftest-coverage with gcc on different BSDs and different 
Linuxes. I would build with that, run various tests, and then use gcov 
or lcov to see the code that was ran.

When I changed from FreeBSD 9.x to 10.0-RELEASE-p1, I went from gcc to 
clang.  But this causes
/usr/bin/ld: /usr/bin/../lib/libprofile_rt.a: No such file: No such file 
or directory

I don't have that library. Any suggestions on how to get it so I don't 
have to maintain later during upgrades.  I don't think the clang ports 
have it either.

I'd prefer to not maintain all my dependencies (ports) using gcc. 
(Currently I cannot use gcc with the clang-built ports as some libraries 
appear to be built differently so references aren't seen the same.)

Does anyone have suggestions for doing code coverage with clang?

Or are there binary packages available for 10.0 on amd64 built with gcc?

(I found a forum discussion about it at
https://forums.freebsd.org/viewtopic.php?f=35&t=47260 and several other 
reports about it.)


More information about the freebsd-questions mailing list