Skip to contentSkip to conversation

package/mcelog: fix musl build with gcc >= 14.x

Buildroot Thomas Perale via buildroot 1 participant 1 message Feb 4

lore
Share & tools
lore
#0 lore raw

commit: https://gitlab.com/buildroot.org/buildroot/-/commit/aa94a00b94c77313b8317f451e1a6c13b278473b
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/2025.11.x

Fixes:
https://autobuild.buildroot.net/results/902/9020e4fda8cbc4f9886d5e8725f6df8d99716241/

The build error does not occur with gcc-13.

(cherry picked from commit a042ea816a44a72084fe90effc912787f1a2a673)
---
 ...ver-Correct-prameter-type-for-connect-API.patch | 43 ++++++++++++++++++++++
 .../0002-client.c-fix-build-w-musl-libc.patch      | 42 +++++++++++++++++++++
 2 files changed, 85 insertions(+)
package/mcelog/0001-server-Correct-prameter-type-for-connect-API.patch new file +43 -0
new file mode 100644
index 0000000000..cc9d0e84c6
@@ -0,0 +1,43 @@
+From c17897deb52daab300c585a6a6c2456d062d80cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 11 May 2024 22:50:19 -0700
+Subject: [PATCH] server: Correct prameter type for connect() API
+
+connect() function expects the second argument to be point to sockaddr
+as per man sockaddr
+
+int connect (int, const struct sockaddr *, socklen_t);
+
+Fixes build failures with -Wincompatible-pointer-types when using GCC-14
+and musl
+
+Fixes
+| server.c: In function 'server_ping':
+| server.c:308:33: error: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
+|   308 |                 if (connect(fd, un, sizeof(struct sockaddr_un)) < 0)
+|       |                                 ^~
+|       |                                 |
+|       |                                 struct sockaddr_un *
+
+Signed-off-by: Andi Kleen <[email protected]>
+
+Upstream: https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git/commit/?id=c17897deb52daab300c585a6a6c2456d062d80cf
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ server.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/server.c b/server.c
+index 54c7d57..51b7d3a 100644
+--- a/server.c
++++ b/server.c
+@@ -305,7 +305,7 @@ static int server_ping(struct sockaddr_un *un)
+ 	if (sigsetjmp(ping_timeout_ctx, 1) == 0) {
+ 		ret = -1;
+ 		alarm(initial_ping_timeout);
+-		if (connect(fd, un, sizeof(struct sockaddr_un)) < 0)
++		if (connect(fd, (const struct sockaddr *)un, sizeof(struct sockaddr_un)) < 0)
+ 			goto cleanup;
+ 		if (write(fd, PAIR("ping\n")) < 0)
+ 			goto cleanup;
package/mcelog/0002-client.c-fix-build-w-musl-libc.patch new file +42 -0

42 lines not on this page · raw message

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot