0003-meson.build-fix-intel-atomics-detection.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 00f6ac3c24f36fa07fa93f4a89ee873edf125098 Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Mon, 16 Jul 2018 23:01:40 +0200
  4. Subject: [PATCH] meson.build: fix intel atomics detection
  5. Use the stronger compiler.link() test (instead of the weaker
  6. compiler.compile()) to fix the intel atomics detection.
  7. Fixes false positive in case of sparc compile (buildroot toolchain).
  8. Upstream suggested: https://lists.freedesktop.org/archives/dri-devel/2018-July/183885.html
  9. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  10. ---
  11. meson.build | 3 ++-
  12. 1 file changed, 2 insertions(+), 1 deletion(-)
  13. diff --git a/meson.build b/meson.build
  14. index 9b443a5..3c8afb6 100644
  15. --- a/meson.build
  16. +++ b/meson.build
  17. @@ -49,9 +49,10 @@ intel_atomics = false
  18. lib_atomics = false
  19. dep_atomic_ops = dependency('atomic_ops', required : false)
  20. -if cc.compiles('''
  21. +if cc.links('''
  22. int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
  23. int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
  24. + int main() { }
  25. ''',
  26. name : 'Intel Atomics')
  27. intel_atomics = true
  28. --
  29. 2.18.0