Hi!

On Sun, 2024-03-03 at 16:46:33 +0100, Guillem Jover wrote:
> On Sun, 2024-03-03 at 16:11:36 +0100, Matthias Klose wrote:
> >  - please provide an opt-out option.
> 
> This is a bug, which I should fix.

The first attached patch is what I'd use to fix this.

> >  - turn it on on all architectures, so that everbody
> >    can reproduce the effects.
> 
> I'd be fine with that.

The second attached patch is what I'd use to implement this, if
there's agreement. (Barring manual page updates here.)

I'll wait for Steve's input, before proceeding, otherwise I might just
upload the first patch for now, either later today or tomorrow, so that
people can opt-out of this until there's agreement on how to proceed.
(Even though I guess people could already use DEB_CFLAGS_MAINT_STRIP to
forcibly disable the -Werror=implicit-function-declaration flag.)

Thanks,
Guillem
From f747a38746cbf0fa4279e773835b7d872c0d313c Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Sun, 3 Mar 2024 18:42:34 +0100
Subject: [PATCH] Dpkg::Vendor::Debian: Make it possible to disable
 qa=-bug-implicit-func

We do not need to forcibly enable this feature if the user explicitly
specified it.

Closes: #1065371
---
 scripts/Dpkg/Vendor/Debian.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index fcf5b1e2a..ad727d2cf 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -299,8 +299,8 @@ sub set_build_features {
         $use_feature{abi}{lfs} = 1 if $libc eq 'gnu';
 
         # Require -Werror=implicit-function-declaration, to avoid linking
-        # against the wrong symbol.
-        $use_feature{qa}{'bug-implicit-func'} = 1;
+        # against the wrong symbol, unless it has been set explicitly.
+        $use_feature{qa}{'bug-implicit-func'} //= 1;
     }
 
     # XXX: Handle lfs alias from future abi feature area.
-- 
2.43.0

From 87702728876e96891d02df2d1b0419f709939190 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Sun, 3 Mar 2024 18:53:12 +0100
Subject: [PATCH] Dpkg::Vendor::Debian: Unconditionally set qa
 bug-implicit-func

For the time64 default change, we conditionally enabled
bug-implicit-func to avoid silent ABI breakage due to implicit function
declarations that end up using the time32 symbols, but that is causing
confusion as the effects are not visible on the most commonly used
architectures. Instead enable this globally, unless the maintainer has
specified otherwise.
---
 scripts/Dpkg/Vendor/Debian.pm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index ad727d2cf..b3be69e86 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -117,7 +117,7 @@ sub set_build_features {
             time64 => undef,
         },
         qa => {
-            bug => 0,
+            bug => undef,
             'bug-implicit-func' => undef,
             canary => 0,
         },
@@ -297,10 +297,6 @@ sub set_build_features {
     if ($use_feature{abi}{time64} && ! $builtin_feature{abi}{time64}) {
         # On glibc 64-bit time_t support requires LFS.
         $use_feature{abi}{lfs} = 1 if $libc eq 'gnu';
-
-        # Require -Werror=implicit-function-declaration, to avoid linking
-        # against the wrong symbol, unless it has been set explicitly.
-        $use_feature{qa}{'bug-implicit-func'} //= 1;
     }
 
     # XXX: Handle lfs alias from future abi feature area.
@@ -311,7 +307,14 @@ sub set_build_features {
 
     ## Area: qa
 
-    $use_feature{qa}{'bug-implicit-func'} //= $use_feature{qa}{bug};
+    # For time64 we require -Werror=implicit-function-declaration, to avoid
+    # linking against the wrong symbol. Instead of enabling this conditionally
+    # on time64 being enabled, do it unconditionally so that the effects are
+    # uniform and visible on all architectures. Unless it has been set
+    # explicitly.
+    $use_feature{qa}{'bug-implicit-func'} //= $use_feature{qa}{bug} // 1;
+
+    $use_feature{qa}{bug} //= 0;
 
     ## Area: reproducible
 
-- 
2.43.0

Reply via email to