[tor-dev] Cross compiling Tor for Windows

Alexander Færøy ahf at torproject.org
Mon Feb 19 16:44:12 UTC 2018


Hello.

I have recently been trying to wrap my head around some of the
Windows/Unix I/O code of Tor to do an API experiment with the PT
subsystem.

While working on this I remembered that Nick did a cool trick during the
development of the consensus diff feature where he managed to reproduce
a Windows only test case failure with Wine on Linux using a cross
compiled version of Tor that he build on Linux as well.

I wanted to try out if I was able to make use of this "trick" as well
and decided to write a short guide for setting up the cross compilation
environment for Tor on Debian. The guide is published at
https://github.com/ahf/tor-win32

The tor-win32 repository also contains a Makefile that will fetch and
cross compile a minimal set of dependencies of Tor (OpenSSL, Libevent,
and zlib) and Tor itself to the point where you should be able to run
both tor.exe and the test suites in Wine.

I hope this might be useful to someone else if they find themselves
having a need to quickly try something out on "Windows" without actually
having to install it -- remember though that this is not the same as
running Tor and the test suites on an actual Windows machine, which is
what many of our users are using! :-)

Cheers,
Alex.

-- 
Alexander Færøy


More information about the tor-dev mailing list