Bug#698352: `scan-build: error: Cannot find an executable 'clang' relative to scan-build.`

Paul Menzel pm.debian at googlemail.com
Thu Jan 17 15:53:09 UTC 2013


Am Donnerstag, den 17.01.2013, 16:09 +0100 schrieb Sylvestre Ledru:
> On 17/01/2013 14:31, Paul Menzel wrote:
> > `scan-build` [1] does not work out of the box.
> > 
> > $ scan-build make scan-build: error: Cannot find an executable
> > 'clang' relative to scan-build.  Consider using --use-analyzer to
> > pick a version of 'clang' to use for static analysis.
> > 
> > Passing the path to Clang as written in the explanation, it works.
> > 
> > $ scan-build --use-analyzer=/usr/bin/clang make
> Applying this change on /usr/bin/scan-build fixes the issue:
> 
> @@ -1459,7 +1459,7 @@
> 
>  # Find 'clang'
>  if (!defined $AnalyzerDiscoveryMethod) {
> -  $Clang = Cwd::realpath("$RealBin/bin/clang");
> +  $Clang = Cwd::realpath("/usr/bin/clang");
>    if (!defined $Clang || ! -x $Clang) {
>      $Clang = Cwd::realpath("$RealBin/clang");
>    }

Thanks, worked for me.

Though, upstream should figure out, what went wrong with setting
$RealBin correctly, as not all systems use `/usr`.


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20130117/4dac88c7/attachment.pgp>


More information about the Pkg-llvm-team mailing list