Package: clang-3.5
Version: 1:3.5~+rc1-2

Dear Maintainer,

Bug #748777 was re-intrduced in latest clang-3.5 package.

The following invokation does not work anymore:
  scan-build --use-cc=arm-none-eabi-gcc -o out make -e

It seems that the patch from bug #748777 was dropped from latest package.

Attached is an rebased version of the patch that apply cleanly on latest
clang-3.5 and that fixes the problem again.

Regards.

Aurélien Jacobs
diff -Naur llvm-toolchain-3.5-3.5~+rc1.orig/clang/tools/scan-build/ccc-analyzer llvm-toolchain-3.5-3.5~+rc1/clang/tools/scan-build/ccc-analyzer
--- llvm-toolchain-3.5-3.5~+rc1.orig/clang/tools/scan-build/ccc-analyzer	2014-08-06 10:29:51.990552103 +0200
+++ llvm-toolchain-3.5-3.5~+rc1/clang/tools/scan-build/ccc-analyzer	2014-08-06 10:35:05.016567533 +0200
@@ -25,6 +25,17 @@
 # Compiler command setup.
 ##===----------------------------------------------------------------------===##
 
+# Search in the PATH if the compiler exists
+sub SearchInPath {
+    my $file = shift;
+    foreach my $dir (split (':', $ENV{PATH})) {
+        if (-x "$dir/$file") {
+            return 1;
+        }
+    }
+    return 0;
+}
+
 my $Compiler;
 my $Clang;
 my $DefaultCCompiler;
@@ -41,7 +52,7 @@
 
 if ($FindBin::Script =~ /c\+\+-analyzer/) {
   $Compiler = $ENV{'CCC_CXX'};
-  if (!defined $Compiler || ! -x $Compiler) { $Compiler = $DefaultCXXCompiler; }
+  if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCXXCompiler; }
 
   $Clang = $ENV{'CLANG_CXX'};
   if (!defined $Clang || ! -x $Clang) { $Clang = 'clang++'; }
@@ -50,7 +61,7 @@
 }
 else {
   $Compiler = $ENV{'CCC_CC'};
-  if (!defined $Compiler || ! -x $Compiler) { $Compiler = $DefaultCCompiler; }
+  if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler))) { $Compiler = $DefaultCCompiler; }
 
   $Clang = $ENV{'CLANG'};
   if (!defined $Clang || ! -x $Clang) { $Clang = 'clang'; }

Reply via email to