X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fblhc;h=d53c7d7b849a01b62610263e851dde695f26dd41;hb=992cc016c9d07fab61701a75a0957dcfda83c77d;hp=880d24df4d2599f6cae394595bb1eafd6fce4665;hpb=50b731db501c79ad33cb40845c16638703a4ea15;p=blhc%2Fblhc.git diff --git a/bin/blhc b/bin/blhc index 880d24d..d53c7d7 100755 --- a/bin/blhc +++ b/bin/blhc @@ -27,6 +27,50 @@ use Term::ANSIColor (); our $VERSION = '0.01'; +# CONSTANTS/VARIABLES + +# Regex to catch compiler commands. +my $cc_regex = qr/(?:x86_64-linux-gnu-)?(?:(? '-Wl,-z,relro', + '-Wl,(-z,)?now' => '-Wl,-z,now', +); + + # FUNCTIONS sub error_flags { @@ -113,7 +157,7 @@ sub pic_pie_conflict { } sub is_non_verbose_build { - my ($line, $next_line, $cc_regex, $skip_ref) = @_; + my ($line, $next_line, $skip_ref) = @_; if (not ($line =~ /^checking if you want to see long compiling messages\.\.\. no/ or $line =~ /^\s*(?:CC|CCLD)\s+(.+?)$/ @@ -152,50 +196,6 @@ sub is_non_verbose_build { } -# CONSTANTS/VARIABLES - -# Regex to catch compiler commands. -my $cc_regex = qr/(?:x86_64-linux-gnu-)?(?:(? '-Wl,-z,relro', - '-Wl,(-z,)?now' => '-Wl,-z,now', -); - - # MAIN # Additional hardening options. @@ -324,7 +324,7 @@ for (my $i = 0; $i < scalar @input; $i++) { my $line = $input[$i]; my $skip = 0; - if (is_non_verbose_build($line, $input[$i + 1], $cc_regex, \$skip)) { + if (is_non_verbose_build($line, $input[$i + 1], \$skip)) { error_non_verbose_build($line); $exit |= 1 << 2; next;