]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Check for CMake version which obeyed CPPFLAGS.
[blhc/blhc.git] / bin / blhc
index 7f1fd84fe1b078841eebbcd06a1c4f83cd6a5e2c..5bbfe73255836fd23bba513edaf9f2af1734ba73 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -209,6 +209,7 @@ my %exit_code = (
     non_verbose_build    => 1 << 2,
     flags_missing        => 1 << 3,
     hardening_wrapper    => 1 << 4,
+    invalid_cmake        => 1 << 5,
 );
 
 # Statistics of missing flags and non-verbose build commands. Used for
@@ -253,6 +254,14 @@ sub error_non_verbose_build {
            error_color(':', 'yellow'),
            $line;
 }
+sub error_invalid_cmake {
+    my ($version) = @_;
+
+    printf "%s%s %s\n",
+            error_color('INVALID CMAKE', 'red'),
+            error_color(':', 'yellow'),
+            $version;
+}
 sub error_hardening_wrapper {
     printf "%s%s %s\n",
             error_color('HARDENING WRAPPER', 'red'),
@@ -494,6 +503,23 @@ FILE: foreach my $file (@ARGV) {
             }
         }
 
+        # The following two versions of CMake in Debian obeyed CPPFLAGS, but
+        # this was later dropped because upstream rejected the patch. Thus
+        # build logs with these versions will have fortify hardening flags
+        # enabled, even though they may be not correctly set and are missing
+        # when build with later CMake versions. Thanks to Aron Xu for letting
+        # me know.
+        if ($line =~ /^Package versions: /
+                and $line =~ /\bcmake_(\S+)/
+                and ($1 eq '2.8.7-1' or $1 eq '2.8.7-2')) {
+            if (not $option_buildd) {
+                error_invalid_cmake($1);
+            } else {
+                print "W-invalid-cmake-used $1\n";
+            }
+            $exit |= $exit_code{invalid_cmake};
+        }
+
         # If hardening wrapper is used (wraps calls to gcc and adds hardening
         # flags automatically) we can't perform any checks, abort.
         if ($line =~ /^Build-Depends: .*\bhardening-wrapper\b/) {