my ($line, $pie, $missing_flags_ref, @flags_pie) = @_;
return 0 if not $pie;
- return 0 if not any_flags_used($line, ('-fPIC'));
+ return 0 if not any_flags_used($line, ('-fPIC', '-fpic'));
my %flags = map { $_ => 1 } @flags_pie;
# Ignore false positives.
#
# ./configure summary.
- next if $line =~ /^Compiler:\s+(cc|gcc|g\+\+|c\+\+)$/;
+ my $cc_regex = qr/(cc|(x86_64-linux-gnu-)?gcc|g\+\+|c\+\+)/;
+ next if $line =~ /^\s*(C|c)ompiler[\s.]*:\s+$cc_regex(\s-std=[a-z0-9:+]+)?\s*$/
+ or $line =~ /^\s*- (CC|CXX)\s*=\s*$cc_regex\s*$/
+ or $line =~ /^\s*-- Check for working (C|CXX) compiler: /;
# Is this a compiler or linker command?
my $compiler = 1;