Will be used for Fortran flags in the next commit.
@ldflags = (@ldflags, @def_ldflags_bindnow);
}
@ldflags = (@ldflags, @def_ldflags_bindnow);
}
- # Stores normal CFLAGS when @cflags_ada are temporarily used.
- my @cflags_backup;
- # Ada CFLAGS, only set if ada is used.
- my @cflags_ada;
# Ada doesn't support format hardening flags, see #680117 for more
# information. Filter them out if ada is used.
# Ada doesn't support format hardening flags, see #680117 for more
# information. Filter them out if ada is used.
+ my @cflags_backup;
+ my @cflags_noformat;
if ($ada and $harden_format) {
if ($ada and $harden_format) {
+ @cflags_noformat = grep {
my $ok = 1;
foreach my $flag (@def_cflags_format) {
$ok = 0 if $_ eq $flag;
my $ok = 1;
foreach my $flag (@def_cflags_format) {
$ok = 0 if $_ eq $flag;
+ my $restore_cflags = 0;
# Assume CXXFLAGS are required when a C++ file is specified in the
# compiler line.
if ($compile
# Assume CXXFLAGS are required when a C++ file is specified in the
# compiler line.
if ($compile
# Ada needs special CFLAGS, use them if only ada files are compiled.
} elsif ($ada
and extension_found(\%extensions_ada, @extensions)) {
# Ada needs special CFLAGS, use them if only ada files are compiled.
} elsif ($ada
and extension_found(\%extensions_ada, @extensions)) {
$preprocess = 0; # Ada uses no CPPFLAGS
@cflags_backup = @cflags;
$preprocess = 0; # Ada uses no CPPFLAGS
@cflags_backup = @cflags;
+ @cflags = @cflags_noformat;
}
# Restore normal CFLAGS.
}
# Restore normal CFLAGS.
@cflags = @cflags_backup;
}
}
@cflags = @cflags_backup;
}
}