From 74c0653b4170d94ae52ff1eb69846b3c02a8d507 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Thu, 27 Apr 2023 23:49:00 +0800 Subject: [PATCH 3/3] Some PPC fix-ups --- src/absl/base/internal/unscaledcycleclock.cc | 5 ++--- src/absl/base/optimization.h | 2 +- src/absl/debugging/internal/vdso_support.h | 2 +- src/s2/util/bits/bits.h | 12 +++++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/absl/base/internal/unscaledcycleclock.cc b/src/absl/base/internal/unscaledcycleclock.cc index db408c9..48a602f 100644 --- a/src/absl/base/internal/unscaledcycleclock.cc +++ b/src/absl/base/internal/unscaledcycleclock.cc @@ -22,9 +22,7 @@ #if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) #ifdef __GLIBC__ -#ifndef __APPLE__ -#include // There is no such a header in macOS. Do we need another? -#endif +#include #elif defined(__FreeBSD__) // clang-format off // This order does actually matter =(. @@ -33,6 +31,7 @@ // clang-format on #include "absl/base/call_once.h" +// What about macOS? #endif #endif diff --git a/src/absl/base/optimization.h b/src/absl/base/optimization.h index db5cc09..543383d 100644 --- a/src/absl/base/optimization.h +++ b/src/absl/base/optimization.h @@ -74,7 +74,7 @@ // Cache line alignment #if defined(__i386__) || defined(__x86_64__) #define ABSL_CACHELINE_SIZE 64 -#elif defined(__powerpc64__) +#elif defined(__powerpc64__) || defined(__ppc64__) #define ABSL_CACHELINE_SIZE 128 #elif defined(__aarch64__) // We would need to read special register ctr_el0 to find out L1 dcache size. diff --git a/src/absl/debugging/internal/vdso_support.h b/src/absl/debugging/internal/vdso_support.h index 6562c6c..e112722 100644 --- a/src/absl/debugging/internal/vdso_support.h +++ b/src/absl/debugging/internal/vdso_support.h @@ -69,7 +69,7 @@ class VDSOSupport { // depending on how the kernel is built. The kernel is normally built with // STT_NOTYPE type VDSO symbols. Let's make things simpler first by using a // compile-time constant. -#ifdef __powerpc64__ +#if defined(__powerpc64__) || defined(__ppc64__) // Is this correct? How about ppc32? enum { kVDSOSymbolType = STT_NOTYPE }; #else enum { kVDSOSymbolType = STT_FUNC };