Fix compilation error for clang with disabling 128 bit optimization.
In function `_odp_atomic_u128_xchg_mm':
undefined reference to `__atomic_exchange'

Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
---
 I need some quick way to make clang build happy. Clean patch can go later.

 Maxim.

 platform/linux-generic/include/odp_atomic_internal.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp_atomic_internal.h 
b/platform/linux-generic/include/odp_atomic_internal.h
index 3c5606c..31c8059 100644
--- a/platform/linux-generic/include/odp_atomic_internal.h
+++ b/platform/linux-generic/include/odp_atomic_internal.h
@@ -590,7 +590,9 @@ static inline void 
_odp_atomic_flag_clear(_odp_atomic_flag_t *flag)
 /* Check if target and compiler supports 128-bit scalars and corresponding
  * exchange and CAS operations */
 /* GCC on x86-64 needs -mcx16 compiler option */
-#if defined __SIZEOF_INT128__ && defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+#if defined(__SIZEOF_INT128__) && \
+       defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) && \
+       !defined(__clang__)
 
 /** Preprocessor symbol that indicates support for 128-bit atomics */
 #define ODP_ATOMIC_U128
-- 
2.7.1.250.gff4ea60

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to