diff --git a/meta-networking/recipes-daemons/autofs/autofs/0010-misc-Use-autofs_strerror_r-with-non-glibc-C-librarie.patch b/meta-networking/recipes-daemons/autofs/autofs/0010-misc-Use-autofs_strerror_r-with-non-glibc-C-librarie.patch new file mode 100644 index 0000000000..467d518a42 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs/0010-misc-Use-autofs_strerror_r-with-non-glibc-C-librarie.patch @@ -0,0 +1,34 @@ +From: Khem Raj +Date: Thu, 12 Nov 2026 00:00:00 -0800 +Subject: [PATCH] misc: Use autofs_strerror_r() with non-glibc C libraries + +The open/close on exec functions moved to lib/misc.c expect the GNU +strerror_r() that returns a char pointer. Unlike the rest of autofs, +misc.c does not include automount.h, which maps strerror_r() to +autofs_strerror_r() when not building with glibc, so the build fails with +musl: + + misc.c:96:8: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] + +Do the same mapping in misc.c. + +Upstream-Status: Submitted [https://lore.kernel.org/autofs/20261113043743.2721837-1-raj.khem@gmail.com/] +Signed-off-by: Khem Raj +--- + lib/misc.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/lib/misc.c ++++ b/lib/misc.c +@@ -30,6 +30,11 @@ + #include "log.h" + #include "misc.h" + ++#ifndef __GLIBC__ ++# define strerror_r(N,B,S) autofs_strerror_r(N,B,S) ++char *autofs_strerror_r(int errnum, char *buf, size_t buflen); /* GNU */ ++#endif ++ + #define MAX_ERR_BUF 128 + + static pthread_mutex_t open_mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.2.0.bb b/meta-networking/recipes-daemons/autofs/autofs_5.2.0.bb index e8a00283e6..879bb02888 100644 --- a/meta-networking/recipes-daemons/autofs/autofs_5.2.0.bb +++ b/meta-networking/recipes-daemons/autofs/autofs_5.2.0.bb @@ -19,6 +19,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \ file://0007-Avoid-conflicts-between-sys-mount.h-and-linux-mount..patch \ file://0008-include-libgen.h-for-basename.patch \ file://0009-hash.h-include-sys-reg.h-instead-of-bits-reg.h.patch \ + file://0010-misc-Use-autofs_strerror_r-with-non-glibc-C-librarie.patch \ " SRC_URI[sha256sum] = "966bcacb571a7000a4d2afda0db5f7af84e4ef2444f04d7fc17898f1d2409c6b"