aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-15 02:16:23 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-15 02:16:23 -0400
commit6c1d2549df546b6d2628582c9b078753eecd16f4 (patch)
tree4b0fbbc37f61ee5170292e32aef3dd9b3e8c44df /configure.ac
parentb4362b99cf1857f2fdf4390796bbf64ac9f204f3 (diff)
parent1868982de6c538b75ab599b332fa896492608620 (diff)
downloadtor-6c1d2549df546b6d2628582c9b078753eecd16f4.tar.gz
tor-6c1d2549df546b6d2628582c9b078753eecd16f4.zip
Merge branch 'maint-0.3.3' into maint-0.3.4
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ff54f41af2..ae5c8a83cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1683,6 +1683,26 @@ AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
AC_CHECK_SIZEOF(cell_t)
+# Let's see if stdatomic works. (There are some debian clangs that screw it
+# up; see Tor bug #26779 and debian bug 903709.)
+AC_CACHE_CHECK([whether C11 stdatomic.h actually works],
+ tor_cv_stdatomic_works,
+[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <stdatomic.h>
+struct x { atomic_size_t y; };
+void try_atomic_init(struct x *xx)
+{
+ atomic_init(&xx->y, 99);
+ atomic_fetch_add(&xx->y, 1);
+}
+]])], [tor_cv_stdatomic_works=yes], [tor_cv_stdatomic_works=no])])
+
+if test "$tor_cv_stdatomic_works" = "yes"; then
+ AC_DEFINE(STDATOMIC_WORKS, 1, [Set to 1 if we can compile a simple stdatomic example.])
+elif test "$ac_cv_header_stdatomic_h" = "yes"; then
+ AC_MSG_WARN([Your compiler provides the stdatomic.h header, but it doesn't seem to work. I'll pretend it isn't there. If you are using Clang on Debian, maybe this is because of https://bugs.debian.org/903709 ])
+fi
+
# Now make sure that NULL can be represented as zero bytes.
AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
[AC_RUN_IFELSE([AC_LANG_SOURCE(