diff mbox series

[meta-networking,4/4] autofs: Fix build with musl >= 1.2.5

Message ID 20240325194825.641241-4-raj.khem@gmail.com
State New
Headers show
Series [meta-networking,1/4] net-snmp: Fix build with musl | expand

Commit Message

Khem Raj March 25, 2024, 7:48 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-include-libgen.h-for-basename.patch  | 58 +++++++++++++++++++
 .../recipes-daemons/autofs/autofs_5.1.8.bb    |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/autofs/autofs/0001-include-libgen.h-for-basename.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-daemons/autofs/autofs/0001-include-libgen.h-for-basename.patch b/meta-networking/recipes-daemons/autofs/autofs/0001-include-libgen.h-for-basename.patch
new file mode 100644
index 0000000000..4c8b4ef779
--- /dev/null
+++ b/meta-networking/recipes-daemons/autofs/autofs/0001-include-libgen.h-for-basename.patch
@@ -0,0 +1,58 @@ 
+From 1651e7a35be8b3e2fa90ca57b073f6944664fa62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 25 Mar 2024 12:04:03 -0700
+Subject: [PATCH] include libgen.h for basename
+
+basename prototype has been removed from string.h from latest musl [1]
+compilers e.g. clang-18 flags the absense of prototype as error. therefore
+include libgen.h for providing it.
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ daemon/automount.c    | 1 +
+ daemon/master.c       | 1 +
+ modules/lookup_file.c | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/daemon/automount.c b/daemon/automount.c
+index 3d9461d..61b3478 100644
+--- a/daemon/automount.c
++++ b/daemon/automount.c
+@@ -21,6 +21,7 @@
+ 
+ #include <dirent.h>
+ #include <getopt.h>
++#include <libgen.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/daemon/master.c b/daemon/master.c
+index f99359c..3f56499 100644
+--- a/daemon/master.c
++++ b/daemon/master.c
+@@ -21,6 +21,7 @@
+ #include <string.h>
+ #include <memory.h>
+ #include <limits.h>
++#include <libgen.h>
+ #include <signal.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff --git a/modules/lookup_file.c b/modules/lookup_file.c
+index 6afc558..82b1f28 100644
+--- a/modules/lookup_file.c
++++ b/modules/lookup_file.c
+@@ -15,6 +15,7 @@
+ 
+ #include <stdio.h>
+ #include <malloc.h>
++#include <libgen.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
+-- 
+2.44.0
+
diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.1.8.bb b/meta-networking/recipes-daemons/autofs/autofs_5.1.8.bb
index ca11f1a170..e3f9777380 100644
--- a/meta-networking/recipes-daemons/autofs/autofs_5.1.8.bb
+++ b/meta-networking/recipes-daemons/autofs/autofs_5.1.8.bb
@@ -29,6 +29,7 @@  SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
            file://mount_conflict.patch \
            file://0001-autofs-5.1.8-add-autofs_strerror_r-helper-for-musl.patch \
            file://0002-autofs-5.1.8-handle-innetgr-not-present-in-musl.patch \
+           file://0001-include-libgen.h-for-basename.patch \
            "
 SRC_URI[sha256sum] = "0bd401c56f0eb1ca6251344c3a3d70bface3eccf9c67117cd184422c4cace30c"