Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14
@ 2025-08-13 20:13 Florian Larysch
  2025-08-16 20:30 ` Thomas Petazzoni via buildroot
  2025-08-21 19:21 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Larysch @ 2025-08-13 20:13 UTC (permalink / raw)
  To: buildroot; +Cc: Florian Larysch

Unlike glibc and uClibc, musl doesn't play tricks with transparent
unions for the second argument to bind() to accept the various sockaddr
variants, but rather just defines it as "struct sockaddr*". As GCC 14 no
longer allows arbitrary implicit pointer casts, this results in a build
error. Import the upstream patch that adds the cast.

Fixes: https://autobuild.buildroot.org/results/00b/00b42a35a80c2deb61f2cd40aedd231597bbb290
Signed-off-by: Florian Larysch <fl@n621.de>
---
 ...t-sockaddr_un-to-struct-sockaddr-on-.patch | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch

diff --git a/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch b/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch
new file mode 100644
index 0000000000..c093b49e2e
--- /dev/null
+++ b/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch
@@ -0,0 +1,31 @@
+From 209ffbbf7c8fcf49d9296c969feb7a41aece6525 Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@debian.org>
+Date: Tue, 6 Dec 2022 18:37:08 +0100
+Subject: [PATCH] s-s-d: Cast struct sockaddr_un to struct sockaddr on bind()
+ call
+
+Changelog: internal
+Warned-by: gcc -Wincompatible-pointer-types on musl-libc
+
+Upstream: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=209ffbbf7c8fcf49d9296c969feb7a41aece6525
+Signed-off-by: Florian Larysch <fl@n621.de>
+---
+ utils/start-stop-daemon.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
+index 6863151c1..a15c0493f 100644
+--- a/utils/start-stop-daemon.c
++++ b/utils/start-stop-daemon.c
+@@ -632,7 +632,7 @@ create_notify_socket(void)
+ 	su.sun_family = AF_UNIX;
+ 	strncpy(su.sun_path, sockname, sizeof(su.sun_path) - 1);
+ 
+-	rc = bind(fd, &su, sizeof(su));
++	rc = bind(fd, (struct sockaddr *)&su, sizeof(su));
+ 	if (rc < 0)
+ 		fatale("cannot bind to notification socket");
+ 
+-- 
+2.50.1
+
-- 
2.50.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14
  2025-08-13 20:13 [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14 Florian Larysch
@ 2025-08-16 20:30 ` Thomas Petazzoni via buildroot
  2025-08-21 19:21 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-16 20:30 UTC (permalink / raw)
  To: Florian Larysch; +Cc: buildroot

On Wed, 13 Aug 2025 22:13:54 +0200
Florian Larysch <fl@n621.de> wrote:

> Unlike glibc and uClibc, musl doesn't play tricks with transparent
> unions for the second argument to bind() to accept the various sockaddr
> variants, but rather just defines it as "struct sockaddr*". As GCC 14 no
> longer allows arbitrary implicit pointer casts, this results in a build
> error. Import the upstream patch that adds the cast.
> 
> Fixes: https://autobuild.buildroot.org/results/00b/00b42a35a80c2deb61f2cd40aedd231597bbb290
> Signed-off-by: Florian Larysch <fl@n621.de>
> ---
>  ...t-sockaddr_un-to-struct-sockaddr-on-.patch | 31 +++++++++++++++++++
>  1 file changed, 31 insertions(+)
>  create mode 100644 package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14
  2025-08-13 20:13 [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14 Florian Larysch
  2025-08-16 20:30 ` Thomas Petazzoni via buildroot
@ 2025-08-21 19:21 ` Thomas Perale via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Perale via buildroot @ 2025-08-21 19:21 UTC (permalink / raw)
  To: Florian Larysch; +Cc: Thomas Perale, buildroot

In reply of:
> Unlike glibc and uClibc, musl doesn't play tricks with transparent
> unions for the second argument to bind() to accept the various sockaddr
> variants, but rather just defines it as "struct sockaddr*". As GCC 14 no
> longer allows arbitrary implicit pointer casts, this results in a build
> error. Import the upstream patch that adds the cast.
> 
> Fixes: https://autobuild.buildroot.org/results/00b/00b42a35a80c2deb61f2cd40aedd231597bbb290
> Signed-off-by: Florian Larysch <fl@n621.de>

Applied to 2025.02.x & 2025.05.x. Thanks

> ---
>  ...t-sockaddr_un-to-struct-sockaddr-on-.patch | 31 +++++++++++++++++++
>  1 file changed, 31 insertions(+)
>  create mode 100644 package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch
> 
> diff --git a/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch b/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch
> new file mode 100644
> index 0000000000..c093b49e2e
> --- /dev/null
> +++ b/package/start-stop-daemon/0003-s-s-d-Cast-struct-sockaddr_un-to-struct-sockaddr-on-.patch
> @@ -0,0 +1,31 @@
> +From 209ffbbf7c8fcf49d9296c969feb7a41aece6525 Mon Sep 17 00:00:00 2001
> +From: Guillem Jover <guillem@debian.org>
> +Date: Tue, 6 Dec 2022 18:37:08 +0100
> +Subject: [PATCH] s-s-d: Cast struct sockaddr_un to struct sockaddr on bind()
> + call
> +
> +Changelog: internal
> +Warned-by: gcc -Wincompatible-pointer-types on musl-libc
> +
> +Upstream: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=209ffbbf7c8fcf49d9296c969feb7a41aece6525
> +Signed-off-by: Florian Larysch <fl@n621.de>
> +---
> + utils/start-stop-daemon.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
> +index 6863151c1..a15c0493f 100644
> +--- a/utils/start-stop-daemon.c
> ++++ b/utils/start-stop-daemon.c
> +@@ -632,7 +632,7 @@ create_notify_socket(void)
> + 	su.sun_family = AF_UNIX;
> + 	strncpy(su.sun_path, sockname, sizeof(su.sun_path) - 1);
> + 
> +-	rc = bind(fd, &su, sizeof(su));
> ++	rc = bind(fd, (struct sockaddr *)&su, sizeof(su));
> + 	if (rc < 0)
> + 		fatale("cannot bind to notification socket");
> + 
> +-- 
> +2.50.1
> +
> -- 
> 2.50.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-21 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 20:13 [Buildroot] [PATCH 1/1] package/start-stop-daemon: fix build issues with musl and GCC 14 Florian Larysch
2025-08-16 20:30 ` Thomas Petazzoni via buildroot
2025-08-21 19:21 ` Thomas Perale via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox