From 15cf5378b306de9782adeb23b89c70b090598369 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Thu, 2 May 2019 13:46:51 +0100 Subject: [PATCH] make use of RDTSC optional as it may not be available One example is when using seccomp with PR_SET_TSC set to PR_TSC_SIGSEGV. --- src/google/protobuf/map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 2750c023b9..6619fc81c4 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -937,7 +937,7 @@ class Map { // Return a randomish value. size_type Seed() const { size_type s = static_cast(reinterpret_cast(this)); -#if defined(__x86_64__) && defined(__GNUC__) +#if defined(__x86_64__) && defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_NO_RDTSC) uint32 hi, lo; asm("rdtsc" : "=a"(lo), "=d"(hi)); s += ((static_cast(hi) << 32) | lo);