[cfe-dev] scan-build fails to find clang-cc

Ted Kremenek kremenek at apple.com
Sat Mar 28 17:34:59 PDT 2009


On Mar 28, 2009, at 3:14 PM, Bruce Cran wrote:

> Hi,
>
> I recently installed clang on a FreeBSD box and have started building
> my code using it.  on FreeBSD the clang-cc binary is installed
> in /usr/local/libexec but it seems scan-build looks
> in /usr/local/bin/libexec first and then tries /usr/local/bin :
>
> my $ClangSB = Cwd::realpath("$RealBin/libexec/clang-cc");
>
> # Also look for 'clang-cc' in the same directory as scan-build.
> if (!defined $ClangSB || ! -x $ClangSB) {
>  $ClangSB = Cwd::realpath("$RealBin/clang-cc");
> }
>
>
> I'm not familiar with the filesystem layout on OS X but should the  
> first
> path be "$RealBin/../libexec/clang-cc" ?

Hi Bruce,

I have updated scan-build script to also look for clang-cc in  
"$RealBin/../libexec/clang-cc":

   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090323/014712.html

Please let me know if that works better for you.

I'm welcome to making the packing of scan-build more sane across  
OSes.  Traditionally the checker builds I do for OS X don't assume  
that the files are installed anywhere in particular on the system (in  
fact when I use them I just untar them in no particular place and run  
scan-build using an absolute path).  A checker-XXX.tar.gz file just  
contains the directory "checker-XXX" with scan-build and "bin",  
"libexec", etc., subdirectories being present because that's how clang- 
cc expects to be used.  Probably moving "scan-build" to the bin  
subdirectory makes sense so that it could literally be installed to / 
usr/bin.  Note that scan-build currently is not installed when one  
does a "make install" with Clang; I just have a small script that  
builds Clang and packages up the tar file.

Ted



More information about the cfe-dev mailing list