svn commit: r517837 - head/astro/oskar/files
Piotr Kubaj
pkubaj at FreeBSD.org
Sun Nov 17 19:01:59 UTC 2019
Author: pkubaj
Date: Sun Nov 17 19:01:58 2019
New Revision: 517837
URL: https://svnweb.freebsd.org/changeset/ports/517837
Log:
astro/oskar: fix build on powerpc* with clang
There are some Clang-on-PPC-specific issues.
Clang doesn't have ppu_intrinsics.h. mulhdu and mulhwu are required.
PR: 242016
Approved by: yuri (maintainer), linimon (mentor)
Differential Revision: https://reviews.freebsd.org/D22424
Added:
head/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h (contents, props changed)
Added: head/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h Sun Nov 17 19:01:58 2019 (r517837)
@@ -0,0 +1,32 @@
+--- extern/Random123/features/gccfeatures.h.orig 2019-11-17 00:45:21 UTC
++++ extern/Random123/features/gccfeatures.h
+@@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
+ Please let the authors know of any successes (or failures). */
+ #endif
+
+-#ifdef __powerpc__
++#if defined(__powerpc__) && !defined(__clang__)
+ #include <ppu_intrinsics.h>
+ #endif
+
+@@ -246,6 +246,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
+ #else
+ #define R123_USE_MULHILO64_MULHI_INTRIN 0
+ #endif
++#endif
++
++#if defined(__powerpc__) && defined(__clang__)
++#ifdef __powerpc64__
++static inline unsigned long long __mulhdu(unsigned long long a, unsigned long long b) {
++ __uint128_t c = (__uint128_t) a * (__uint128_t) b;
++ return c >> 64;
++}
++#endif
++
++static inline unsigned int __mulhwu(unsigned int a, unsigned int b) {
++ unsigned long long c = (unsigned long long) a * (unsigned long long) b;
++ return c >> 32;
++}
+ #endif
+
+ #ifndef R123_MULHILO64_MULHI_INTRIN
More information about the svn-ports-all
mailing list