]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix two dump bugs in "whether we can use curve25519-donna-c64" test
authorNick Mathewson <nickm@torproject.org>
Mon, 25 Mar 2013 14:07:41 +0000 (10:07 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 25 Mar 2013 14:07:41 +0000 (10:07 -0400)
Dumb bug 1: == has higher precedence than &.

Dumb bug 2: the main() function in an AC_RUN_IFELSE test is expected
to return 0 on success, not 1.

changes/bug8587 [new file with mode: 0644]
configure.ac

diff --git a/changes/bug8587 b/changes/bug8587
new file mode 100644 (file)
index 0000000..84d2f1e
--- /dev/null
@@ -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.
+
index ed452cb541a2ba1f99ef3b4fb4ad9d60726cb5f2..8a79653e0446e4ffd0ae03a9d5e09b01ff080717 100644 (file)
@@ -667,10 +667,11 @@ if test x$enable_curve25519 != xno; then
           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 = ((uint64_t)(c>>96)) == 522859 &&
+                  (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L &&
+                   (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L &&
+                   (((uint64_t)(c))&0xffffffffL) == 0;
+          return !ok;
         ])],
        [tor_cv_can_use_curve25519_donna_c64=yes],
         [tor_cv_can_use_curve25519_donna_c64=no],
@@ -682,10 +683,11 @@ if test x$enable_curve25519 != xno; then
               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 = ((uint64_t)(c>>96)) == 522859 &&
+                    (((uint64_t)(c>>64))&0xffffffffL) == 3604448702L &&
+                     (((uint64_t)(c>>32))&0xffffffffL) == 2351960064L &&
+                     (((uint64_t)(c))&0xffffffffL) == 0;
+              return !ok;
             ])],
             [tor_cv_can_use_curve25519_donna_c64=cross],
            [tor_cv_can_use_curve25519_donna_c64=no])])])