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

attila attila at stalphonsos.com
Tue Jul 28 11:03:29 EDT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA384


teor <teor2345 at gmail.com> writes:

>> 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
>

Okay, after going around with teor one more time I think we finally
have a winner, which I have attached to the above ticket.  This also
deals with nickm's original criticism of the patch, which was correct
(and which I didn't see until just now)...

... now back to the test suite failures...

> 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

Pax, -A
- --
http://trac.haqistan.net | attila at stalphonsos.com | 0xE6CC1EDB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Processed by Mailcrypt 3.5.9 <http://mailcrypt.sourceforge.net/>

iQIcBAEBCQAGBQJVt5m1AAoJEJZ30KbmzB7bc64QAKQsTC0DqtpoCsUwH3lK7aZX
9cblEM7uS8IDU51o1tXyNHdg6U9bQCBGH2Ho3XkLnDHiOJN/zQnbf76+7n+I6X2n
KhYREb+CbPYefE4IODiultA6FkSn/bFHoQtTTz48QEyT8rhBXFpThzf24+qp6SrT
ZC07YHPzd1iocTgVv5LRBBWfzkkRgELPWoDBoQnOOano5vqU6lkBWz2cM8hl5D00
EqS1V098CFFlkPhk1NuVu4ID1IepGqGgjyL/sVxmMJ8qIwjLJhgwX5dpIBNLwbpq
lImNBsHxSoY2bQ6/7CpR8zE2p5v0O8E1gEH99EfUJflrb8j2k4A315Uhn4HpdOPa
8fhQpmgTLSvnEpiX70AADtiDCND+vin5nAgCwXDLLZWm03R9CMtofCWHpgtVYiv1
MT7R1YosLCfcvCX4B1f8PQC6SYnIRsFFy2ZXIiERtO1AwFqYpfgfPpTZ37QFhTTa
rZy9eGUgBi3gm8LrOp88oP+cSgfUBN/ascyPcITtx4RqU76Tz514EtV9C0D14Oi8
OqX5Gk17eAWuxFsZbRvZ92Z8WKwWYze8NtU+W0nxMQLUhFM4enoR3Y8sCPbiCNSc
f9bsEiaCaZyrSY1/AMKRHcaUlFew/oCRcDaixAGDns4Z5URVGFAIFhe3LmFhlpPk
4nqSXDtGECdH9GyCu4Nh
=Nstp
-----END PGP SIGNATURE-----



More information about the Tor-BSD mailing list