summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2018-06-11 14:56:26 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-06-13 11:06:55 -0700
commit54b38ea4955a40fbf719cd8c9855990e677ec22d (patch)
treeb8843cf9c8d8b806a79c2a81bb7add54be7b8948
parentf9500edb96b7b50a6ab29ebf694610f0112d741f (diff)
downloadmesa-54b38ea4955a40fbf719cd8c9855990e677ec22d.tar.gz
meson: Fix -latomic check
Commit 54ba73ef102f (configure.ac/meson.build: Fix -latomic test) fixed some checks for -latomic, and then commit 54bbe600ec26 (configure.ac: rework -latomic check) further extended the fixes in configure.ac but not in Meson. This commit extends those fixes to the Meson tests. Fixes: 54bbe600ec26 (configure.ac: rework -latomic check) Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (cherry picked from commit b29b5a82a17e845e73ebef845176d9d1f44a2d00)
-rw-r--r--meson.build8
1 files changed, 7 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 4f842fef56d..c87af4844f5 100644
--- a/meson.build
+++ b/meson.build
@@ -836,7 +836,13 @@ endif
# Check for GCC style atomics
dep_atomic = null_dep
-if cc.compiles('int main() { int n; return __atomic_load_n(&n, __ATOMIC_ACQUIRE); }',
+if cc.compiles('''#include <stdint.h>
+ int main() {
+ struct {
+ uint64_t *v;
+ } x;
+ return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE);
+ }''',
name : 'GCC atomic builtins')
pre_args += '-DUSE_GCC_ATOMIC_BUILTINS'