X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fblhc;h=e3b83d9853910168a05dcb7ac9870f9244200c39;hb=3eca6f2738379a5e68b1d134232184bc41ac05eb;hp=92ab3b442b1beae820aad9eb3988e3cfbb125795;hpb=c1062539346fc41efb4316cb04f2893ce954bb37;p=blhc%2Fblhc.git diff --git a/bin/blhc b/bin/blhc index 92ab3b4..e3b83d9 100755 --- a/bin/blhc +++ b/bin/blhc @@ -428,6 +428,7 @@ my $option_help = 0; my $option_version = 0; my $option_pie = 0; my $option_bindnow = 0; +my @option_ignore_arch = (); my @option_ignore_flag = (); my @option_ignore_line = (); my $option_all = 0; @@ -442,6 +443,7 @@ if (not Getopt::Long::GetOptions( 'bindnow' => \$option_bindnow, 'all' => \$option_all, # Ignore. + 'ignore-arch=s' => \@option_ignore_arch, 'ignore-flag=s' => \@option_ignore_flag, 'ignore-line=s' => \@option_ignore_line, # Misc. @@ -542,7 +544,7 @@ foreach my $file (@ARGV) { if ($option_buildd and index($line, 'Toolchain package versions: ') == 0) { require Dpkg::Version; - if ($line !~ /\bdpkg-dev_(\S+)/ + if (not $line =~ /\bdpkg-dev_(\S+)/ or Dpkg::Version::version_compare($1, '1.16.1') < 0) { $harden_format = 0; $harden_fortify = 0; @@ -689,6 +691,16 @@ foreach my $file (@ARGV) { close $fh; + # Ignore arch if requested. + if (scalar @option_ignore_arch > 0 and $arch) { + foreach my $ignore (@option_ignore_arch) { + if ($arch eq $ignore) { + print "ignoring architecture '$arch'\n"; + next FILE; + } + } + } + if (scalar @input == 0) { if (not $option_buildd) { print "No compiler commands!\n"; @@ -1020,6 +1032,12 @@ Don't require Term::ANSIColor. Use colored (ANSI) output for warning messages. +=item B<--ignore-arch> I + +Ignore build logs from architectures matching I. I is a string. + +Used to prevent false positives. This option can be specified multiple times. + =item B<--ignore-flag> I Don't print an error when the specific flag is missing in a compiler line.