From 338a746eb678ff013050c64232aa179c946aaa1c Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sun, 9 Nov 2025 12:03:56 +0100 Subject: [PATCH] package/nbd: Fix build on musl + gcc14 Fixes: https://autobuild.buildroot.net/results/1e8/1e88151bb3aad1c1769e12b4930a2c33cd1c6830/ Signed-off-by: Bernd Kuhls Signed-off-by: Julien Olivain (cherry picked from commit 0f1a2e875e375bf9950c604de0595070d2a9a779) Signed-off-by: Thomas Perale --- ...1-nbd-client-Fix-build-on-musl-gcc14.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 package/nbd/0001-nbd-client-Fix-build-on-musl-gcc14.patch diff --git a/package/nbd/0001-nbd-client-Fix-build-on-musl-gcc14.patch b/package/nbd/0001-nbd-client-Fix-build-on-musl-gcc14.patch new file mode 100644 index 0000000000..72f43b1f9c --- /dev/null +++ b/package/nbd/0001-nbd-client-Fix-build-on-musl-gcc14.patch @@ -0,0 +1,46 @@ +From 4664b8dd3bc124c27b160720113339c1da97c2c4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 20 May 2024 17:50:51 -0700 +Subject: [PATCH] nbd-client: Fix build on musl + gcc14 + +GCC-14 has promoted incompatible-pointer-types warning into error which is +now flagged especially with when building on musl + +Fixes following error + +| ../nbd-3.26.1/nbd-client.c: In function 'openunix': +| ../nbd-3.26.1/nbd-client.c:345:27: error: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types] +| 345 | if (connect(sock, &un_addr, sizeof(un_addr)) == -1) { +| | ^~~~~~~~ +| | | +| | struct sockaddr_un * +| In file included from ../nbd-3.26.1/nbd-client.c:25: +| /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/nbd/3.26.1/recipe-sysroot/usr/include/sys/socket.h:386:19: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *' +| 386 | int connect (int, const struct sockaddr *, socklen_t); +| | ^~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Khem Raj + +Upstream: https://github.com/NetworkBlockDevice/nbd/commit/4664b8dd3bc124c27b160720113339c1da97c2c4 + +Signed-off-by: Bernd Kuhls +--- + nbd-client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nbd-client.c b/nbd-client.c +index f4e120f..bc79bdf 100644 +--- a/nbd-client.c ++++ b/nbd-client.c +@@ -342,7 +342,7 @@ int openunix(const char *path) { + return -1; + }; + +- if (connect(sock, &un_addr, sizeof(un_addr)) == -1) { ++ if (connect(sock, (struct sockaddr*)&un_addr, sizeof(un_addr)) == -1) { + err_nonfatal("CONNECT failed"); + close(sock); + return -1; +-- +2.47.3 +