Skip to contentSkip to conversation

libnvme: upgrade 1.5 -> 1.6

PATCH In review [email protected] 2 participants 3 messages Oct 8, 2023 – Oct 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 libnvme: upgrade 1.5 -> 1.6

From: Christophe Vu-Brugier <[email protected]>

Backport upstream patch to fix build with musl.

---
 ...01-test-handle-POSIX-ioctl-prototype.patch | 68 +++++++++++++++++++
 .../{libnvme_1.5.bb => libnvme_1.6.bb}        |  2 +-
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/libnvme/libnvme/0001-test-handle-POSIX-ioctl-prototype.patch
 rename meta-oe/recipes-support/libnvme/{libnvme_1.5.bb => libnvme_1.6.bb} (94%)
meta-oe/recipes-support/libnvme/libnvme/0001-test-handle-POSIX-ioctl-prototype.patch new file +68 -0
new file mode 100644
index 000000000..ef9cc47d2
@@ -0,0 +1,68 @@
+From ca47ba3119365eafac0ab25a86cab9d9a1b29bd4 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 30 Sep 2023 06:38:53 +0100
+Subject: [PATCH] test: handle POSIX ioctl prototype
+
+glibc has the following prototype for ioctl: int ioctl(int fd, unsigned long request, ...)
+POSIX (inc. musl) has the following for ioctl: int ioctl(int fd, int request, ...)
+
+Check which prototype is used in <sys/ioctl.h> to avoid a conflict and conditionally
+define the right one for the system.
+
+Bug: https://bugs.gentoo.org/914921
+Signed-off-by: Sam James <[email protected]>
+Upstream-Status: Backport [https://github.com/linux-nvme/libnvme/commit/ca47ba3119365eafac0ab25a86cab9d9a1b29bd4]
+---
+ meson.build       | 10 ++++++++++
+ test/ioctl/mock.c |  6 +++++-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 6fcf1da..2c979cc 100644
+--- a/meson.build
++++ b/meson.build
+@@ -230,6 +230,16 @@ conf.set(
+     ),
+     description: 'Is network address and service translation available'
+ )
++conf.set(
++    'HAVE_GLIBC_IOCTL',
++    cc.compiles(
++        '''#include <sys/ioctl.h>
++        int ioctl(int fd, unsigned long request, ...);
++        ''',
++        name: 'ioctl has glibc-style prototype'
++    ),
++    description: 'Is ioctl the glibc interface (rather than POSIX)'
++)
+ 
+ if cc.has_function_attribute('fallthrough')
+   conf.set('fallthrough', '__attribute__((__fallthrough__))')
+diff --git a/test/ioctl/mock.c b/test/ioctl/mock.c
+index e917244..5d2ac94 100644
+--- a/test/ioctl/mock.c
++++ b/test/ioctl/mock.c
+@@ -114,7 +114,11 @@ void end_mock_cmds(void)
+ 	} \
+ })
+ 
++#ifdef HAVE_GLIBC_IOCTL
+ int ioctl(int fd, unsigned long request, ...)
++#else
++int ioctl(int fd, int request, ...)
++#endif
+ {
+ 	struct mock_cmds *mock_cmds;
+ 	bool result64;
+@@ -141,7 +145,7 @@ int ioctl(int fd, unsigned long request, ...)
+ 		result64 = true;
+ 		break;
+ 	default:
+-		fail("unexpected %s %lu", __func__, request);
++		fail("unexpected %s %lu", __func__, (unsigned long) request);
+ 	}
+ 	check(mock_cmds->remaining_cmds,
+ 	      "unexpected %s command", mock_cmds->name);
+-- 
+2.40.1
+
meta-oe/recipes-support/libnvme/libnvme_1.6.bb renamed from meta-oe/recipes-support/libnvme/libnvme_1.5.bb +1 -1
similarity index 94%
rename from meta-oe/recipes-support/libnvme/libnvme_1.5.bb
rename to meta-oe/recipes-support/libnvme/libnvme_1.6.bb
index 4b6f1e30b..37e5d6301 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://ccan/licenses/CC0;md5=c17af43b05840255a6fedc5eda9d56cc \
                     file://ccan/licenses/BSD-MIT;md5=838c366f69b72c5df05c96dff79b35f2"
 DEPENDS = "json-c"
-SRCREV = "4fea83db8328ea788ea8f1001e8ce1cb80ef5fae"
+SRCREV = "37a803cf77e224f66d86b1e1d9e74a15f55ea600"
 
 SRC_URI = "git://github.com/linux-nvme/libnvme;protocol=https;branch=master"
 
Signature · 1 line
2.40.1
#1 lore raw

PATCH v2 2/2 nvme-cli: upgrade 2.5 -> 2.6

From: Christophe Vu-Brugier <[email protected]>

---
 .../recipes-bsp/nvme-cli/{nvme-cli_2.5.bb => nvme-cli_2.6.bb}   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-bsp/nvme-cli/{nvme-cli_2.5.bb => nvme-cli_2.6.bb} (95%)
meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.6.bb renamed from meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.5.bb +1 -1
similarity index 95%
rename from meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.5.bb
rename to meta-oe/recipes-bsp/nvme-cli/nvme-cli_2.6.bb
index 492de65a8..0d8923f34 100644
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022 \
                     file://ccan/licenses/CC0;md5=c17af43b05840255a6fedc5eda9d56cc \
                     file://ccan/licenses/BSD-MIT;md5=838c366f69b72c5df05c96dff79b35f2"
 DEPENDS = "json-c libnvme"
-SRCREV = "d6c07e0de9be777009ebb9ab7475bee1ae3e0e95"
+SRCREV = "bd2f882a49a14b0e21a94c928128b1979e4316fd"
 
 SRC_URI = "git://github.com/linux-nvme/nvme-cli.git;branch=master;protocol=https"
 
Signature · 1 line
2.40.1
#2 lore raw
In reply to [email protected]
Quoted 4 lines · Christophe Vu-Brugier

From: Christophe Vu-Brugier <[email protected]>

Backport upstream patch to fix build with musl.

This seems an improvement over what I applied to master already. So please rebase your patch on top of latest master and resend please.

Quoted 109 lines
---
  ...01-test-handle-POSIX-ioctl-prototype.patch | 68 +++++++++++++++++++
  .../{libnvme_1.5.bb => libnvme_1.6.bb}        |  2 +-
  2 files changed, 69 insertions(+), 1 deletion(-)

create mode 100644 meta-oe/recipes-support/libnvme/libnvme/0001-test-handle-POSIX-ioctl-prototype.patch rename meta-oe/recipes-support/libnvme/{libnvme_1.5.bb => libnvme_1.6.bb} (94%)

meta-oe/recipes-support/libnvme/libnvme/0001-test-handle-POSIX-ioctl-prototype.patch new file +68 -0
new file mode 100644
index 000000000..ef9cc47d2
@@ -0,0 +1,68 @@
+From ca47ba3119365eafac0ab25a86cab9d9a1b29bd4 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 30 Sep 2023 06:38:53 +0100
+Subject: [PATCH] test: handle POSIX ioctl prototype
+
+glibc has the following prototype for ioctl: int ioctl(int fd, unsigned long request, ...)
+POSIX (inc. musl) has the following for ioctl: int ioctl(int fd, int request, ...)
+
+Check which prototype is used in <sys/ioctl.h> to avoid a conflict and conditionally
+define the right one for the system.
+
+Bug: https://bugs.gentoo.org/914921
+Signed-off-by: Sam James <[email protected]>
+Upstream-Status: Backport [https://github.com/linux-nvme/libnvme/commit/ca47ba3119365eafac0ab25a86cab9d9a1b29bd4]
+---
+ meson.build       | 10 ++++++++++
+ test/ioctl/mock.c |  6 +++++-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 6fcf1da..2c979cc 100644
+--- a/meson.build
++++ b/meson.build
+@@ -230,6 +230,16 @@ conf.set(
+     ),
+     description: 'Is network address and service translation available'
+ )
++conf.set(
++    'HAVE_GLIBC_IOCTL',
++    cc.compiles(
++        '''#include <sys/ioctl.h>
++        int ioctl(int fd, unsigned long request, ...);
++        ''',
++        name: 'ioctl has glibc-style prototype'
++    ),
++    description: 'Is ioctl the glibc interface (rather than POSIX)'
++)
+
+ if cc.has_function_attribute('fallthrough')
+   conf.set('fallthrough', '__attribute__((__fallthrough__))')
+diff --git a/test/ioctl/mock.c b/test/ioctl/mock.c
+index e917244..5d2ac94 100644
+--- a/test/ioctl/mock.c
++++ b/test/ioctl/mock.c
+@@ -114,7 +114,11 @@ void end_mock_cmds(void)
+ 	} \
+ })
+
++#ifdef HAVE_GLIBC_IOCTL
+ int ioctl(int fd, unsigned long request, ...)
++#else
++int ioctl(int fd, int request, ...)
++#endif
+ {
+ 	struct mock_cmds *mock_cmds;
+ 	bool result64;
+@@ -141,7 +145,7 @@ int ioctl(int fd, unsigned long request, ...)
+ 		result64 = true;
+ 		break;
+ 	default:
+-		fail("unexpected %s %lu", __func__, request);
++		fail("unexpected %s %lu", __func__, (unsigned long) request);
+ 	}
+ 	check(mock_cmds->remaining_cmds,
+ 	      "unexpected %s command", mock_cmds->name);
+--
+2.40.1
+
meta-oe/recipes-support/libnvme/libnvme_1.6.bb renamed from meta-oe/recipes-support/libnvme/libnvme_1.5.bb +1 -2
similarity index 94%
rename from meta-oe/recipes-support/libnvme/libnvme_1.5.bb
rename to meta-oe/recipes-support/libnvme/libnvme_1.6.bb
index 4b6f1e30b..37e5d6301 100644
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                      file://ccan/licenses/CC0;md5=c17af43b05840255a6fedc5eda9d56cc \
                      file://ccan/licenses/BSD-MIT;md5=838c366f69b72c5df05c96dff79b35f2"
  DEPENDS = "json-c"
-SRCREV = "4fea83db8328ea788ea8f1001e8ce1cb80ef5fae"
+SRCREV = "37a803cf77e224f66d86b1e1d9e74a15f55ea600"
 
  SRC_URI = "git://github.com/linux-nvme/libnvme;protocol=https;branch=master"
 
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#105387): https://lists.openembedded.org/g/openembedded-devel/message/105387
Mute This Topic: https://lists.openembedded.org/mt/101835099/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-