From: Android Tools Maintainers Date: Mon, 27 Jun 2022 17:30:12 +0000 (+0100) Subject: Replace the legacy __sync built-in functions with __atomic ones X-Git-Tag: archive/raspbian/29.0.6-19+rpi1^2~34 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=81d513407bd99f5d10cf3d9333dfd4bac6054e0f;p=android-platform-tools.git Replace the legacy __sync built-in functions with __atomic ones Last-Update: 2016-10-04 Forwarded: not-needed libunwind uses the built-in __sync_* functions which are deprecated by GCC and should be replaced by __atomic_* ones. See the official manuals [1]. The legacy __sync functions do not require to specify the memory order but __atomic ones do, so we choose the strongest one: __ATOMIC_SEQ_CST. We do this because __sync_fetch_and_add() is not supported on armel. [1]: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html Gbp-Pq: Topic external/libunwind Gbp-Pq: Name legacy_built-in_sync_functions.patch --- diff --git a/external/libunwind/include/libunwind_i.h b/external/libunwind/include/libunwind_i.h index 1eb7b803..c06912a6 100644 --- a/external/libunwind/include/libunwind_i.h +++ b/external/libunwind/include/libunwind_i.h @@ -155,8 +155,8 @@ cmpxchg_ptr (void *addr, void *old, void *new) u.vp = addr; return __sync_bool_compare_and_swap(u.vlp, (long) old, (long) new); } -# define fetch_and_add1(_ptr) __sync_fetch_and_add(_ptr, 1) -# define fetch_and_add(_ptr, value) __sync_fetch_and_add(_ptr, value) +# define fetch_and_add1(_ptr) __atomic_fetch_add(_ptr, 1, __ATOMIC_SEQ_CST) +# define fetch_and_add(_ptr, value) __atomic_fetch_add(_ptr, value, __ATOMIC_SEQ_CST) # define HAVE_CMPXCHG # define HAVE_FETCH_AND_ADD #endif