From 8dda6b8ddbe18b6bb83cf1fa6bc71ebdc82e1b72 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 10 Nov 2020 10:53:58 +0800 Subject: [PATCH] uring: fix build against 5.8 libc-headers To get strace building against v5.8 headers before the next version of strace is released, we need to copy in a bootstrapped file from the latest git (xlat/uring_cqring_flags.h) and remove remove unnecessary asserts for v5.8+ (in a similar manner to the main strace repository). Upstream-status: inappropriate. oe specific (upstream builds bootstrap) Signed-off-by: Bruce Ashfield https://patchwork.openembedded.org/patch/175096/ --- types/check-io_uring.c | 10 -------- xlat/uring_cqring_flags.h | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 xlat/uring_cqring_flags.h diff --git a/types/check-io_uring.c b/types/check-io_uring.c index dc21569..d5bd4b1 100644 --- a/types/check-io_uring.c +++ b/types/check-io_uring.c @@ -13,16 +13,6 @@ static_assert(sizeof(struct io_sqring_offsets) <= offsetof(struct_io_sqring_offs # endif /* HAVE_STRUCT_IO_SQRING_OFFSETS_RESV2 */ #endif /* HAVE_STRUCT_IO_SQRING_OFFSETS */ -#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS -# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV -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), -"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 */ - #ifdef HAVE_STRUCT_IO_URING_PARAMS # ifdef HAVE_STRUCT_IO_URING_PARAMS_CQ_OFF static_assert(sizeof(struct io_uring_params) == sizeof(struct_io_uring_params), 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