]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Sync architecture specific hardening support with dpkg 1.22.5
[blhc/blhc.git] / bin / blhc
index 2e48bbc063c6bc466ee6c6ceaae4eba42929e9b4..9040a084c873e691faae0801f8531588ec046883 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -1124,7 +1124,7 @@ foreach my $file (@ARGV) {
             # Embedded `gcc -print-*` commands
             next if $line =~ /`$cc_regex_normal\s*[^`]*-print-\S+`/;
             # cmake checking for compiler flags without setting CPPFLAGS
-            next if $line =~ m{^\s*/usr/(bin|lib)/(ccache/)?c\+\+ -dM -E -c /usr/share/cmake-\S+/Modules/CMakeCXXCompilerABI\.cpp};
+            next if $line =~ m{^\s*/usr/(bin|lib)/(ccache/)?c\+\+ (?:-std=\S+ )?-dM -E -c /usr/share/cmake-\S+/Modules/CMakeCXXCompilerABI\.cpp};
             # Some rustc lines look like linker commands
             next if $cargo and $line =~ /$rustc_regex/o;
 
@@ -1195,6 +1195,7 @@ foreach my $file (@ARGV) {
             i386
             kfreebsd-amd64
             kfreebsd-i386
+            loong64
             mips
             mips64
             mips64el
@@ -1217,7 +1218,11 @@ foreach my $file (@ARGV) {
         );
 
         # Disable unsupported hardening options.
-        if ($os !~ /^(?:linux|kfreebsd|knetbsd|hurd)$/ or $cpu eq 'hppa') {
+        if ($disable_harden_pie and exists $builtin_pie_arch{$arch}) {
+            $harden_pie = 0;
+        }
+        if ($os !~ /^(?:linux|kfreebsd|hurd)$/
+                or $cpu =~ /^(?:alpha|hppa|ia64)$/) {
             $harden_pie = 0;
         }
         if ($cpu =~ /^(?:ia64|alpha|hppa|nios2)$/ or $arch eq 'arm') {
@@ -1228,10 +1233,6 @@ foreach my $file (@ARGV) {
             $harden_relro   = 0;
             $harden_bindnow = 0;
         }
-
-        if ($disable_harden_pie and exists $builtin_pie_arch{$arch}) {
-            $harden_pie = 0;
-        }
     }
 
     # Default values.