[Tor-BSD] Building Tor 0.2.7.x on OpenBSD

teor teor2345 at gmail.com
Thu Jul 23 19:52:24 EDT 2015


> On 24 Jul 2015, at 07:17 , attila <attila at stalphonsos.com> wrote:
> 
> Signed PGP part
> 
> teor <teor2345 at gmail.com> writes:
> 
> >> On 16 Jul 2015, at 05:23 , Michael McConville <mmcconville at mykolab.com> wrote:
> >>
> >> The Libevent 2 port splits it into a bunch of different sub-archives,
> >> and the Tor configure options for manual library dependencies seem
> >> pretty brittle. I tweaked it some and got it to compile, but it crashed
> >> at runtime.
> 
> I seem to have done slightly better just now, albeit on i386.  The
> patch embedded in this email allowed me to build head of line tor
> w/libevent2 installed on OpeBSD-current from packages:

I've logged this in the Tor trac so we don't lose it:
https://trac.torproject.org/projects/tor/ticket/16651

If someone wants to turn it into a git branch (re)based on the latest master, that would make it even easier to merge.

> 
> Jul 23 16:09:52.635 [notice] Tor v0.2.7.1-alpha-dev (git-aeeb6376aab186fd) (with bufferevents) running on OpenBSD with Libevent 2.0.22-stable, OpenSSL LibreSSL 2.2 and Zlib 1.2.3.
> 
> Furthermore it seems to run and build a first circuit with no
> problems.  I have not done more than (effectively) this smoke test at
> this point.  In fact what's bogging me down is that "gmake test" fails
> four times and I'm digging through the tor test suite to try and grok
> it in fullness... however, I don't want this grokking to slow anyone
> else down who could take this and run with it, so...
> 
> This is how I configured tor after pkg_add'ing libevent:
> 
>   $ env AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.11 ./autogen.sh
>   $ env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib \
>     ./configure --with-ssl-dir=/usr --disable-gcc-hardening \
>                 --enable-bufferevents --disable-asciidoc
> 
> N.B. I'm still running the 11 July snap, and this is i386, not amd64.
> YMMV.  That's not the most recent snap, so...
> 
> Patch:
> ========================================================================
> diff --git a/configure.ac b/configure.ac
> index 214b7e6..79bd1cc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -570,7 +570,9 @@ int x = y(zz);
> #else
> int x = 1;
> #endif
> -   ])], [ AC_MSG_RESULT([yes]) ],
> +   ])], [ AC_MSG_RESULT([yes])
> +       TOR_LIBEVENT_LIBS="-levent_pthreads -levent_core -levent_extra"
> +   ],
>        [ AC_MSG_RESULT([no])
>          AC_MSG_ERROR([Libevent does not seem new enough to support bufferevents.  We require 2.0.13-stable or later]) ] )
>      fi
> diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
> index a366b6c..b6382c0 100644
> --- a/src/common/compat_libevent.c
> +++ b/src/common/compat_libevent.c
> @@ -197,7 +197,8 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
>      cfg = event_config_new();
>      tor_assert(cfg);
> 
> -#if defined(_WIN32) && defined(USE_BUFFEREVENTS)
> +#if defined(USE_BUFFEREVENTS)
> +# if defined(_WIN32)
>      if (! torcfg->disable_iocp) {
>        evthread_use_windows_threads();
>        event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
> @@ -206,6 +207,9 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
>      } else {
>        using_iocp_bufferevents = 0;
>      }
> +# else
> +    evthread_use_pthreads();
> +# endif
> #elif defined(__COVERITY__)
>      /* Avoid a 'dead code' warning below. */
>      using_threads = ! torcfg->disable_iocp;
> ========================================================================
> 
> Pax, -A
> --
> http://trac.haqistan.net | attila at stalphonsos.com | 0xE6CC1EDB
> 

Tim Wilson-Brown (teor)

teor2345 at gmail dot com
pgp ABFED1AC
https://gist.github.com/teor2345/d033b8ce0a99adbc89c5

teor at blah dot im
OTR D5BE4EC2 255D7585 F3874930 DB130265 7C9EBBC7

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.nycbug.org/pipermail/tor-bsd/attachments/20150724/42752993/attachment.bin>


More information about the Tor-BSD mailing list