diff --git a/benchmark-s390.patch b/benchmark-s390.patch new file mode 100644 index 0000000..3334330 --- /dev/null +++ b/benchmark-s390.patch @@ -0,0 +1,16 @@ +Index: benchmark-1.0.0/src/cycleclock.h +=================================================================== +--- benchmark-1.0.0.orig/src/cycleclock.h ++++ benchmark-1.0.0/src/cycleclock.h +@@ -124,6 +124,11 @@ inline BENCHMARK_ALWAYS_INLINE int64_t N + struct timeval tv; + gettimeofday(&tv, nullptr); + return static_cast(tv.tv_sec) * 1000000 + tv.tv_usec; ++#elif defined(__s390__) ++ // found this for papi package ++ unsigned long long ret; ++ __asm__("stck 0(%0)" : : "a" (&(ret)) : "memory", "cc"); ++ return (long long)ret; + #else + // The soft failover to a generic implementation is automatic only for ARM. + // For other platforms the developer is expected to make an attempt to create diff --git a/benchmark.changes b/benchmark.changes index 5ca5f92..ecc5147 100644 --- a/benchmark.changes +++ b/benchmark.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 27 14:28:26 UTC 2017 - bg@suse.com + +- add support for s390x + ------------------------------------------------------------------- Sat Nov 12 13:43:21 CET 2016 - ro@suse.de diff --git a/benchmark.spec b/benchmark.spec index a7dacfc..7962504 100644 --- a/benchmark.spec +++ b/benchmark.spec @@ -1,7 +1,7 @@ # # spec file for package benchmark # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,11 +26,12 @@ License: Apache-2.0 Group: Development/Libraries/C and C++ Url: https://github.com/google/benchmark Source: https://github.com/google/benchmark/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch: benchmark-s390.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: git-core BuildRoot: %{_tmppath}/%{name}-%{version}-build -ExclusiveArch: %ix86 x86_64 +ExclusiveArch: %ix86 x86_64 s390x %description A library to support the benchmarking of functions, similar to unit-tests. @@ -52,6 +53,7 @@ Development files for google benchmark library %prep %setup -q +%patch -p1 %build %if %{__isa_bits} == 64