diff --git a/Fix-build-warning-on-loongarch64.patch b/Fix-build-warning-on-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..3fa7c2c5b0f045ac575b4bc5de9e83767df1c237 --- /dev/null +++ b/Fix-build-warning-on-loongarch64.patch @@ -0,0 +1,115 @@ +From 8c36dbe1db5f527e586e6cc9a6567b979bba1a94 Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Fri, 19 May 2023 07:22:10 +0000 +Subject: [PATCH] Fix build warning on loongarch64 + +Signed-off-by: Jingyun Hua +--- + arch/arch-loongarch64.h | 10 ++++++++++ + arch/arch.h | 3 +++ + configure | 4 +++- + libfio.c | 1 + + os/os-linux-syscall.h | 16 ++++++++++++++++ + 5 files changed, 33 insertions(+), 1 deletion(-) + create mode 100644 arch/arch-loongarch64.h + +diff --git a/arch/arch-loongarch64.h b/arch/arch-loongarch64.h +new file mode 100644 +index 0000000..43ea83b +--- /dev/null ++++ b/arch/arch-loongarch64.h +@@ -0,0 +1,10 @@ ++#ifndef ARCH_LOONGARCH64_H ++#define ARCH_LOONGARCH64_H ++ ++#define FIO_ARCH (arch_loongarch64) ++ ++#define read_barrier() __asm__ __volatile__("dbar 0": : :"memory") ++#define write_barrier() __asm__ __volatile__("dbar 0": : :"memory") ++#define nop __asm__ __volatile__("dbar 0": : :"memory") ++ ++#endif +diff --git a/arch/arch.h b/arch/arch.h +index fca003b..6e47670 100644 +--- a/arch/arch.h ++++ b/arch/arch.h +@@ -23,6 +23,7 @@ enum { + arch_hppa, + arch_mips, + arch_aarch64, ++ arch_loongarch64, + + arch_generic, + +@@ -97,6 +98,8 @@ extern unsigned long arch_flags; + #include "arch-hppa.h" + #elif defined(__aarch64__) + #include "arch-aarch64.h" ++#elif defined(__loongarch64) ++#include "arch-loongarch64.h" + #else + #warning "Unknown architecture, attempting to use generic model." + #include "arch-generic.h" +diff --git a/configure b/configure +index 84ccce0..775cda7 100755 +--- a/configure ++++ b/configure +@@ -476,13 +476,15 @@ elif check_define __aarch64__ ; then + cpu="aarch64" + elif check_define __hppa__ ; then + cpu="hppa" ++elif check_define __loongarch64 ; then ++ cpu="loongarch64" + else + cpu=`uname -m` + fi + + # Normalise host CPU name and set ARCH. + case "$cpu" in +- ia64|ppc|ppc64|s390|s390x|sparc64) ++ ia64|ppc|ppc64|s390|s390x|sparc64|loongarch64) + cpu="$cpu" + ;; + i386|i486|i586|i686|i86pc|BePC) +diff --git a/libfio.c b/libfio.c +index 198eaf2..406c6d4 100644 +--- a/libfio.c ++++ b/libfio.c +@@ -74,6 +74,7 @@ static const char *fio_arch_strings[arch_nr] = { + "hppa", + "mips", + "aarch64", ++ "loongarch64", + "generic" + }; + +diff --git a/os/os-linux-syscall.h b/os/os-linux-syscall.h +index c399b2f..ca95a7c 100644 +--- a/os/os-linux-syscall.h ++++ b/os/os-linux-syscall.h +@@ -270,6 +270,22 @@ + #define __NR_ioprio_get 31 + #endif + ++/* Linux syscalls for loongarch64 */ ++#elif defined(ARCH_LOONGARCH64_H) ++#ifndef __NR_ioprio_set ++#define __NR_ioprio_set 30 ++#define __NR_ioprio_get 31 ++#endif ++ ++#ifndef __NR_fadvise64 ++#define __NR_fadvise64 223 ++#endif ++ ++#ifndef __NR_sys_splice ++#define __NR_sys_splice 76 ++#define __NR_sys_tee 77 ++#define __NR_sys_vmsplice 75 ++#endif + #else + #warning "Unknown architecture" + #endif +-- +2.33.0 + diff --git a/fio.spec b/fio.spec index 29f9dfe0bc15c3fc526032484a28325c5e854a8d..f590dd8c75511fb1dc0a3f2379bf356520a3eb66 100644 --- a/fio.spec +++ b/fio.spec @@ -1,10 +1,11 @@ Name: fio Version: 3.29 -Release: 2 +Release: 3 Summary: Versatile IO workload generator License: GPLv2 URL: http://git.kernel.dk/?p=fio.git;a=summary Source: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2 +Patch0: Fix-build-warning-on-loongarch64.patch BuildRequires: libaio-devel python3-devel zlib-devel numactl-devel librdmacm-devel gcc %ifarch x86_64 @@ -50,7 +51,10 @@ export EXTFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %{_mandir}/man1/* %changelog -* Thu Feb 21 2023 Wenlong Zhang - 3.29-2 +* Fri May 19 2023 huajingyun - 3.29-3 +- Fix build warning on loongarch64 + +* Tue Feb 21 2023 Wenlong Zhang - 3.29-2 - Remove useless buildrequires * Fri Jan 14 2022 caodongxia - 3.29-1