Merge branch 'backport-434-arm-atomics-glib-2-58' into 'glib-2-58'

meson: Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 on GNU/Linux if needed (backport to glib-2-58)

See merge request GNOME/glib!449
This commit is contained in:
Simon McVittie 2018-11-05 12:37:39 +00:00
commit abc239530b

View File

@ -1571,8 +1571,8 @@ atomicdefine = '''
# We know that we can always use real ("lock free") atomic operations with MSVC # We know that we can always use real ("lock free") atomic operations with MSVC
if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops') if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops')
have_atomic_lock_free = true have_atomic_lock_free = true
if host_system == 'android' and not cc.compiles(atomicdefine, name : 'atomic ops define') if (host_system == 'android' or host_system == 'linux') and not cc.compiles(atomicdefine, name : 'atomic ops define')
# When building for armv5 on Android, gcc 4.9 provides # When building for armv5 on Linux, gcc provides
# __sync_bool_compare_and_swap but doesn't define # __sync_bool_compare_and_swap but doesn't define
# __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
glib_conf.set('__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4', true) glib_conf.set('__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4', true)