diff mbox series

[meta-oe] pmdk: Upgrade to 1.12.1

Message ID 20230303014519.345810-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe] pmdk: Upgrade to 1.12.1 | expand

Commit Message

Khem Raj March 3, 2023, 1:45 a.m. UTC
Add a patch to fix build with clang16

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...unction-prototypes-of-enum_to_str_fn.patch | 43 ++++++++++++
 ...axctl.h-instead-of-ndctl-libdaxctl.h.patch | 69 -------------------
 .../pmdk/{pmdk_1.11.1.bb => pmdk_1.12.1.bb}   |  6 +-
 3 files changed, 46 insertions(+), 72 deletions(-)
 create mode 100644 meta-oe/recipes-extended/pmdk/pmdk/0001-pmempool-Match-function-prototypes-of-enum_to_str_fn.patch
 delete mode 100644 meta-oe/recipes-extended/pmdk/pmdk/0001-use-daxctl-libdaxctl.h-instead-of-ndctl-libdaxctl.h.patch
 rename meta-oe/recipes-extended/pmdk/{pmdk_1.11.1.bb => pmdk_1.12.1.bb} (87%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/pmdk/pmdk/0001-pmempool-Match-function-prototypes-of-enum_to_str_fn.patch b/meta-oe/recipes-extended/pmdk/pmdk/0001-pmempool-Match-function-prototypes-of-enum_to_str_fn.patch
new file mode 100644
index 0000000000..b16b633a3b
--- /dev/null
+++ b/meta-oe/recipes-extended/pmdk/pmdk/0001-pmempool-Match-function-prototypes-of-enum_to_str_fn.patch
@@ -0,0 +1,43 @@ 
+From de6425acaa50426883e85a599001ae5e927aec5b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Mar 2023 16:23:56 -0800
+Subject: [PATCH] pmempool: Match function prototypes of enum_to_str_fn
+ function pointer
+
+This is flagged by clang 16+
+common.c:844:4: error: cast from 'const char *(*)(enum chunk_type)' to 'enum_to_str_fn' (aka 'const char *(*)(int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
+                        (enum_to_str_fn)out_get_chunk_type_str);
+                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1 error generated.
+
+Upstream-Status: Submitted [https://github.com/pmem/pmdk/pull/5543]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/tools/pmempool/common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/pmempool/common.c b/src/tools/pmempool/common.c
+index 5e7e472cc..4b7e9b95f 100644
+--- a/src/tools/pmempool/common.c
++++ b/src/tools/pmempool/common.c
+@@ -41,7 +41,7 @@
+ 
+ #define REQ_BUFF_SIZE	2048U
+ #define Q_BUFF_SIZE	8192
+-typedef const char *(*enum_to_str_fn)(int);
++typedef const char *(*enum_to_str_fn)(enum chunk_type);
+ 
+ /*
+  * pmem_pool_type -- return pool type based on first two pages.
+@@ -790,7 +790,7 @@ util_parse_enum(const char *str, int first, int max, uint64_t *bitmap,
+ 		enum_to_str_fn enum_to_str)
+ {
+ 	for (int i = first; i < max; i++) {
+-		if (strcmp(str, enum_to_str(i)) == 0) {
++		if (strcmp(str, enum_to_str((enum chunk_type)i)) == 0) {
+ 			*bitmap |= (uint64_t)1<<i;
+ 			return 0;
+ 		}
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-extended/pmdk/pmdk/0001-use-daxctl-libdaxctl.h-instead-of-ndctl-libdaxctl.h.patch b/meta-oe/recipes-extended/pmdk/pmdk/0001-use-daxctl-libdaxctl.h-instead-of-ndctl-libdaxctl.h.patch
deleted file mode 100644
index 0b03ffdea5..0000000000
--- a/meta-oe/recipes-extended/pmdk/pmdk/0001-use-daxctl-libdaxctl.h-instead-of-ndctl-libdaxctl.h.patch
+++ /dev/null
@@ -1,69 +0,0 @@ 
-From 932252c0ba54a51c8bcf58b747656e29cdebfa6a Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 26 Mar 2022 13:06:50 -0700
-Subject: [PATCH] use daxctl/libdaxctl.h instead of ndctl/libdaxctl.h
-
-Upstream-Status: Submitted [https://github.com/pmem/pmdk/pull/5413]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/libpmem2/badblocks_ndctl.c        | 2 +-
- src/libpmem2/region_namespace_ndctl.c | 2 +-
- src/libpmem2/usc_ndctl.c              | 2 +-
- src/tools/daxio/daxio.c               | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/libpmem2/badblocks_ndctl.c b/src/libpmem2/badblocks_ndctl.c
-index 9a5910bba..cc637f7f4 100644
---- a/src/libpmem2/badblocks_ndctl.c
-+++ b/src/libpmem2/badblocks_ndctl.c
-@@ -16,7 +16,7 @@
- #include <sys/sysmacros.h>
- #include <fcntl.h>
- #include <ndctl/libndctl.h>
--#include <ndctl/libdaxctl.h>
-+#include <daxctl/libdaxctl.h>
- 
- #include "libpmem2.h"
- #include "pmem2_utils.h"
-diff --git a/src/libpmem2/region_namespace_ndctl.c b/src/libpmem2/region_namespace_ndctl.c
-index 1383796a9..e31185984 100644
---- a/src/libpmem2/region_namespace_ndctl.c
-+++ b/src/libpmem2/region_namespace_ndctl.c
-@@ -6,7 +6,7 @@
-  */
- 
- #include <ndctl/libndctl.h>
--#include <ndctl/libdaxctl.h>
-+#include <daxctl/libdaxctl.h>
- #include <sys/sysmacros.h>
- #include <fcntl.h>
- 
-diff --git a/src/libpmem2/usc_ndctl.c b/src/libpmem2/usc_ndctl.c
-index be63e879b..c58032a83 100644
---- a/src/libpmem2/usc_ndctl.c
-+++ b/src/libpmem2/usc_ndctl.c
-@@ -5,7 +5,7 @@
-  * usc_ndctl.c -- pmem2 usc function for platforms using ndctl
-  */
- #include <ndctl/libndctl.h>
--#include <ndctl/libdaxctl.h>
-+#include <daxctl/libdaxctl.h>
- #include <sys/types.h>
- #include <sys/sysmacros.h>
- #include <fcntl.h>
-diff --git a/src/tools/daxio/daxio.c b/src/tools/daxio/daxio.c
-index 66cd0b7ae..7f2c89d48 100644
---- a/src/tools/daxio/daxio.c
-+++ b/src/tools/daxio/daxio.c
-@@ -21,7 +21,7 @@
- #include <string.h>
- 
- #include <ndctl/libndctl.h>
--#include <ndctl/libdaxctl.h>
-+#include <daxctl/libdaxctl.h>
- #include <libpmem.h>
- 
- #include "util.h"
--- 
-2.35.1
-
diff --git a/meta-oe/recipes-extended/pmdk/pmdk_1.11.1.bb b/meta-oe/recipes-extended/pmdk/pmdk_1.12.1.bb
similarity index 87%
rename from meta-oe/recipes-extended/pmdk/pmdk_1.11.1.bb
rename to meta-oe/recipes-extended/pmdk/pmdk_1.12.1.bb
index 33d04099c9..ccbb88ff67 100644
--- a/meta-oe/recipes-extended/pmdk/pmdk_1.11.1.bb
+++ b/meta-oe/recipes-extended/pmdk/pmdk_1.12.1.bb
@@ -11,9 +11,9 @@  DEPENDS:append:libc-musl = " fts"
 
 S = "${WORKDIR}/git"
 
-SRC_URI = "git://github.com/pmem/pmdk.git;branch=stable-1.11;protocol=https \
-           file://0001-use-daxctl-libdaxctl.h-instead-of-ndctl-libdaxctl.h.patch"
-SRCREV = "5b21904a257eff47f2e87fcbf2de46111f03ddd8"
+SRC_URI = "git://github.com/pmem/pmdk.git;branch=stable-1.12;protocol=https \
+           file://0001-pmempool-Match-function-prototypes-of-enum_to_str_fn.patch"
+SRCREV = "786098a024c6fe60e746f2cb1041bcfcd21386c9"
 
 inherit autotools-brokensep pkgconfig