fix build error because of glibc updating

This commit is contained in:
jackie_wu 2020-07-23 19:05:38 +08:00
parent 9760ebf427
commit 25fb4af20b
2 changed files with 49 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: fio
Version: 3.7
Release: 4
Release: 5
Summary: Versatile IO workload generator
License: GPLv2
URL: http://git.kernel.dk/?p=fio.git;a=summary
@ -10,7 +10,7 @@ BuildRequires: libaio-devel zlib-devel librbd1-devel numactl-devel librdmacm-de
%ifarch x86_64
BuildRequires: libpmem-devel libpmemblk-devel
%endif
Patch0000: fix-glibc-error.patch
%description
fio is a tool used to spawn many threads or processes that perform a specific type
@ -45,6 +45,9 @@ export EXTFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
%{_mandir}/man1/*
%changelog
* Thu Jul 23 2020 wutao<wutao61@huawei.com> - 3.7-5
- fix build error because of updating glibc
* Sat Mar 21 2020 huzunhao<huzunhao@huawei.com> - 3.7-4
- Type: NA
- ID: NA

44
fix-glibc-error.patch Normal file
View File

@ -0,0 +1,44 @@
diff --git a/fio-3.7/configure b/fio-3.7-edit/configure
index 9bdc7a1..ed345ba 100755
--- a/configure
+++ b/configure
@@ -2462,3 +2462,22 @@ SRCDIR:=`dirname $0`
include \$(SRCDIR)/Makefile
EOF
fi
+
+##########################################
+# check for gettid()
+gettid="no"
+cat > $TMPC << EOF
+#include <unistd.h>
+int main(int argc, char **argv)
+{
+ return gettid();
+}
+EOF
+if compile_prog "" "" "gettid"; then
+ gettid="yes"
+fi
+print_config "gettid" "$gettid"
+
+if test "$gettid" = "yes"; then
+ output_sym "CONFIG_HAVE_GETTID"
+fi
diff --git a/fio-3.7/os/os-linux.h b/fio-3.7-edit/os/os-linux.h
index a550bba..90d8929 100644
--- a/os/os-linux.h
+++ b/os/os-linux.h
@@ -126,10 +126,12 @@ static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
return syscall(__NR_ioprio_set, which, who, ioprio);
}
+#ifndef CONFIG_HAVE_GETTID
static inline int gettid(void)
{
return syscall(__NR_gettid);
}
+#endif
#define SPLICE_DEF_SIZE (64*1024)