From f98d476ffc0a8b76fdf9c7ae2d4ea758f14356ca Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 12 Jan 2017 23:36:18 +0300 Subject: Fix 'atomic_load/store symbols undefined' error on OS X 10.8 i386 Issue #23 (libatomic_ops). * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET && !__x86_64__ && __APPLE__ && __MACH__]: Include AvailabilityMacros.h unless MAC_OS_X_VERSION_MIN_REQUIRED already defined. * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET && !__x86_64__ && __APPLE__ && __MACH__ && MAC_OS_X_VERSION_MIN_REQUIRED < 1090] (AO_SKIPATOMIC_double_load, AO_SKIPATOMIC_double_load_acquire, AO_SKIPATOMIC_double_store, AO_SKIPATOMIC_double_store_release): Define. --- src/atomic_ops/sysdeps/gcc/x86.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 8d268b6..90b64bc 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -51,6 +51,21 @@ # define AO_GCC_FORCE_HAVE_CAS # endif +# if !defined(__x86_64__) && defined(__APPLE__) && defined(__MACH__) + /* OS X 10.8 lacks __atomic_load/store symbols for arch i386 (even */ + /* with non-Apple clang). */ +# ifndef MAC_OS_X_VERSION_MIN_REQUIRED + /* Include this header just to import the version macro. */ +# include +# endif +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 /* MAC_OS_X_VERSION_10_9 */ +# define AO_SKIPATOMIC_double_load +# define AO_SKIPATOMIC_double_load_acquire +# define AO_SKIPATOMIC_double_store +# define AO_SKIPATOMIC_double_store_release +# endif +# endif + #else /* AO_DISABLE_GCC_ATOMICS */ /* The following really assume we have a 486 or better. Unfortunately */ -- cgit v1.2.1