Bug#910606: benchmark: FTBFS on hppa - needs CycleTimer

John David Anglin dave.anglin at bell.net
Mon Oct 8 17:27:23 BST 2018


Source: benchmark
Severity: normal
Tags: patch

Dear Maintainer,

The build fails here:

[ 25%] Building CXX object src/CMakeFiles/benchmark.dir/sysinfo.cc.o
cd /<<PKGBUILDDIR>>/obj-hppa-linux-gnu/src && /usr/bin/c++  -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -Dbenchmark_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/src -I/<<PKGBUILDDIR>>/src/../include  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -std=c++11  -Wall  -Wextra  -Wshadow  -pedantic  -pedantic-errors  -Wfloat-equal  -fstrict-aliasing  -Wstrict-aliasing -fPIC   -o CMakeFiles/benchmark.dir/sysinfo.cc.o -c /<<PKGBUILDDIR>>/src/sysinfo.cc
In file included from /<<PKGBUILDDIR>>/src/sysinfo.cc:57:
/<<PKGBUILDDIR>>/src/cycleclock.h:171:2: error: #error You need to define CycleTimer for your OS and CPU
 #error You need to define CycleTimer for your OS and CPU

The attached patch adds a bit of code to access the interval timer on hppa.
This fixes the build error.

Note that a 32-bit counter value is returned when the processor is running
in narrow mode.  The counter nominally runs at the processor frequency.

Regards,
Dave Anglin

-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.74+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
--- cycleclock.h.save	2018-10-08 11:07:53.775998772 -0400
+++ cycleclock.h	2018-10-08 12:01:01.013408888 -0400
@@ -100,6 +100,11 @@
   int64_t itc;
   asm("mov %0 = ar.itc" : "=r"(itc));
   return itc;
+#elif defined(__hppa__)
+  // Counter can only be read when PSW S bit is 0.
+  long itc;
+  asm("mfctl 16,%0" : "=r"(itc));
+  return static_cast<int64_t>(itc);
 #elif defined(COMPILER_MSVC) && defined(_M_IX86)
   // Older MSVC compilers (like 7.x) don't seem to support the
   // __rdtsc intrinsic properly, so I prefer to use _asm instead


More information about the debian-science-maintainers mailing list