All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/ledmon: fix musl build
@ 2024-05-11  6:21 Fabrice Fontaine
  2024-05-11  6:58 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2024-05-11  6:21 UTC (permalink / raw)
  To: buildroot; +Cc: Maksim Kiselev, Fabrice Fontaine

Fix the following musl build failure raised since bump to version 1.0.0
in commit b3819b761f4a06bc75fe33b785e5ff2cecc5d211 and
https://github.com/intel/ledmon/commit/bcb90426a156fcb3147b5722ed78ac8cf26f2976:

/home/buildroot/autobuild/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-musleabi/12.3.0/../../../../arm-buildroot-linux-musleabi/bin/ld: ledctl-ledctl.o: in function `main':
ledctl.c:(.text.startup+0x140): undefined reference to `on_exit'

Fixes: b3819b761f4a06bc75fe33b785e5ff2cecc5d211
 - http://autobuild.buildroot.org/results/d535e03f6ee0f43ecea34fb29ea148a4cdc01169

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...l-ledctl.c-replace-on_exit-by-atexit.patch | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 package/ledmon/0001-src-ledctl-ledctl.c-replace-on_exit-by-atexit.patch

diff --git a/package/ledmon/0001-src-ledctl-ledctl.c-replace-on_exit-by-atexit.patch b/package/ledmon/0001-src-ledctl-ledctl.c-replace-on_exit-by-atexit.patch
new file mode 100644
index 0000000000..4e1536df4f
--- /dev/null
+++ b/package/ledmon/0001-src-ledctl-ledctl.c-replace-on_exit-by-atexit.patch
@@ -0,0 +1,40 @@
+From ff6f5cd263da4683b3ea07d4ef8afdbf95e2a401 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 9 May 2024 10:04:38 +0200
+Subject: [PATCH] ledctl: replace on_exit() by atexit()
+
+Replace on_exit() by atexit() to avoid the following musl build failure
+raised since bcb9042 ("ledctl: Remove enum ledctl_status_code_t")
+which partially reverted f08dd2c ("Fix build with Musl libc (#139)")
+
+/home/buildroot/autobuild/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-musleabi/12.3.0/../../../../arm-buildroot-linux-musleabi/bin/ld: ledctl-ledctl.o: in function `main':
+ledctl.c:(.text.startup+0x140): undefined reference to `on_exit'
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/intel/ledmon/commit/ff6f5cd263da4683b3ea07d4ef8afdbf95e2a401
+---
+ src/ledctl/ledctl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/ledctl/ledctl.c b/src/ledctl/ledctl.c
+index 231253dc..95db2d86 100644
+--- a/src/ledctl/ledctl.c
++++ b/src/ledctl/ledctl.c
+@@ -230,7 +230,7 @@ static void ibpi_state_fini(struct ibpi_state *p)
+  *
+  * @return The function does not return a value.
+  */
+-static void _ledctl_fini(int _i, void *_arg)
++static void _ledctl_fini(void)
+ {
+ 	led_free(ctx);
+ 	list_erase(&ibpi_list);
+@@ -1101,7 +1101,7 @@ int main(int argc, char *argv[])
+ 	if (status != LED_STATUS_SUCCESS)
+ 		return status;
+ 
+-	if (on_exit(_ledctl_fini, progname))
++	if (atexit(_ledctl_fini))
+ 		exit(LED_STATUS_ONEXIT_ERROR);
+ 
+ 	status = _read_shared_conf();
-- 
2.43.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/1] package/ledmon: fix musl build
@ 2025-11-27 20:27 Bernd Kuhls
  2025-11-28 17:40 ` Julien Olivain via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Kuhls @ 2025-11-27 20:27 UTC (permalink / raw)
  To: buildroot; +Cc: Maksim Kiselev

Fixes:
https://autobuild.buildroot.net/results/942/942cb2dcd061b8620211b63d4be34dc414251b62/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...-Include-libgen.h-to-fix-musl-builds.patch | 100 ++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 package/ledmon/0001-Include-libgen.h-to-fix-musl-builds.patch

diff --git a/package/ledmon/0001-Include-libgen.h-to-fix-musl-builds.patch b/package/ledmon/0001-Include-libgen.h-to-fix-musl-builds.patch
new file mode 100644
index 0000000000..713aaee020
--- /dev/null
+++ b/package/ledmon/0001-Include-libgen.h-to-fix-musl-builds.patch
@@ -0,0 +1,100 @@
+From 95adecd3cc8e94f9964c34fdf0354c209acce166 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Thu, 27 Nov 2025 21:17:22 +0100
+Subject: [PATCH] Include libgen.h to fix musl builds
+
+Fixes various build errors like
+
+block.c: In function 'block_set_devnode':
+block.c:226:22: error: implicit declaration of function 'basename'
+ [-Wimplicit-function-declaration]
+  226 |         char *name = basename(device->sysfs_path);
+
+Upstream: https://github.com/md-raid-utilities/ledmon/pull/272
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+[Bernd: backported upstream PR to v1.1.0]
+---
+ src/ledctl/ledctl.c | 1 +
+ src/ledmon/ledmon.c | 1 +
+ src/lib/block.c     | 1 +
+ src/lib/npem.c      | 1 +
+ src/lib/slot.c      | 1 +
+ src/lib/vmdssd.c    | 1 +
+ 6 files changed, 6 insertions(+)
+
+diff --git a/src/ledctl/ledctl.c b/src/ledctl/ledctl.c
+index 30adc74..af2ea1b 100644
+--- a/src/ledctl/ledctl.c
++++ b/src/ledctl/ledctl.c
+@@ -5,6 +5,7 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <getopt.h>
++#include <libgen.h>
+ #include <linux/limits.h>
+ #include <inttypes.h>
+ #include <limits.h>
+diff --git a/src/ledmon/ledmon.c b/src/ledmon/ledmon.c
+index 37ef69a..4644492 100644
+--- a/src/ledmon/ledmon.c
++++ b/src/ledmon/ledmon.c
+@@ -5,6 +5,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <getopt.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <signal.h>
+ #include <stdint.h>
+diff --git a/src/lib/block.c b/src/lib/block.c
+index 23dc34f..afa7d57 100644
+--- a/src/lib/block.c
++++ b/src/lib/block.c
+@@ -3,6 +3,7 @@
+ 
+ #include <dirent.h>
+ #include <fcntl.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <stdint.h>
+ #include <stdio.h>
+diff --git a/src/lib/npem.c b/src/lib/npem.c
+index bdceee3..f980ba8 100644
+--- a/src/lib/npem.c
++++ b/src/lib/npem.c
+@@ -2,6 +2,7 @@
+ // Copyright (C) 2022 Intel Corporation.
+ 
+ #include <errno.h>
++#include <libgen.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <pci/pci.h>
+diff --git a/src/lib/slot.c b/src/lib/slot.c
+index 1044ddf..68e3009 100644
+--- a/src/lib/slot.c
++++ b/src/lib/slot.c
+@@ -1,6 +1,7 @@
+ // SPDX-License-Identifier: LGPL-2.1-or-later
+ // Copyright (C) 2023 Intel Corporation.
+ 
++#include <libgen.h>
+ #include <stdio.h>
+ #include <string.h>
+ 
+diff --git a/src/lib/vmdssd.c b/src/lib/vmdssd.c
+index 8a6e846..0270a7d 100644
+--- a/src/lib/vmdssd.c
++++ b/src/lib/vmdssd.c
+@@ -2,6 +2,7 @@
+ // Copyright (C) 2022 Intel Corporation.
+ 
+ #include <errno.h>
++#include <libgen.h>
+ #include <limits.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+-- 
+2.47.3
+
-- 
2.47.3

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

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

end of thread, other threads:[~2025-11-28 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-11  6:21 [Buildroot] [PATCH 1/1] package/ledmon: fix musl build Fabrice Fontaine
2024-05-11  6:58 ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2025-11-27 20:27 Bernd Kuhls
2025-11-28 17:40 ` Julien Olivain via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.