diff options
author | Julien Brianceau <jbriance@cisco.com> | 2016-10-28 14:02:41 +0200 |
---|---|---|
committer | Julien Brianceau <jbriance@cisco.com> | 2016-10-28 14:02:41 +0200 |
commit | 4587a3fd074861412201755926bb8da5e6752f0d (patch) | |
tree | e677e4f79d458b9b9d80cf99ca229d1a768807e2 /src | |
parent | d58b92ae5169ba888e6b5ca91c0ec9814668fa2c (diff) | |
download | protobuf-4587a3fd074861412201755926bb8da5e6752f0d.tar.gz protobuf-4587a3fd074861412201755926bb8da5e6752f0d.tar.bz2 protobuf-4587a3fd074861412201755926bb8da5e6752f0d.zip |
[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.
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/stubs/atomicops.h | 4 |
1 files changed, 4 insertions, 0 deletions
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 <google/protobuf/stubs/atomicops_internals_x86_gcc.h> #elif defined(GOOGLE_PROTOBUF_ARCH_ARM) && defined(__linux__) +#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) +#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h> +#else #include <google/protobuf/stubs/atomicops_internals_arm_gcc.h> +#endif #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64) #include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h> #elif defined(GOOGLE_PROTOBUF_ARCH_ARM_QNX) |