diff mbox series

[meta-oe,02/10] ndctl: Fix build issues seen with musl 1.2.5

Message ID 20240326015047.543274-2-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/10] sanlock: Fix build with musl >= 1.2.5 | expand

Commit Message

Khem Raj March 26, 2024, 1:50 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-include-libgen.h-for-basename.patch  | 32 +++++++++++++++++++
 meta-oe/recipes-core/ndctl/ndctl_v78.bb       |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-core/ndctl/ndctl/0001-include-libgen.h-for-basename.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/ndctl/ndctl/0001-include-libgen.h-for-basename.patch b/meta-oe/recipes-core/ndctl/ndctl/0001-include-libgen.h-for-basename.patch
new file mode 100644
index 0000000000..9de0a715bf
--- /dev/null
+++ b/meta-oe/recipes-core/ndctl/ndctl/0001-include-libgen.h-for-basename.patch
@@ -0,0 +1,32 @@ 
+From d7f01c310b74e3579a6474362922f173ac656d7b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 25 Mar 2024 15:41:29 -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: Submitted [https://github.com/pmem/ndctl/pull/263]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ daxctl/device.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/daxctl/device.c b/daxctl/device.c
+index d2d206b..e607a19 100644
+--- a/daxctl/device.c
++++ b/daxctl/device.c
+@@ -2,6 +2,7 @@
+ /* Copyright (C) 2019-2020 Intel Corporation. All rights reserved. */
+ #include <stdio.h>
+ #include <errno.h>
++#include <libgen.h>
+ #include <stdlib.h>
+ #include <syslog.h>
+ #include <unistd.h>
+-- 
+2.44.0
+
diff --git a/meta-oe/recipes-core/ndctl/ndctl_v78.bb b/meta-oe/recipes-core/ndctl/ndctl_v78.bb
index 2974a7db7f..907c02c7c8 100644
--- a/meta-oe/recipes-core/ndctl/ndctl_v78.bb
+++ b/meta-oe/recipes-core/ndctl/ndctl_v78.bb
@@ -11,7 +11,8 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=74a614eac8b2657a4b8e6607421a0883"
 inherit meson pkgconfig bash-completion systemd
 
 SRCREV = "a871e6153b11fe63780b37cdcb1eb347b296095c"
-SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https"
+SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https \
+           file://0001-include-libgen.h-for-basename.patch"
 
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>v\d+(\.\d+)*)"