Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 2021 19:08:15 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 6280c5793ec5 - main - graphics/libjxl: use the upstream build fix from https://github.com/google/highway/commit/3769cb2c464c
Message-ID:  <202109301908.18UJ8Ffa053414@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6280c5793ec5d93b939844f8fc35fde21e8ffb9e

commit 6280c5793ec5d93b939844f8fc35fde21e8ffb9e
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-09-30 19:02:16 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-09-30 19:02:16 +0000

    graphics/libjxl: use the upstream build fix from https://github.com/google/highway/commit/3769cb2c464c
    
    While here, also remove the BROKEN_powerpc64 (I did not see it because I tested
    on powerpc64le previously).
    
    Reported by:    jbeich
---
 graphics/libjxl/Makefile                           |  2 -
 ...patch-third__party_highway_hwy_nanobenchmark.cc | 46 +++++++++++++---------
 2 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/graphics/libjxl/Makefile b/graphics/libjxl/Makefile
index 843bf74a3b54..8de3e64d4913 100644
--- a/graphics/libjxl/Makefile
+++ b/graphics/libjxl/Makefile
@@ -15,8 +15,6 @@ LICENSE_COMB=	multi
 LICENSE_FILE_BSD3CLAUSE=${WRKSRC}/LICENSE
 LICENSE_FILE_ZLIB=	${WRKSRC}/third_party/lodepng/LICENSE
 
-BROKEN_powerpc64=	https://github.com/google/highway/issues/345
-
 LIB_DEPENDS=	libbrotlienc.so:archivers/brotli
 TEST_DEPENDS=	googletest>0:devel/googletest
 
diff --git a/graphics/libjxl/files/patch-third__party_highway_hwy_nanobenchmark.cc b/graphics/libjxl/files/patch-third__party_highway_hwy_nanobenchmark.cc
index a4dcea0f17e3..50e151fd7a30 100644
--- a/graphics/libjxl/files/patch-third__party_highway_hwy_nanobenchmark.cc
+++ b/graphics/libjxl/files/patch-third__party_highway_hwy_nanobenchmark.cc
@@ -1,30 +1,38 @@
---- third_party/highway/hwy/nanobenchmark.cc.orig	2021-09-30 15:38:30 UTC
+--- third_party/highway/hwy/nanobenchmark.cc.orig	2021-06-09 08:56:32 UTC
 +++ third_party/highway/hwy/nanobenchmark.cc
-@@ -47,7 +47,12 @@
+@@ -46,7 +46,7 @@
+ #endif
  
  #include "hwy/base.h"
- #if HWY_ARCH_PPC
-+#if linux
+-#if HWY_ARCH_PPC
++#if HWY_ARCH_PPC && defined(__GLIBC__)
  #include <sys/platform/ppc.h>  // NOLINT __ppc_get_timebase_freq
-+#elif __FreeBSD__
-+#include <sys/types.h>
-+#include <sys/sysctl.h>                 /* must come after sys/types.h */
-+#endif
  #elif HWY_ARCH_X86
  
- #if HWY_COMPILER_MSVC
-@@ -400,7 +405,14 @@ double NominalClockRate() {
+@@ -119,7 +119,7 @@ using Ticks = uint64_t;
+ // divide by InvariantTicksPerSecond.
+ inline Ticks Start() {
+   Ticks t;
+-#if HWY_ARCH_PPC
++#if HWY_ARCH_PPC && defined(__GLIBC__)
+   asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268));
+ #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC
+   _ReadWriteBarrier();
+@@ -161,7 +161,7 @@ inline Ticks Start() {
+ 
+ inline Ticks Stop() {
+   uint64_t t;
+-#if HWY_ARCH_PPC
++#if HWY_ARCH_PPC && defined(__GLIBC__)
+   asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268));
+ #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC
+   _ReadWriteBarrier();
+@@ -399,7 +399,7 @@ double NominalClockRate() {
+ }  // namespace
  
  double InvariantTicksPerSecond() {
- #if HWY_ARCH_PPC
-+#if linux
+-#if HWY_ARCH_PPC
++#if HWY_ARCH_PPC && defined(__GLIBC__)
    return __ppc_get_timebase_freq();
-+#elif __FreeBSD__
-+  static double cycles_per_second = 0;
-+  size_t length = sizeof(cycles_per_second);
-+  sysctlbyname("kern.timecounter.tc.timebase.frequency", &cycles_per_second,
-+               &length, NULL, 0);
-+#endif
  #elif HWY_ARCH_X86
    // We assume the TSC is invariant; it is on all recent Intel/AMD CPUs.
-   return NominalClockRate();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109301908.18UJ8Ffa053414>