X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fblhc;h=c13f3b6961b1a41ecfcf8ef91fd6c4433ba05e1e;hb=959cbe56d9b89868c42c2ae0082771eea8f31d1a;hp=e03ac2889aa039ed04eaad66720dec1ac73fab18;hpb=23020a59781f2a07a8d56053972d14c6d3cae2b3;p=blhc%2Fblhc.git diff --git a/bin/blhc b/bin/blhc index e03ac28..c13f3b6 100755 --- a/bin/blhc +++ b/bin/blhc @@ -182,7 +182,7 @@ my @def_cflags = ( '-O(?:2|3)', ); my @def_cflags_format = ( - '-Wformat', + '-Wformat(?:=2)?', # -Wformat=2 implies -Wformat, accept it too '-Werror=format-security', # implies -Wformat-security ); my @def_cflags_fortify = ( @@ -190,7 +190,7 @@ my @def_cflags_fortify = ( ); my @def_cflags_stack = ( '-fstack-protector', - '--param=ssp-buffer-size=4', + '--param[= ]ssp-buffer-size=4', ); my @def_cflags_pie = ( '-fPIE', @@ -251,6 +251,8 @@ my @flag_refs_all = ( # stores string values of flag regexps above, see compile_flag_regexp(). my %flag_renames = ( '-O(?:2|3)' => '-O2', + '-Wformat(?:=2)?' => '-Wformat', + '--param[= ]ssp-buffer-size=4' => '--param=ssp-buffer-size=4', '-Wl,(?:-z,)?relro' => '-Wl,-z,relro', '-Wl,(?:-z,)?now' => '-Wl,-z,now', ); @@ -319,6 +321,8 @@ sub error_flags { printf '%s (%s)%s %s', error_color($message, 'red'), $flags, error_color(':', 'yellow'), $line; + + return; } sub error_non_verbose_build { my ($line) = @_; @@ -327,6 +331,8 @@ sub error_non_verbose_build { error_color('NONVERBOSE BUILD', 'red'), error_color(':', 'yellow'), $line; + + return; } sub error_invalid_cmake { my ($version) = @_; @@ -335,12 +341,16 @@ sub error_invalid_cmake { error_color('INVALID CMAKE', 'red'), error_color(':', 'yellow'), $version; + + return; } sub error_hardening_wrapper { printf "%s%s %s\n", error_color('HARDENING WRAPPER', 'red'), error_color(':', 'yellow'), 'no checks possible, aborting'; + + return; } sub error_color { my ($message, $color) = @_; @@ -477,6 +487,8 @@ sub remove_flags { or not exists $removes{$flag_renames_ref->{$_}}) } @{$flags}; } + + return; } sub compile_flag_regexp {