strace/0003-build-regenerate-build-deps.patch
fu.lin 26facf1313 build: fix static_assert build error
The same as https://github.com/strace/strace/issues/138
Upstream patch:
- fded17c15b
- 592b915033

spec: disable check after building

Signed-off-by: fu.lin <fulin10@huawei.com>
(cherry picked from commit 509bf53588045e5f0f795b514c77197b480f0c56)
2021-04-29 16:11:04 +08:00

164 lines
5.7 KiB
Diff

From 1fb2d37673c140853141459089fa6213bdaaac3a Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Tue, 27 Apr 2021 16:23:35 +0800
Subject: [PATCH 3/3] build: regenerate build deps
---
config.h.in | 7 ++++--
configure | 18 +++++++++++----
types/check-io_uring.c | 6 ++---
types/check-io_uring.m4 | 2 +-
xlat/uring_cqring_flags.h | 48 +++++++++++++++++++++++++++++++++++++++
5 files changed, 71 insertions(+), 10 deletions(-)
create mode 100644 xlat/uring_cqring_flags.h
diff --git a/config.h.in b/config.h.in
index 4cd5c2b..f736603 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1378,8 +1378,11 @@
/* Define to 1 if the system has the type `struct io_cqring_offsets'. */
#undef HAVE_STRUCT_IO_CQRING_OFFSETS
-/* Define to 1 if `resv' is a member of `struct io_cqring_offsets'. */
-#undef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV
+/* Define to 1 if `flags' is a member of `struct io_cqring_offsets'. */
+#undef HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS
+
+/* Define to 1 if `resv2' is a member of `struct io_cqring_offsets'. */
+#undef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV2
/* Define to 1 if the system has the type `struct io_sqring_offsets'. */
#undef HAVE_STRUCT_IO_SQRING_OFFSETS
diff --git a/configure b/configure
index a91d4a1..ba67b3d 100755
--- a/configure
+++ b/configure
@@ -12307,7 +12307,17 @@ if test "x$ac_cv_header_linux_io_uring_h" = xyes; then :
#define HAVE_LINUX_IO_URING_H 1
_ACEOF
- ac_fn_c_check_member "$LINENO" "struct io_uring_params" "features" "ac_cv_member_struct_io_uring_params_features" "#include <linux/io_uring.h>
+ ac_fn_c_check_member "$LINENO" "struct io_cqring_offsets" "flags" "ac_cv_member_struct_io_cqring_offsets_flags" "#include <linux/io_uring.h>
+"
+if test "x$ac_cv_member_struct_io_cqring_offsets_flags" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IO_CQRING_OFFSETS_FLAGS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct io_uring_params" "features" "ac_cv_member_struct_io_uring_params_features" "#include <linux/io_uring.h>
"
if test "x$ac_cv_member_struct_io_uring_params_features" = xyes; then :
@@ -13375,13 +13385,13 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_IO_CQRING_OFFSETS 1
_ACEOF
-ac_fn_c_check_member "$LINENO" "struct io_cqring_offsets" "resv" "ac_cv_member_struct_io_cqring_offsets_resv" "$ac_includes_default
+ac_fn_c_check_member "$LINENO" "struct io_cqring_offsets" "resv2" "ac_cv_member_struct_io_cqring_offsets_resv2" "$ac_includes_default
#include <linux/io_uring.h>
"
-if test "x$ac_cv_member_struct_io_cqring_offsets_resv" = xyes; then :
+if test "x$ac_cv_member_struct_io_cqring_offsets_resv2" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IO_CQRING_OFFSETS_RESV 1
+#define HAVE_STRUCT_IO_CQRING_OFFSETS_RESV2 1
_ACEOF
diff --git a/types/check-io_uring.c b/types/check-io_uring.c
index dc21569..de18ebf 100644
--- a/types/check-io_uring.c
+++ b/types/check-io_uring.c
@@ -14,13 +14,13 @@ static_assert(sizeof(struct io_sqring_offsets) <= offsetof(struct_io_sqring_offs
#endif /* HAVE_STRUCT_IO_SQRING_OFFSETS */
#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS
-# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV
+# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV2
static_assert(sizeof(struct io_cqring_offsets) == sizeof(struct_io_cqring_offsets),
"struct io_cqring_offsets size mismatch, please update the decoder or fix the kernel");
# else
-static_assert(sizeof(struct io_cqring_offsets) <= offsetof(struct_io_cqring_offsets, resv),
+static_assert(sizeof(struct io_cqring_offsets) <= offsetof(struct_io_cqring_offsets, resv2),
"struct io_cqring_offsets size mismatch, please update the decoder or fix the kernel");
-# endif /* HAVE_STRUCT_IO_CQRING_OFFSETS_RESV */
+# endif /* HAVE_STRUCT_IO_CQRING_OFFSETS_RESV2 */
#endif /* HAVE_STRUCT_IO_CQRING_OFFSETS */
#ifdef HAVE_STRUCT_IO_URING_PARAMS
diff --git a/types/check-io_uring.m4 b/types/check-io_uring.m4
index c38ad38..d70b845 100644
--- a/types/check-io_uring.m4
+++ b/types/check-io_uring.m4
@@ -8,7 +8,7 @@ AC_CHECK_TYPES([struct io_sqring_offsets],
#include <linux/io_uring.h>])
AC_CHECK_TYPES([struct io_cqring_offsets],
-[AC_CHECK_MEMBERS([struct io_cqring_offsets.resv],,,[AC_INCLUDES_DEFAULT
+[AC_CHECK_MEMBERS([struct io_cqring_offsets.resv2],,,[AC_INCLUDES_DEFAULT
#include <linux/io_uring.h>])],,[AC_INCLUDES_DEFAULT
#include <linux/io_uring.h>])
diff --git a/xlat/uring_cqring_flags.h b/xlat/uring_cqring_flags.h
new file mode 100644
index 0000000..0352749
--- /dev/null
+++ b/xlat/uring_cqring_flags.h
@@ -0,0 +1,48 @@
+/* Generated by ./xlat/gen.sh from ./xlat/uring_cqring_flags.in; do not edit. */
+
+#include "gcc_compat.h"
+#include "static_assert.h"
+
+#if defined(IORING_CQ_EVENTFD_DISABLED) || (defined(HAVE_DECL_IORING_CQ_EVENTFD_DISABLED) && HAVE_DECL_IORING_CQ_EVENTFD_DISABLED)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((IORING_CQ_EVENTFD_DISABLED) == (1U), "IORING_CQ_EVENTFD_DISABLED != 1U");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define IORING_CQ_EVENTFD_DISABLED 1U
+#endif
+
+#ifndef XLAT_MACROS_ONLY
+
+# ifdef IN_MPERS
+
+# error static const struct xlat uring_cqring_flags in mpers mode
+
+# else
+
+static const struct xlat_data uring_cqring_flags_xdata[] = {
+ XLAT(IORING_CQ_EVENTFD_DISABLED),
+ #define XLAT_VAL_0 ((unsigned) (IORING_CQ_EVENTFD_DISABLED))
+ #define XLAT_STR_0 STRINGIFY(IORING_CQ_EVENTFD_DISABLED)
+};
+static
+const struct xlat uring_cqring_flags[1] = { {
+ .data = uring_cqring_flags_xdata,
+ .size = ARRAY_SIZE(uring_cqring_flags_xdata),
+ .type = XT_NORMAL,
+ .flags_mask = 0
+# ifdef XLAT_VAL_0
+ | XLAT_VAL_0
+# endif
+ ,
+ .flags_strsz = 0
+# ifdef XLAT_STR_0
+ + sizeof(XLAT_STR_0)
+# endif
+ ,
+} };
+
+# undef XLAT_STR_0
+# undef XLAT_VAL_0
+# endif /* !IN_MPERS */
+
+#endif /* !XLAT_MACROS_ONLY */
--
2.27.0