blob: 44482dd2b7b93f9da2e99ce7a0d01591675a6ad5 [file] [log] [blame]
Andrew Geissler4b740dc2020-05-05 08:54:39 -05001From 4b97f457b7b44117e27d2a218c4b68e7fe3fe4ce Mon Sep 17 00:00:00 2001
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Oct 2019 17:46:26 -0700
4Subject: [PATCH] meson: Run atomics test on clang as well
5
6Fixes
7./glib-2.62.1/glib/gatomic.c:675:2: error: G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics.
8^
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geissler4b740dc2020-05-05 08:54:39 -050012
Brad Bishopf3f93bb2019-10-16 14:33:32 -040013---
14 meson.build | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/meson.build b/meson.build
Andrew Geissler4b740dc2020-05-05 08:54:39 -050018index afb6eaa..6aa70f5 100644
Brad Bishopf3f93bb2019-10-16 14:33:32 -040019--- a/meson.build
20+++ b/meson.build
Andrew Geissler4b740dc2020-05-05 08:54:39 -050021@@ -1692,7 +1692,7 @@ atomicdefine = '''
Brad Bishopf3f93bb2019-10-16 14:33:32 -040022 # We know that we can always use real ("lock free") atomic operations with MSVC
23 if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' or cc.links(atomictest, name : 'atomic ops')
24 have_atomic_lock_free = true
25- if cc.get_id() == 'gcc' and not cc.compiles(atomicdefine, name : 'atomic ops define')
26+ if (cc.get_id() == 'gcc' or cc.get_id() == 'clang') and not cc.compiles(atomicdefine, name : 'atomic ops define')
27 # Old gcc release may provide
28 # __sync_bool_compare_and_swap but doesn't define
29 # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4