diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-04-11 18:12:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-04-11 18:12:44 -0400 |
commit | a1178cdbcf1f99715204567152635a57c705af0e (patch) | |
tree | a76a3103c218ca5d51371897e81d8f0bb7ceb06e | |
parent | d028c005da8e61f705aff751b5236adf983b310a (diff) | |
parent | 85e7de68bcfe6b137e0d4bb5fbfdc5f4a3db6a2d (diff) | |
download | tor-a1178cdbcf1f99715204567152635a57c705af0e.tar.gz tor-a1178cdbcf1f99715204567152635a57c705af0e.zip |
Merge branch 'bug8587_v3' into maint-0.2.4
-rw-r--r-- | changes/bug8587 | 5 | ||||
-rw-r--r-- | configure.ac | 44 |
2 files changed, 31 insertions, 18 deletions
diff --git a/changes/bug8587 b/changes/bug8587 new file mode 100644 index 0000000000..84d2f1ec0d --- /dev/null +++ b/changes/bug8587 @@ -0,0 +1,5 @@ + o Minor bugfixes (build): + - Build Tor correctly on 32-bit platforms where the compiler can build + but not run code using the "uint128_t" construction. Fixes bug 8587; + bugfix on 0.2.4.8-alpha. + diff --git a/configure.ac b/configure.ac index ed452cb541..6f40ac4ad2 100644 --- a/configure.ac +++ b/configure.ac @@ -663,30 +663,38 @@ if test x$enable_curve25519 != xno; then [AC_LANG_PROGRAM([dnl #include <stdint.h> typedef unsigned uint128_t __attribute__((mode(TI))); + int func(uint64_t a, uint64_t b) { + uint128_t c = ((uint128_t)a) * b; + int ok = ((uint64_t)(c>>96)) == 522859 && + (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L && + (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L && + (((uint64_t)(c))&0xffffffffL) == 0; + return ok; + } ], [dnl - uint64_t a = ((uint64_t)2000000000) * 1000000000; - uint64_t b = ((uint64_t)1234567890) << 24; - uint128_t c = ((uint128_t)a) * b; - return ((uint64_t)(c>>96)) == 522859 && - ((uint64_t)(c>>64))&0xffffffffL == 3604448702L && - ((uint64_t)(c>>32))&0xffffffffL == 2351960064L && - ((uint64_t)(c))&0xffffffffL == 0; + int ok = func( ((uint64_t)2000000000) * 1000000000, + ((uint64_t)1234567890) << 24); + return !ok; ])], [tor_cv_can_use_curve25519_donna_c64=yes], [tor_cv_can_use_curve25519_donna_c64=no], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([dnl - #include <stdint.h> - typedef unsigned uint128_t __attribute__((mode(TI))); - ], [dnl - uint64_t a = ((uint64_t)2000000000) * 1000000000; - uint64_t b = ((uint64_t)1234567890) << 24; - uint128_t c = ((uint128_t)a) * b; - return ((uint64_t)(c>>96)) == 522859 && - ((uint64_t)(c>>64))&0xffffffffL == 3604448702L && - ((uint64_t)(c>>32))&0xffffffffL == 2351960064L && - ((uint64_t)(c))&0xffffffffL == 0; - ])], + #include <stdint.h> + typedef unsigned uint128_t __attribute__((mode(TI))); + int func(uint64_t a, uint64_t b) { + uint128_t c = ((uint128_t)a) * b; + int ok = ((uint64_t)(c>>96)) == 522859 && + (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L && + (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L && + (((uint64_t)(c))&0xffffffffL) == 0; + return ok; + } + ], [dnl + int ok = func( ((uint64_t)2000000000) * 1000000000, + ((uint64_t)1234567890) << 24); + return !ok; + ])], [tor_cv_can_use_curve25519_donna_c64=cross], [tor_cv_can_use_curve25519_donna_c64=no])])]) |