Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 18:33:17 +0200
From:      Eduardo Morras <emorrasg@yahoo.es>
To:        freebsd-questions@freebsd.org
Subject:   Re: using code coverage with clang
Message-ID:  <20141006183317.cfc27cb4d7a2b7b8ce1e3efe@yahoo.es>
In-Reply-To: <alpine.NEB.2.02.1410060852390.27307@t1.m.reedmedia.net>
References:  <alpine.NEB.2.02.1410060852390.27307@t1.m.reedmedia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 6 Oct 2014 09:09:27 -0500 (CDT)
"Jeremy C. Reed" <reed@reedmedia.net> wrote:

> 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?

I use the static analyzer (in the Computer Science meaning of the term) from clang. F.ex.:

scan-build34 -o /home/gowen/projects/gummy_project/Analyze make -j 2 -e -f Makefile

Runs the clang34 static analyzer and outputs a html report. Perhaps it can help you.

> 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.)

---   ---
Eduardo Morras <emorrasg@yahoo.es>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141006183317.cfc27cb4d7a2b7b8ce1e3efe>