next if $line =~ /^\s*Depends: .*?$cc_regex.*?$/
and $line !~ /\s-./; # option, prevent false negatives
+ # Check if additional hardening options were used. Used to ensure
+ # they are used for the complete build.
+ $harden_pie = 1 if any_flags_used($line, @cflags_pie, @ldflags_pie);
+ $harden_bindnow = 1 if any_flags_used($line, @ldflags_bindnow);
push @input, $line;
}
}
}
-# Check if additional hardening options were used. Used to ensure they are
-# used for the complete build.
-foreach my $line (@input) {
- $harden_pie = 1 if any_flags_used($line, @cflags_pie, @ldflags_pie);
- $harden_bindnow = 1 if any_flags_used($line, @ldflags_bindnow);
-}
-
# Check the specified hardening options, same order as dpkg-buildflags.
if ($harden_pie) {
@cflags = (@cflags, @cflags_pie);