From 3e758d857301194be8e0184c32bcb7f4bb24252b Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 13 Feb 2020 14:21:02 -0600 Subject: [PATCH] New upstream version Also fix gcc10 FTBFS and upstream build breakage in v3.18 --- .gitignore | 1 + fio.spec | 13 ++- fix-fio-globals.patch | 39 ++++++++ fix-io_uring-build.patch | 207 +++++++++++++++++++++++++++++++++++++++ sources | 2 +- 5 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 fix-fio-globals.patch create mode 100644 fix-io_uring-build.patch diff --git a/.gitignore b/.gitignore index dce83e7..fd9dfe6 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /fio-3.15.tar.bz2 /fio-3.16.tar.bz2 /fio-3.17.tar.bz2 +/fio-3.18.tar.bz2 diff --git a/fio.spec b/fio.spec index d7c75b7..f343dbb 100644 --- a/fio.spec +++ b/fio.spec @@ -1,6 +1,6 @@ Name: fio -Version: 3.17 -Release: 2%{?dist} +Version: 3.18 +Release: 1%{?dist} Summary: Multithreaded IO generation tool License: GPLv2 @@ -26,6 +26,9 @@ BuildRequires: numactl-devel BuildRequires: librdmacm-devel %endif +Patch0: fix-io_uring-build.patch +Patch1: fix-fio-globals.patch + %description fio is an I/O tool that will spawn a number of threads or processes doing a particular type of io action as specified by the user. fio takes a @@ -36,6 +39,8 @@ one wants to simulate. %prep %setup -q +%patch0 -p1 +%patch1 -p1 pathfix.py -i %{__python3} -pn \ tools/fio_jsonplus_clat2csv \ @@ -60,6 +65,10 @@ make install prefix=%{_prefix} mandir=%{_mandir} DESTDIR=$RPM_BUILD_ROOT INSTALL %{_datadir}/%{name}/* %changelog +* Thu Feb 13 2020 Eric Sandeen 3.18-1 +- New upstream version +- Fix gcc10 build + * Tue Jan 28 2020 Fedora Release Engineering - 3.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/fix-fio-globals.patch b/fix-fio-globals.patch new file mode 100644 index 0000000..a8948c2 --- /dev/null +++ b/fix-fio-globals.patch @@ -0,0 +1,39 @@ +[PATCH] fio: remove duplicate global definition of tsc_reliable + +From: Eric Sandeen + +Newer gcc v10 complains about globals being defined twice due to +a new default -fno-common flag. This causes build failures: + + LINK t/fio-dedupe +/usr/bin/ld: t/arch.o:(.bss+0x4): multiple definition of `tsc_reliable'; gettime.o:(.bss+0x4): first defined here +collect2: error: ld returned 1 exit status +make: *** [Makefile:499: t/fio-dedupe] Error 1 + +Each of the tests which call arch_init() to initialize tsc_reliable: + + File Function Line +1 t/dedupe.c main 536 arch_init(argv); +2 t/lfsr-test.c main 37 arch_init(argv); +3 t/stest.c main 86 arch_init(argv); + +already link with gettime.o which defines tsc_reliable, +so there is no need to provide it from t/arch.c + +Signed-off-by: Eric Sandeen +--- + +I can't really tell if this is the right fix across all arches, but +maybe someone smarter than me can sort it out? + +diff --git a/t/arch.c b/t/arch.c +index bd28a848..a72cef3a 100644 +--- a/t/arch.c ++++ b/t/arch.c +@@ -1,5 +1,4 @@ + #include "../arch/arch.h" + + unsigned long arch_flags = 0; +-bool tsc_reliable; + int arch_random; + diff --git a/fix-io_uring-build.patch b/fix-io_uring-build.patch new file mode 100644 index 0000000..2fcd97b --- /dev/null +++ b/fix-io_uring-build.patch @@ -0,0 +1,207 @@ + + +commit bfed648c9dae6a2459cb43f55c14d8303dcec07b +Author: Jens Axboe +Date: Thu Feb 6 07:59:00 2020 -0700 + + Unify architecture io_uring syscall numbers + + Only Alpha is the odd one out, apart from that all architectures use + the same system call number. So pull the code out arch headers, and + into the generic arch header. + + Fixes: https://github.com/axboe/fio/issues/923 + Signed-off-by: Jens Axboe + +diff --git a/arch/arch-aarch64.h b/arch/arch-aarch64.h +index de9b349..2a86cc5 100644 +--- a/arch/arch-aarch64.h ++++ b/arch/arch-aarch64.h +@@ -8,18 +8,6 @@ + + #define FIO_ARCH (arch_aarch64) + +-#define ARCH_HAVE_IOURING +- +-#ifndef __NR_sys_io_uring_setup +-#define __NR_sys_io_uring_setup 425 +-#endif +-#ifndef __NR_sys_io_uring_enter +-#define __NR_sys_io_uring_enter 426 +-#endif +-#ifndef __NR_sys_io_uring_register +-#define __NR_sys_io_uring_register 427 +-#endif +- + #define nop do { __asm__ __volatile__ ("yield"); } while (0) + #define read_barrier() do { __sync_synchronize(); } while (0) + #define write_barrier() do { __sync_synchronize(); } while (0) +diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h +index 46246ba..804d596 100644 +--- a/arch/arch-ppc.h ++++ b/arch/arch-ppc.h +@@ -24,18 +24,6 @@ + #define PPC_CNTLZL "cntlzw" + #endif + +-#define ARCH_HAVE_IOURING +- +-#ifndef __NR_sys_io_uring_setup +-#define __NR_sys_io_uring_setup 425 +-#endif +-#ifndef __NR_sys_io_uring_enter +-#define __NR_sys_io_uring_enter 426 +-#endif +-#ifndef __NR_sys_io_uring_register +-#define __NR_sys_io_uring_register 427 +-#endif +- + static inline int __ilog2(unsigned long bitmask) + { + int lz; +diff --git a/arch/arch-x86-common.h b/arch/arch-x86-common.h +index 87925bd..f32835c 100644 +--- a/arch/arch-x86-common.h ++++ b/arch/arch-x86-common.h +@@ -3,16 +3,6 @@ + + #include + +-#ifndef __NR_sys_io_uring_setup +-#define __NR_sys_io_uring_setup 425 +-#endif +-#ifndef __NR_sys_io_uring_enter +-#define __NR_sys_io_uring_enter 426 +-#endif +-#ifndef __NR_sys_io_uring_register +-#define __NR_sys_io_uring_register 427 +-#endif +- + static inline void cpuid(unsigned int op, + unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) +@@ -23,7 +13,6 @@ static inline void cpuid(unsigned int op, + } + + #define ARCH_HAVE_INIT +-#define ARCH_HAVE_IOURING + + extern bool tsc_reliable; + extern int arch_random; +diff --git a/arch/arch.h b/arch/arch.h +index 0ec3f10..30c0d20 100644 +--- a/arch/arch.h ++++ b/arch/arch.h +@@ -76,4 +76,32 @@ static inline int arch_init(char *envp[]) + } + #endif + ++#ifdef __alpha__ ++/* ++ * alpha is the only exception, all other architectures ++ * have common numbers for new system calls. ++ */ ++# ifndef __NR_io_uring_setup ++# define __NR_io_uring_setup 535 ++# endif ++# ifndef __NR_io_uring_enter ++# define __NR_io_uring_enter 536 ++# endif ++# ifndef __NR_io_uring_register ++# define __NR_io_uring_register 537 ++# endif ++#else /* !__alpha__ */ ++# ifndef __NR_io_uring_setup ++# define __NR_io_uring_setup 425 ++# endif ++# ifndef __NR_io_uring_enter ++# define __NR_io_uring_enter 426 ++# endif ++# ifndef __NR_io_uring_register ++# define __NR_io_uring_register 427 ++# endif ++#endif ++ ++#define ARCH_HAVE_IOURING ++ + #endif +diff --git a/engines/io_uring.c b/engines/io_uring.c +index f1ffc71..5e59f97 100644 +--- a/engines/io_uring.c ++++ b/engines/io_uring.c +@@ -191,7 +191,7 @@ static struct fio_option options[] = { + static int io_uring_enter(struct ioring_data *ld, unsigned int to_submit, + unsigned int min_complete, unsigned int flags) + { +- return syscall(__NR_sys_io_uring_enter, ld->ring_fd, to_submit, ++ return syscall(__NR_io_uring_enter, ld->ring_fd, to_submit, + min_complete, flags, NULL, 0); + } + +@@ -548,7 +548,7 @@ static int fio_ioring_queue_init(struct thread_data *td) + } + } + +- ret = syscall(__NR_sys_io_uring_setup, depth, &p); ++ ret = syscall(__NR_io_uring_setup, depth, &p); + if (ret < 0) + return ret; + +@@ -563,7 +563,7 @@ static int fio_ioring_queue_init(struct thread_data *td) + if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0) + return -1; + +- ret = syscall(__NR_sys_io_uring_register, ld->ring_fd, ++ ret = syscall(__NR_io_uring_register, ld->ring_fd, + IORING_REGISTER_BUFFERS, ld->iovecs, depth); + if (ret < 0) + return ret; +@@ -589,7 +589,7 @@ static int fio_ioring_register_files(struct thread_data *td) + f->engine_pos = i; + } + +- ret = syscall(__NR_sys_io_uring_register, ld->ring_fd, ++ ret = syscall(__NR_io_uring_register, ld->ring_fd, + IORING_REGISTER_FILES, ld->fds, td->o.nr_files); + if (ret) { + err: +diff --git a/t/io_uring.c b/t/io_uring.c +index c2e5e09..55b75f6 100644 +--- a/t/io_uring.c ++++ b/t/io_uring.c +@@ -100,7 +100,7 @@ static int io_uring_register_buffers(struct submitter *s) + if (do_nop) + return 0; + +- return syscall(__NR_sys_io_uring_register, s->ring_fd, ++ return syscall(__NR_io_uring_register, s->ring_fd, + IORING_REGISTER_BUFFERS, s->iovecs, depth); + } + +@@ -117,20 +117,20 @@ static int io_uring_register_files(struct submitter *s) + s->files[i].fixed_fd = i; + } + +- return syscall(__NR_sys_io_uring_register, s->ring_fd, ++ return syscall(__NR_io_uring_register, s->ring_fd, + IORING_REGISTER_FILES, s->fds, s->nr_files); + } + + static int io_uring_setup(unsigned entries, struct io_uring_params *p) + { +- return syscall(__NR_sys_io_uring_setup, entries, p); ++ return syscall(__NR_io_uring_setup, entries, p); + } + + static int io_uring_enter(struct submitter *s, unsigned int to_submit, + unsigned int min_complete, unsigned int flags) + { +- return syscall(__NR_sys_io_uring_enter, s->ring_fd, to_submit, +- min_complete, flags, NULL, 0); ++ return syscall(__NR_io_uring_enter, s->ring_fd, to_submit, min_complete, ++ flags, NULL, 0); + } + + #ifndef CONFIG_HAVE_GETTID + + diff --git a/sources b/sources index e286ef4..eb9e607 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fio-3.17.tar.bz2) = 27dba4c3e8f544c0fd40a5f42660f64f42e114e7b56199bc70f540b1a09b9dec9291e3fbae0fab9691189fa4a1f40edbcf4f9b53c313fd9c1a8ba0fdbb7f524e +SHA512 (fio-3.18.tar.bz2) = 11b689bfc873716bd3f06f46652facf7a1cf6928bc251d9b394fac4afb77497043dc3a083fe69a940cba26080eee5fd56ad5bfdf8d1c2dfd3d5d94414d7b5922