Package: dnsdist
Version: 2.0.5-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu stonking ubuntu-patch

Dear Maintainer,


armhf build is failing with clang21.

2 changes are needed to fix the build failure:

  * d/rules: drop -fno-stack-clash-protection from C/C++ flags.
    clang does not implement stack-clash protection on armhf, so this flag
    is an unused argument. meson promotes the resulting warning to an error
    during its compiler checks (-Werror=unused-command-line-argument),
    which made the pthread.h check fail and broke configure on armhf.

 * d/p/fix-cache-size-narrowing-32bit.patch

Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers noble-updates
  APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), 
(100, 'noble-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 6.17.0-35-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru dnsdist-2.0.5/debian/patches/fix-cache-size-narrowing-32bit.patch 
dnsdist-2.0.5/debian/patches/fix-cache-size-narrowing-32bit.patch
--- dnsdist-2.0.5/debian/patches/fix-cache-size-narrowing-32bit.patch   
1970-01-01 01:00:00.000000000 +0100
+++ dnsdist-2.0.5/debian/patches/fix-cache-size-narrowing-32bit.patch   
2026-06-16 00:14:55.000000000 +0200
@@ -0,0 +1,21 @@
+Description: Fix narrowing of packet cache size on 32-bit architectures
+ The YAML configuration field cache.size is a uint64_t, while
+ DNSDistPacketCache::CacheSettings::d_maxEntries is a size_t. On 32-bit
+ architectures (e.g. armhf) size_t is 32-bit, so the designated-initializer
+ assignment is a narrowing conversion, which clang rejects with
+ -Wc++11-narrowing. Cast explicitly to size_t.
+Author: Hector Cao <[email protected]>
+Forwarded: https://github.com/PowerDNS/pdns/pull/17575
+Last-Update: 2026-06-16
+
+--- a/dnsdist-configuration-yaml.cc
++++ b/dnsdist-configuration-yaml.cc
+@@ -1165,7 +1165,7 @@
+ 
+     for (const auto& cache : globalConfig.packet_caches) {
+       DNSDistPacketCache::CacheSettings settings{
+-        .d_maxEntries = cache.size,
++        .d_maxEntries = static_cast<size_t>(cache.size),
+         .d_maxTTL = cache.max_ttl,
+         .d_minTTL = cache.min_ttl,
+         .d_tempFailureTTL = cache.temporary_failure_ttl,
diff -Nru dnsdist-2.0.5/debian/patches/series 
dnsdist-2.0.5/debian/patches/series
--- dnsdist-2.0.5/debian/patches/series 2026-04-26 22:35:15.000000000 +0200
+++ dnsdist-2.0.5/debian/patches/series 2026-06-16 00:14:55.000000000 +0200
@@ -1 +1,2 @@
 rust-debcargo-licensing.patch
+fix-cache-size-narrowing-32bit.patch
diff -Nru dnsdist-2.0.5/debian/rules dnsdist-2.0.5/debian/rules
--- dnsdist-2.0.5/debian/rules  2026-05-30 00:57:34.000000000 +0200
+++ dnsdist-2.0.5/debian/rules  2026-06-16 00:14:55.000000000 +0200
@@ -29,6 +29,16 @@
 # Vendor and version
 CXXFLAGS += -DPACKAGEVERSION='"$(DEB_VERSION).$(DEB_VENDOR)"'
 
+# We build with clang, but clang does not implement stack-clash protection on
+# armhf, where dpkg-buildflags still emits -fno-stack-clash-protection. For
+# clang this is an unused argument, resulting warning to
+# an error during its compiler checks (-Werror=unused-command-line-argument),
+# breaking configure. Drop the no-op flag on armhf to avoid this.
+ifeq ($(DEB_HOST_ARCH),armhf)
+CFLAGS := $(filter-out -fno-stack-clash-protection,$(CFLAGS))
+CXXFLAGS := $(filter-out -fno-stack-clash-protection,$(CXXFLAGS))
+endif
+
 
 %:
        dh $@ --buildsystem=meson

Reply via email to