aboutsummaryrefslogtreecommitdiff
path: root/science/qbox
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-02-28 04:32:33 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-02-28 04:32:33 +0000
commitdc46e2ab129394b843184ff6331b82d11e58e57b (patch)
tree9572cd4c83d20ec147829266a2e43f9c890ad5f0 /science/qbox
parentd966c0325c78a4dec6ba6a9f1e0210d477121155 (diff)
downloadports-dc46e2ab129394b843184ff6331b82d11e58e57b.tar.gz
ports-dc46e2ab129394b843184ff6331b82d11e58e57b.zip
Notes
Diffstat (limited to 'science/qbox')
-rw-r--r--science/qbox/Makefile2
-rw-r--r--science/qbox/files/patch-readTSC.C25
2 files changed, 26 insertions, 1 deletions
diff --git a/science/qbox/Makefile b/science/qbox/Makefile
index b61fdd060d7d..4bee34eadcb6 100644
--- a/science/qbox/Makefile
+++ b/science/qbox/Makefile
@@ -21,7 +21,7 @@ LIB_DEPENDS= libblas.so:math/blas \
libuuid.so:misc/e2fsprogs-libuuid \
libxerces-c.so:textproc/xerces-c3
-USES= gmake iconv:wchar_t localbase:ldflags
+USES= compiler:c++11-lang gmake iconv:wchar_t localbase:ldflags
USE_GITHUB= yes
GH_ACCOUNT= qboxcode
GH_PROJECT= qbox-public
diff --git a/science/qbox/files/patch-readTSC.C b/science/qbox/files/patch-readTSC.C
new file mode 100644
index 000000000000..e02d918376d0
--- /dev/null
+++ b/science/qbox/files/patch-readTSC.C
@@ -0,0 +1,25 @@
+--- readTSC.C.orig 2019-02-27 09:30:27 UTC
++++ readTSC.C
+@@ -19,10 +19,22 @@
+ long long readTSC(void)
+ {
+ union { long long complete; unsigned int part[2]; } ticks;
++#ifdef __amd64__
+ __asm__ ("rdtsc; mov %%eax,%0;mov %%edx,%1"
+ : "=mr" (ticks.part[0]),
+ "=mr" (ticks.part[1])
+ : /* no inputs */
+ : "eax", "edx");
++#elif __powerpc__
++ unsigned int tmp;
++ __asm__ ("0:"
++ "mftbu %[hi32]\n"
++ "mftb %[lo32]\n"
++ "mftbu %[tmp]\n"
++ "cmpw %[tmp],%[hi32]\n"
++ "bne 0b\n"
++ : [hi32] "=r"(ticks.part[0]), [lo32] "=r"(ticks.part[1]),
++ [tmp] "=r"(tmp));
++#endif
+ return ticks.complete;
+ }