This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=5f529cfeb9477baf44b74443a04502da1ec893e8

commit 5f529cfeb9477baf44b74443a04502da1ec893e8
Author: Guillem Jover <[email protected]>
AuthorDate: Sun Jul 9 17:58:45 2023 +0200

    Dpkg::Vendor::Debian: Move builtin default setup before 
init_build_features()
    
    These are the defaults for the system, and we should provide those to
    the init_build_features(), which can then override them as they wish.
---
 scripts/Dpkg/Vendor/Debian.pm | 100 +++++++++++++++++++++---------------------
 1 file changed, 50 insertions(+), 50 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 5f6ec0b3f..d071f6dc3 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -152,21 +152,6 @@ sub set_build_features {
         },
     );
 
-    $self->init_build_features(\%use_feature, \%builtin_feature);
-
-    ## Setup
-
-    require Dpkg::BuildOptions;
-
-    # Adjust features based on user or maintainer's desires.
-    my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
-    my $opts_maint = Dpkg::BuildOptions->new(envvar => 
'DEB_BUILD_MAINT_OPTIONS');
-
-    foreach my $area (sort keys %use_feature) {
-        $opts_build->parse_features($area, $use_feature{$area});
-        $opts_maint->parse_features($area, $use_feature{$area});
-    }
-
     require Dpkg::Arch;
 
     my $arch = Dpkg::Arch::get_host_arch();
@@ -182,6 +167,56 @@ sub set_build_features {
         ($abi_bits, $abi_endian) = (0, 'unknown');
     }
 
+    # Mask builtin features that are not enabled by default in the compiler.
+    my %builtin_pie_arch = map { $_ => 1 } qw(
+        amd64
+        arm64
+        armel
+        armhf
+        hurd-amd64
+        hurd-i386
+        i386
+        kfreebsd-amd64
+        kfreebsd-i386
+        mips
+        mips64
+        mips64el
+        mips64r6
+        mips64r6el
+        mipsel
+        mipsn32
+        mipsn32el
+        mipsn32r6
+        mipsn32r6el
+        mipsr6
+        mipsr6el
+        powerpc
+        ppc64
+        ppc64el
+        riscv64
+        s390x
+        sparc
+        sparc64
+    );
+    if (not exists $builtin_pie_arch{$arch}) {
+        $builtin_feature{hardening}{pie} = 0;
+    }
+
+    $self->init_build_features(\%use_feature, \%builtin_feature);
+
+    ## Setup
+
+    require Dpkg::BuildOptions;
+
+    # Adjust features based on user or maintainer's desires.
+    my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
+    my $opts_maint = Dpkg::BuildOptions->new(envvar => 
'DEB_BUILD_MAINT_OPTIONS');
+
+    foreach my $area (sort keys %use_feature) {
+        $opts_build->parse_features($area, $use_feature{$area});
+        $opts_maint->parse_features($area, $use_feature{$area});
+    }
+
     ## Area: abi
 
     if ($use_feature{abi}{time64}) {
@@ -282,41 +317,6 @@ sub set_build_features {
 
     ## Area: hardening
 
-    # Mask builtin features that are not enabled by default in the compiler.
-    my %builtin_pie_arch = map { $_ => 1 } qw(
-        amd64
-        arm64
-        armel
-        armhf
-        hurd-amd64
-        hurd-i386
-        i386
-        kfreebsd-amd64
-        kfreebsd-i386
-        mips
-        mips64
-        mips64el
-        mips64r6
-        mips64r6el
-        mipsel
-        mipsn32
-        mipsn32el
-        mipsn32r6
-        mipsn32r6el
-        mipsr6
-        mipsr6el
-        powerpc
-        ppc64
-        ppc64el
-        riscv64
-        s390x
-        sparc
-        sparc64
-    );
-    if (not exists $builtin_pie_arch{$arch}) {
-        $builtin_feature{hardening}{pie} = 0;
-    }
-
     # Mask features that are not available on certain architectures.
     if (none { $os eq $_ } qw(linux kfreebsd knetbsd hurd) or
         $cpu eq 'hppa') {

-- 
Dpkg.Org's dpkg

Reply via email to