Fixes for Darwin PowerPC

pull/1272/head
Sergey Fedorov 2 years ago
parent 2052c2e37c
commit 7eff3adf3f
  1. 6
      absl/debugging/internal/examine_stack.cc
  2. 14
      absl/random/internal/platform.h
  3. 10
      absl/random/internal/randen_detect.cc

@ -223,6 +223,12 @@ void* GetProgramCounter(void* const vuc) {
#else
return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->ss.rip);
#endif
#elif defined(__ppc__) || defined(__ppc64__)
#if __DARWIN_UNIX03
return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->__ss.__srr0);
#else
return reinterpret_cast<void*>(signal_ucontext->uc_mcontext->ss.srr0);
#endif
#endif
}
#elif defined(__akaros__)

@ -67,8 +67,8 @@
#define ABSL_ARCH_AARCH64
#elif defined(__arm__) || defined(__ARMEL__) || defined(_M_ARM)
#define ABSL_ARCH_ARM
#elif defined(__powerpc64__) || defined(__PPC64__) || defined(__powerpc__) || \
defined(__ppc__) || defined(__PPC__)
#elif defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__) || \
defined(__powerpc__) || defined(__PPC__) || defined(__ppc__) || defined(__POWERPC__)
#define ABSL_ARCH_PPC
#else
// Unsupported architecture.
@ -105,9 +105,11 @@
#elif defined(ABSL_ARCH_PPC)
#if defined(__APPLE__) // G4 and G5 ISA have Altivec, but do not support VSX and CRYPTO
#undef ABSL_HAVE_ACCELERATED_AES
#define ABSL_HAVE_ACCELERATED_AES 0
// Rely on VSX and CRYPTO extensions for vcipher on PowerPC.
#if (defined(__VEC__) || defined(__ALTIVEC__)) && defined(__VSX__) && \
defined(__CRYPTO__)
#elif (defined(__VEC__) || defined(__ALTIVEC__)) && defined(__VSX__) && defined(__CRYPTO__)
#undef ABSL_HAVE_ACCELERATED_AES
#define ABSL_HAVE_ACCELERATED_AES 1
#endif
@ -151,6 +153,10 @@
// (This captures a lot of Android configurations.)
#undef ABSL_RANDOM_INTERNAL_AES_DISPATCH
#define ABSL_RANDOM_INTERNAL_AES_DISPATCH 1
#elif defined(__APPLE__) && defined(ABSL_ARCH_PPC)
// Darwin PPC
#undef ABSL_RANDOM_INTERNAL_AES_DISPATCH
#define ABSL_RANDOM_INTERNAL_AES_DISPATCH 0
#endif
// NaCl does not allow dispatch.

@ -31,14 +31,15 @@
#if defined(ABSL_ARCH_X86_64)
#define ABSL_INTERNAL_USE_X86_CPUID
#elif defined(ABSL_ARCH_PPC) || defined(ABSL_ARCH_ARM) || \
defined(ABSL_ARCH_AARCH64)
#elif defined(ABSL_ARCH_PPC) || defined(ABSL_ARCH_ARM) || defined(ABSL_ARCH_AARCH64)
#if defined(__ANDROID__)
#define ABSL_INTERNAL_USE_ANDROID_GETAUXVAL
#define ABSL_INTERNAL_USE_GETAUXVAL
#elif defined(__linux__) && defined(ABSL_HAVE_GETAUXVAL)
#define ABSL_INTERNAL_USE_LINUX_GETAUXVAL
#define ABSL_INTERNAL_USE_GETAUXVAL
#elif defined(__APPLE__) && defined(ABSL_ARCH_PPC)
#define ABSL_INTERNAL_USE_PPC_CPUINFO
#endif
#endif
@ -56,6 +57,11 @@ static void __cpuid(int cpu_info[4], int info_type) {
#endif
#endif // ABSL_INTERNAL_USE_X86_CPUID
#if defined(ABSL_INTERNAL_USE_PPC_CPUINFO)
#include <mach/mach.h>
#include <mach/machine.h>
#endif // ABSL_INTERNAL_USE_PPC_CPUINFO
// On linux, just use the c-library getauxval call.
#if defined(ABSL_INTERNAL_USE_LINUX_GETAUXVAL)

Loading…
Cancel
Save