[tor-bugs] #18626 [Tor]: Cannot compile Tor for 64-bit architectures with Xcode 7.3

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Mar 25 11:45:22 UTC 2016


#18626: Cannot compile Tor for 64-bit architectures with Xcode 7.3
----------------------------+---------------------
 Reporter:  chrisballinger  |          Owner:
     Type:  defect          |         Status:  new
 Priority:  Medium          |      Milestone:
Component:  Tor             |        Version:
 Severity:  Normal          |     Resolution:
 Keywords:                  |  Actual Points:
Parent ID:                  |         Points:
 Reviewer:                  |        Sponsor:
----------------------------+---------------------

Comment (by cypherpunks):

 As seen in the error message, compilation fails due to the use of exit().
 Using exit() is unnecessary because Autoconf generates code that ensures
 the test program returns from main() with zero (and this can be verified
 by searching for `zlibVersion` in the generated configure file.

 Instead of including stdlib.h, the calls to exit() should be removed. I
 suggest the following patch (which has been tested with `make distcheck`).

 {{{
 diff --git a/configure.ac b/configure.ac
 index df4b9cd..d6d65d4 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -492,19 +492,18 @@ TOR_SEARCH_LIBRARY(libevent, $trylibeventdir,
 [-levent $STATIC_LIBEVENT_FLAGS $T
  #ifdef _WIN32
  #include <winsock2.h>
  #endif
 -#include <stdlib.h>
  #include <sys/time.h>
  #include <sys/types.h>
  #include <event.h>], [
  #ifdef _WIN32
  #include <winsock2.h>
  #endif
 -void exit(int); void *event_init(void);],
 +void *event_init(void);],
      [
  #ifdef _WIN32
  {WSADATA d; WSAStartup(0x101,&d); }
  #endif
 -event_init(); exit(0);
 +event_init();
  ], [--with-libevent-dir], [/opt/libevent])

  dnl Now check for particular libevent functions.
 @@ -644,7 +643,7 @@ AC_ARG_WITH(ssl-dir,
  TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI],
      [#include <openssl/rand.h>],
      [void RAND_add(const void *buf, int num, double entropy);],
 -    [RAND_add((void*)0,0,0); exit(0);], [],
 +    [RAND_add((void*)0,0,0);], [],
      [/usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl
 /usr/local /usr/athena /opt/openssl])

  dnl XXXX check for OPENSSL_VERSION_NUMBER == SSLeay()
 @@ -721,7 +720,7 @@ tor_zlib_devpkg_debian="zlib1g-dev"
  TOR_SEARCH_LIBRARY(zlib, $tryzlibdir, [-lz],
      [#include <zlib.h>],
      [const char * zlibVersion(void);],
 -    [zlibVersion(); exit(0);], [--with-zlib-dir],
 +    [zlibVersion();], [--with-zlib-dir],
      [/opt/zlib])

  if test "$enable_static_zlib" = "yes"; then
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18626#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list