summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2013-01-01 11:49:35 +0100
committerDan Horák <dan@danny.cz>2013-01-01 11:49:35 +0100
commit8bfefa51ab6fbe77deedf4cf94927c8cf2d91bb2 (patch)
tree8281cdbfab000e8b70dc16c6e02180bbd497fedb
parent88314762a053d5b6c010d162732cd1370739e49c (diff)
downloadfio-8bfefa51ab6fbe77deedf4cf94927c8cf2d91bb2.tar.gz
fio-8bfefa51ab6fbe77deedf4cf94927c8cf2d91bb2.tar.xz
fio-8bfefa51ab6fbe77deedf4cf94927c8cf2d91bb2.zip
fix build on arches without ARCH_HAVE_CPU_CLOCK (arm, s390)
-rw-r--r--fio-2.0.12.2-no-arch-cpu-clock.patch40
-rw-r--r--fio.spec8
2 files changed, 47 insertions, 1 deletions
diff --git a/fio-2.0.12.2-no-arch-cpu-clock.patch b/fio-2.0.12.2-no-arch-cpu-clock.patch
new file mode 100644
index 0000000..b3641b5
--- /dev/null
+++ b/fio-2.0.12.2-no-arch-cpu-clock.patch
@@ -0,0 +1,40 @@
+From 4de98eb0e68314ba36fcfc2722a1c9b3bc5d3318 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Tue, 1 Jan 2013 10:59:04 +0100
+Subject: [PATCH] Move 'tsc_reliable' outside of ARCH_HAVE_CPU_CLOCK
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Otherwise we fail building on architectures that do not define
+it, as reported by Dan:
+
+cc -o gettime.o -c -std=gnu99 -Wwrite-strings -Wall -O3 -g -O2 -g -pipe
+-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
+--param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10
+-DFIO_VERSION='"fio-2.0.12.2"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE
+-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG gettime.c
+gettime.c: In function 'fio_clock_init':
+gettime.c:317:6: error: 'tsc_reliable' undeclared (first use in this function)
+gettime.c:317:6: note: each undeclared identifier is reported only once for each function it appears in
+make: *** [gettime.o] Error 1
+
+Reported-by: Dan Horák <dan@danny.cz>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+---
+ gettime.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff -up fio-2.0.12.2/gettime.c.no-arch-cpu-clock fio-2.0.12.2/gettime.c
+--- fio-2.0.12.2/gettime.c.no-arch-cpu-clock 2012-12-20 15:19:57.000000000 +0100
++++ fio-2.0.12.2/gettime.c 2013-01-01 11:40:29.000000000 +0100
+@@ -15,8 +15,8 @@
+
+ #ifdef ARCH_HAVE_CPU_CLOCK
+ static unsigned long cycles_per_usec;
+-int tsc_reliable = 0;
+ #endif
++int tsc_reliable = 0;
+
+ struct tv_valid {
+ struct timeval last_tv;
diff --git a/fio.spec b/fio.spec
index b446b06..8442b2c 100644
--- a/fio.spec
+++ b/fio.spec
@@ -1,12 +1,14 @@
Name: fio
Version: 2.0.12.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Multithreaded IO generation tool
Group: Applications/System
License: GPLv2
URL: http://git.kernel.dk/?p=fio.git;a=summary
Source: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2
+# backported upstream commit 4de98eb0e
+Patch0: fio-2.0.12.2-no-arch-cpu-clock.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -22,6 +24,7 @@ one wants to simulate.
%prep
%setup -q
+%patch0 -p1 -b .no-arch-cpu-clock
%build
EXTFLAGS="$RPM_OPT_FLAGS" make V=1 %{?_smp_mflags}
@@ -40,6 +43,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/*
%changelog
+* Tue Jan 01 2013 Dan Horák <dan[at]danny.cz> - 2.0.12.2-2
+- fix build on arches without ARCH_HAVE_CPU_CLOCK (arm, s390)
+
* Fri Dec 21 2012 Eric Sandeen <sandeen@redhat.com> 2.0.12.2-1
- New upstream version