svn commit: r494125 - in head/science/qbox: . files
Yuri Victorovich
yuri at FreeBSD.org
Thu Feb 28 04:32:35 UTC 2019
Author: yuri
Date: Thu Feb 28 04:32:33 2019
New Revision: 494125
URL: https://svnweb.freebsd.org/changeset/ports/494125
Log:
science/qbox: fix build on powerpc*
PR: 236078
Submitted by: Piotr Kubaj <pkubaj at anongoth.pl>
Added:
head/science/qbox/files/patch-readTSC.C (contents, props changed)
Modified:
head/science/qbox/Makefile
Modified: head/science/qbox/Makefile
==============================================================================
--- head/science/qbox/Makefile Thu Feb 28 03:26:43 2019 (r494124)
+++ head/science/qbox/Makefile Thu Feb 28 04:32:33 2019 (r494125)
@@ -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
Added: head/science/qbox/files/patch-readTSC.C
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/science/qbox/files/patch-readTSC.C Thu Feb 28 04:32:33 2019 (r494125)
@@ -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;
+ }
More information about the svn-ports-all
mailing list