From owner-freebsd-questions@FreeBSD.ORG Thu Oct 9 02:43:02 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB12E42C for ; Thu, 9 Oct 2014 02:43:02 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8E924B for ; Thu, 9 Oct 2014 02:43:01 +0000 (UTC) Received: (qmail 82463 invoked by uid 89); 9 Oct 2014 02:36:10 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 9 Oct 2014 02:36:10 -0000 Received: (qmail 82393 invoked by uid 89); 9 Oct 2014 02:35:53 -0000 Received: by simscan 1.3.1 ppid: 82386, pid: 82390, t: 0.0131s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 9 Oct 2014 02:35:53 -0000 Received: (qmail 1948 invoked by uid 89); 9 Oct 2014 02:35:53 -0000 Received: by simscan 1.4.0 ppid: 1931, pid: 1945, t: 0.7153s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 9 Oct 2014 02:35:52 -0000 From: Jan Beich To: "Jeremy C. Reed" Subject: Re: using code coverage with clang References: Date: Thu, 09 Oct 2014 04:35:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Approved-At: Thu, 09 Oct 2014 03:25:29 +0000 Cc: freebsd-toolchain@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2014 02:43:02 -0000 (redirected from -questions@ to -toolchain@) "Jeremy C. Reed" writes: > 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. With recent Clang the error may error slightly different: $ clang35 foo.c -fprofile-arcs -ftest-coverage /usr/local/bin/ld: cannot find /usr/local/llvm35/bin/../lib/clang/3.5.0/lib/freebsd/libclang_rt.profile-amd64.a: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) Try installing one of lang/gcc* and adding --rtlib=libgcc to link flags. --rtlib=compiler-rt requires more recent compiler-rt version than the one shipped with FreeBSD base. There's an upstream bug but the patches there have bitrotten to being mostly useless (predate --rtlib support). http://llvm.org/bugs/show_bug.cgi?id=6122 Anyway, freebsd-toolchain@ folk probably know more about the state of Clang coverage/profiling on FreeBSD such as: - devel/compiler-rt being more ancient than version in base on 10.0R - lang/clang* trying to use libgcc_p instead of libs from lang/gcc* - coverage/profiling not agreeing on whether to use libgcc/compiler-rt https://lists.freebsd.org/pipermail/freebsd-toolchain/2013-September/001030.html > > 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.) > Try either converting USE_GCC=yes ports to USES=compiler:gcc-c++11-lib or adding -nostdinc++ -isystem/usr/include/c++/v1 to CXXFLAGS and creating /usr/lib/libstdc++.so -> libc++.so symlink. > Does anyone have suggestions for doing code coverage with clang? Maybe pmcannotate(8) or dtrace(1) as compiler-agnostic alternatives. > > 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.) ------------------------------------------------- VFEmail.net - http://www.vfemail.net ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!