aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-08 15:50:29 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-08 15:50:29 -0400
commit26f1167e7151791a04a2c8584360f37602320779 (patch)
tree0eb3173a5cba9213b7db0ee35ae0917e1489391b /configure.ac
parent7787150521fda0370331dab80d043294e05e1598 (diff)
parentb66386865e68d8df0f228187781fcd5bc2dbf184 (diff)
downloadtor-26f1167e7151791a04a2c8584360f37602320779.tar.gz
tor-26f1167e7151791a04a2c8584360f37602320779.zip
Merge branch 'bug26779_033' into bug26779_035
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 9c9ea11c73..02a1655099 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1658,6 +1658,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(