From 4587a3fd074861412201755926bb8da5e6752f0d Mon Sep 17 00:00:00 2001 From: Julien Brianceau Date: Fri, 28 Oct 2016 14:02:41 +0200 Subject: [arm/gcc] Don't rely on KUSER_HELPERS feature for atomics ARM specific CONFIG_KUSER_HELPERS feature can be disabled in Linux kernel, and in this case, we shouldn't crash. Use gcc built-in functions instead of arm specific code if they are available. --- src/google/protobuf/stubs/atomicops.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/google') diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index 9b3d1e6b..6a539153 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -203,7 +203,11 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #if defined(GOOGLE_PROTOBUF_ARCH_IA32) || defined(GOOGLE_PROTOBUF_ARCH_X64) #include #elif defined(GOOGLE_PROTOBUF_ARCH_ARM) && defined(__linux__) +#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) +#include +#else #include +#endif #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64) #include #elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX) -- cgit v1.2.3