All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6
@ 2022-08-13 18:44 Fabrice Fontaine
  2022-08-14 10:16 ` Thomas Petazzoni via buildroot
  2022-09-15  8:36 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-08-13 18:44 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Fabrice Fontaine

Fix the following build failure with kernel >= 5.1 and < 5.6 (i.e.
before
https://github.com/torvalds/linux/commit/9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf)
raised since bump to version 0.12.02 in commit
e551fe76e2073f15b0fcf92a73bb6b7334b017b3 and
https://github.com/ColinIanKing/stress-ng/commit/3d6fccdbe53d0cbcb75dd4b91571aaaae7ee1ad4:

In file included from stress-io-uring.c:26:
io-uring.h:1:9: error: macro names must be identifiers
    1 | #define #define HAVE_IORING_OP_NOP 0
      |         ^

Fixes:
 - http://autobuild.buildroot.org/results/1bf3f2bbc849bdce531d56b1024fa87f0c1ae667

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...1-Makefile-fix-build-with-kernel-5.6.patch | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 package/stress-ng/0001-Makefile-fix-build-with-kernel-5.6.patch

diff --git a/package/stress-ng/0001-Makefile-fix-build-with-kernel-5.6.patch b/package/stress-ng/0001-Makefile-fix-build-with-kernel-5.6.patch
new file mode 100644
index 0000000000..4c62da3241
--- /dev/null
+++ b/package/stress-ng/0001-Makefile-fix-build-with-kernel-5.6.patch
@@ -0,0 +1,60 @@
+From 5d419c790e648c7a2f96f34ed1b93b326f725545 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 13 Aug 2022 17:17:05 +0200
+Subject: [PATCH] Makefile: fix build with kernel < 5.6
+
+Fix the following build failure with kernel >= 5.1 and < 5.5 (i.e.
+before
+https://github.com/torvalds/linux/commit/9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf)
+raised since version 0.11.21 and
+https://github.com/ColinIanKing/stress-ng/commit/3d6fccdbe53d0cbcb75dd4b91571aaaae7ee1ad4:
+
+In file included from stress-io-uring.c:26:
+io-uring.h:1:9: error: macro names must be identifiers
+    1 | #define #define HAVE_IORING_OP_NOP 0
+      |         ^
+
+Moreover, IORING_OP_FALLOCATE is not available before kernel 5.6 and
+https://github.com/torvalds/linux/commit/d63d1b5edb7b832210bfde587ba9e7549fa064eb
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1bf3f2bbc849bdce531d56b1024fa87f0c1ae667
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved (and backported) from
+https://github.com/ColinIanKing/stress-ng/commit/5d419c790e648c7a2f96f34ed1b93b326f725545]
+---
+ Makefile          | 2 +-
+ stress-io-uring.c | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 2f9cc9918..ee17ae08b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -528,7 +528,7 @@ stress-personality.c: personality.h
+ #
+ io-uring.h:
+ 	$(V)$(CPP) $(CFLAGS) core-io-uring.c  | $(GREP) IORING_OP | sed 's/,//' | \
+-	sed 's/IORING_OP_/#define HAVE_IORING_OP_/' > io-uring.h
++	sed 's/.*\(IORING_OP_.*\)/#define HAVE_\1/' > io-uring.h
+ 	$(Q)echo "MK io-uring.h"
+ 
+ stress-io-uring.c: io-uring.h
+diff --git a/stress-io-uring.c b/stress-io-uring.c
+index ab9fd0749..84f463611 100644
+--- a/stress-io-uring.c
++++ b/stress-io-uring.c
+@@ -311,7 +311,11 @@ static inline int stress_io_uring_complete(
+ 			break;
+ 
+ 		cqe = &cring->cqes[head & *submit->cq_ring.ring_mask];
+-		if ((cqe->res < 0) && (opcode != IORING_OP_FALLOCATE)) {
++		if ((cqe->res < 0)
++#ifdef HAVE_IORING_OP_FALLOCATE
++			&& (opcode != IORING_OP_FALLOCATE)
++#endif
++		) {
+ 			const int err = abs(cqe->res);
+ 
+ 			/* Silently ignore EOPNOTSUPP completion errors */
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6
  2022-08-13 18:44 [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6 Fabrice Fontaine
@ 2022-08-14 10:16 ` Thomas Petazzoni via buildroot
  2022-09-15  8:36 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-14 10:16 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Romain Naour, buildroot

On Sat, 13 Aug 2022 20:44:48 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure with kernel >= 5.1 and < 5.6 (i.e.
> before
> https://github.com/torvalds/linux/commit/9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf)
> raised since bump to version 0.12.02 in commit
> e551fe76e2073f15b0fcf92a73bb6b7334b017b3 and
> https://github.com/ColinIanKing/stress-ng/commit/3d6fccdbe53d0cbcb75dd4b91571aaaae7ee1ad4:
> 
> In file included from stress-io-uring.c:26:
> io-uring.h:1:9: error: macro names must be identifiers
>     1 | #define #define HAVE_IORING_OP_NOP 0
>       |         ^
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/1bf3f2bbc849bdce531d56b1024fa87f0c1ae667
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...1-Makefile-fix-build-with-kernel-5.6.patch | 60 +++++++++++++++++++
>  1 file changed, 60 insertions(+)
>  create mode 100644 package/stress-ng/0001-Makefile-fix-build-with-kernel-5.6.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6
  2022-08-13 18:44 [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6 Fabrice Fontaine
  2022-08-14 10:16 ` Thomas Petazzoni via buildroot
@ 2022-09-15  8:36 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-09-15  8:36 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Romain Naour, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with kernel >= 5.1 and < 5.6 (i.e.
 > before
 > https://github.com/torvalds/linux/commit/9e3aa61ae3e01ce1ce6361a41ef725e1f4d1d2bf)
 > raised since bump to version 0.12.02 in commit
 > e551fe76e2073f15b0fcf92a73bb6b7334b017b3 and
 > https://github.com/ColinIanKing/stress-ng/commit/3d6fccdbe53d0cbcb75dd4b91571aaaae7ee1ad4:

 > In file included from stress-io-uring.c:26:
 > io-uring.h:1:9: error: macro names must be identifiers
 >     1 | #define #define HAVE_IORING_OP_NOP 0
 >       |         ^

 > Fixes:
 >  - http://autobuild.buildroot.org/results/1bf3f2bbc849bdce531d56b1024fa87f0c1ae667

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-15  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-13 18:44 [Buildroot] [PATCH 1/1] package/stress-ng: fix build with kernel >= 5.1 and < 5.6 Fabrice Fontaine
2022-08-14 10:16 ` Thomas Petazzoni via buildroot
2022-09-15  8:36 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.