#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
my $cc_regex = qr/
(?<!\s-) # ignore options, e.g. "-c++" [sic!] (used by swig)
(?<!\.) # ignore file names, e.g. "test.gcc"
my $cc_regex = qr/
(?<!\s-) # ignore options, e.g. "-c++" [sic!] (used by swig)
(?<!\.) # ignore file names, e.g. "test.gcc"
(?:-[\d.]+)? # version suffix, e.g. "gcc-4.6"
/x;
# Full regex which matches the complete compiler name. Used in a few places to
(?:-[\d.]+)? # version suffix, e.g. "gcc-4.6"
/x;
# Full regex which matches the complete compiler name. Used in a few places to
);
my @source_no_preprocess = (
@source_no_preprocess_compile,
);
my @source_no_preprocess = (
@source_no_preprocess_compile,
@source_preprocess_compile_cpp,
@source_no_preprocess_compile_cpp,
);
@source_preprocess_compile_cpp,
@source_no_preprocess_compile_cpp,
);
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
# (/usr/share/perl5/Dpkg/Vendor/Debian.pm, _add_hardening_flags()),
# copyright Raphaël Hertzog <hertzog@debian.org>, Kees Cook
# <kees@debian.org>, Canonical, Ltd. licensed under GPL version 2 or
# later. Keep it in sync.
require Dpkg::Arch;
# (/usr/share/perl5/Dpkg/Vendor/Debian.pm, _add_hardening_flags()),
# copyright Raphaël Hertzog <hertzog@debian.org>, Kees Cook
# <kees@debian.org>, Canonical, Ltd. licensed under GPL version 2 or
# later. Keep it in sync.
require Dpkg::Arch;
- my ($abi, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch);
+ my ($os, $cpu);
+ # Recent dpkg versions use a quadruplet for arch. Support both.
+ eval {
+ (undef, undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtuple($arch);
+ };
+ if ($@) {
+ (undef, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch);
+ }
# 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.
- and $compile
- and array_equal(\@extensions,
- \@source_no_preprocess_compile_ada)) {
- $compile_ada = 1;
+ and extension_found(\%extensions_ada, @extensions)) {
+ $restore_cflags = 1;
+ $preprocess = 0; # Ada uses no CPPFLAGS
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by