From owner-svn-ports-head@freebsd.org Sun Feb 9 11:19:47 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7BE7235327; Sun, 9 Feb 2020 11:19:47 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Fmll4zwHz41Ds; Sun, 9 Feb 2020 11:19:47 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A677E55C3; Sun, 9 Feb 2020 11:19:47 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 019BJllf072579; Sun, 9 Feb 2020 11:19:47 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 019BJlsr072578; Sun, 9 Feb 2020 11:19:47 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <202002091119.019BJlsr072578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Sun, 9 Feb 2020 11:19:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r525649 - head/devel/py-grpcio/files X-SVN-Group: ports-head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: head/devel/py-grpcio/files X-SVN-Commit-Revision: 525649 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Feb 2020 11:19:47 -0000 Author: pkubaj Date: Sun Feb 9 11:19:47 2020 New Revision: 525649 URL: https://svnweb.freebsd.org/changeset/ports/525649 Log: devel/py-grpcio: fix build on powerpc64 elfv2 Clang doesn't have sys/platform/ppc.h: cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -Ithird_party/boringssl/include -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -maltivec -mvsx -isystem /usr/local/include -fPIC -DOPENSSL_NO_ASM=1 -D_WIN32_WINNT=1536 -DGPR_BACKWARDS_COMPATIBILITY_MODE=1 -DHAVE_CONFIG_H=1 -DGRPC_ENABLE_FORK_SUPPORT=1 -Isrc/python/grpcio -Iinclude -I. -Ithird_party/abseil-cpp -Ithird_party/address_sorting/include -I/usr/include -Ithird_party/boringssl/include -Ithird_party/upb -Isrc/core/ext/upb-generated -I/usr/include -I/usr/local/include/python3.7m -c third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc -o python_build/temp.freebsd-13.0-CURRENT-powerpc-3.7/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.o -std=c++11 -pthread third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc:24:10: fatal error: 'sys/platform/ppc.h' file not found #include ^~~~~~~~~~~~~~~~~~~~ 1 error generated. __ppc_get_timebase() and __ppc_get_timebase_freq() are not supported on FreeBSD. PR: 243995 Approved by: vanilla (maintainer) Added: head/devel/py-grpcio/files/patch-third__party_abseil-cpp_absl_base_internal_unscaledcycleclock.cc (contents, props changed) Added: head/devel/py-grpcio/files/patch-third__party_abseil-cpp_absl_base_internal_unscaledcycleclock.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-grpcio/files/patch-third__party_abseil-cpp_absl_base_internal_unscaledcycleclock.cc Sun Feb 9 11:19:47 2020 (r525649) @@ -0,0 +1,55 @@ +--- third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc.orig 2020-02-04 17:37:57 UTC ++++ third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +@@ -20,10 +20,16 @@ + #include + #endif + +-#if defined(__powerpc__) || defined(__ppc__) ++#if (defined(__powerpc__) || defined(__ppc__)) && !defined(__clang__) + #include ++ + #endif + ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__clang__) && defined(__FreeBSD__) ++#include ++#include ++#endif ++ + #include "absl/base/internal/sysinfo.h" + + namespace absl { +@@ -57,11 +62,34 @@ double UnscaledCycleClock::Frequency() { + #elif defined(__powerpc__) || defined(__ppc__) + + int64_t UnscaledCycleClock::Now() { ++#ifdef __GLIBC__ + return __ppc_get_timebase(); ++#elif defined(__FreeBSD__) ++ union { long long complete; unsigned int part[2]; } ticks; ++ unsigned int tmp; ++ asm volatile( ++ "0:\n" ++ "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) ++ ); ++ return ticks.complete; ++#endif + } + + double UnscaledCycleClock::Frequency() { ++#ifdef __GLIBC__ + return __ppc_get_timebase_freq(); ++#elif defined(__FreeBSD__) ++ double timebaseFrequency = 0; ++ size_t length = sizeof(timebaseFrequency); ++ sysctlbyname("kern.timecounter.tc.timebase.frequency", &timebaseFrequency, &length, NULL, 0); ++ return timebaseFrequency; ++#endif + } + + #elif defined(__aarch64__)