1*edff4923SAndrew GeisslerFrom f04ea29f9f96892ada81bd0acfcef70183138229 Mon Sep 17 00:00:00 2001
2*edff4923SAndrew GeisslerFrom: Khem Raj <raj.khem@gmail.com>
3*edff4923SAndrew GeisslerDate: Sat, 12 Oct 2019 17:46:26 -0700
4*edff4923SAndrew GeisslerSubject: [PATCH] meson: Run atomics test on clang as well
5*edff4923SAndrew Geissler
6*edff4923SAndrew GeisslerFixes
7*edff4923SAndrew Geissler./glib-2.62.1/glib/gatomic.c:675:2: error: G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics.
8*edff4923SAndrew Geissler^
9*edff4923SAndrew Geissler
10*edff4923SAndrew GeisslerUpstream-Status: Pending
11*edff4923SAndrew GeisslerSigned-off-by: Khem Raj <raj.khem@gmail.com>
12*edff4923SAndrew Geissler---
13*edff4923SAndrew Geissler meson.build | 2 +-
14*edff4923SAndrew Geissler 1 file changed, 1 insertion(+), 1 deletion(-)
15*edff4923SAndrew Geissler
16*edff4923SAndrew Geisslerdiff --git a/meson.build b/meson.build
17*edff4923SAndrew Geisslerindex 257afb5..5caa6e6 100644
18*edff4923SAndrew Geissler--- a/meson.build
19*edff4923SAndrew Geissler+++ b/meson.build
20*edff4923SAndrew Geissler@@ -2024,7 +2024,7 @@ atomicdefine = '''
21*edff4923SAndrew Geissler # We know that we can always use real ("lock free") atomic operations with MSVC
22*edff4923SAndrew Geissler if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' or cc.links(atomictest, name : 'atomic ops')
23*edff4923SAndrew Geissler   have_atomic_lock_free = true
24*edff4923SAndrew Geissler-  if cc.get_id() == 'gcc' and not cc.compiles(atomicdefine, name : 'atomic ops define')
25*edff4923SAndrew Geissler+  if (cc.get_id() == 'gcc' or cc.get_id() == 'clang') and not cc.compiles(atomicdefine, name : 'atomic ops define')
26*edff4923SAndrew Geissler     # Old gcc release may provide
27*edff4923SAndrew Geissler     # __sync_bool_compare_and_swap but doesn't define
28*edff4923SAndrew Geissler     # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
29