knot: drop kru.inc.c static_assert that requires lock-free 16-bit atomics
authorAlexandru Ardelean <redacted>
Fri, 29 May 2026 15:45:19 +0000 (18:45 +0300)
committerAlexandru Ardelean <redacted>
Sat, 30 May 2026 06:31:17 +0000 (09:31 +0300)
The RRL module's kru.inc.c has a `static_assert(ATOMIC_CHAR16_T_LOCK_FREE
== 2, ...)` that breaks the build on any target whose toolchain does
not advertise lock-free 16-bit atomics (e.g. ARMv5 arm926ej-s).
Upstream considers the assertion non-essential and plans to drop it;
they recommended a patch over a Makefile-level RRL disable. Bump
PKG_RELEASE for the patch swap.

Suggested-by: Daniel Salzman <redacted>
Signed-off-by: Alexandru Ardelean <redacted>
net/knot/Makefile
net/knot/patches/03_rrl_drop_static_assert.patch [new file with mode: 0644]

index 0289b18024cb9eb70bea73cb8982f2f532dd67c3..190f985eb11d8c4210e54364364b9214348a2b7d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knot
 PKG_VERSION:=3.5.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
diff --git a/net/knot/patches/03_rrl_drop_static_assert.patch b/net/knot/patches/03_rrl_drop_static_assert.patch
new file mode 100644 (file)
index 0000000..7cc646e
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/knot/modules/rrl/kru.inc.c
++++ b/src/knot/modules/rrl/kru.inc.c
+@@ -462,7 +462,6 @@ static inline bool kru_limited_update(st
+               load_at = (_Atomic uint16_t *)ctx->load;
+       }
+-      static_assert(ATOMIC_CHAR16_T_LOCK_FREE == 2, "insufficient atomics");
+       const uint16_t price = ctx->price16;
+       const uint32_t limit = ctx->limit16;  // 2^16 has to be representable
+       uint16_t load_orig = atomic_load_explicit(load_at, memory_order_relaxed);
git clone https://git.99rst.org/PROJECT