]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
libtirpc: fix bindresvport build with clang-22/C23
authorKhem Raj <raj.khem@gmail.com>
Wed, 1 Apr 2026 06:12:29 +0000 (23:12 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 Apr 2026 10:45:50 +0000 (11:45 +0100)
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/libtirpc/libtirpc/0001-libtirpc-fix-bindresvport-build-with-clang-22-C23.patch [new file with mode: 0644]
meta/recipes-extended/libtirpc/libtirpc_1.3.7.bb

diff --git a/meta/recipes-extended/libtirpc/libtirpc/0001-libtirpc-fix-bindresvport-build-with-clang-22-C23.patch b/meta/recipes-extended/libtirpc/libtirpc/0001-libtirpc-fix-bindresvport-build-with-clang-22-C23.patch
new file mode 100644 (file)
index 0000000..4e5844e
--- /dev/null
@@ -0,0 +1,32 @@
+From 0ae4371ee63e25a48777a83c0601c85c5747cbac Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Tue, 31 Mar 2026 23:07:09 -0700
+Subject: [PATCH] libtirpc: fix bindresvport build with clang-22/C23
+
+bindresvport() is defined using old K&R-style syntax, which breaks when
+building libtirpc with clang-22 in gnu23 mode.
+
+Convert it to a prototype-style definition. This is a no-op change
+intended only to restore compatibility with modern C compilers.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-nfs/20260401060943.2578248-1-khem.raj@oss.qualcomm.com/T/#u]
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/bindresvport.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index 7b2056d..eea6589 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -57,9 +57,7 @@ extern pthread_mutex_t port_lock;
+  * Bind a socket to a privileged IP port
+  */
+ int
+-bindresvport(sd, sin)
+-        int sd;
+-        struct sockaddr_in *sin;
++bindresvport(int sd, struct sockaddr_in *sin)
+ {
+         return bindresvport_sa(sd, (struct sockaddr *)sin);
+ }
index edc75a8366a5e0e2144563cccebef0b20144a440..cef541e3d07970bf40841009d8c56f46a674bb79 100644 (file)
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \
 PROVIDES = "virtual/librpc"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+           file://0001-libtirpc-fix-bindresvport-build-with-clang-22-C23.patch \
           "
 UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/libtirpc/files/libtirpc/"
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"