[tor-dev] building from source in a 64-bit windows environment..

not me anemenja at gmail.com
Sat May 18 03:32:39 UTC 2013


> AFAIK, Tor has only been compiled as a Win32 app, never as a Win64 app.

More or less what I thought, tyvm.

> In the past, most of the time, Tor only builds on Windows with GCC/MinGW. But recently,
>Tor works primarily on Windows via MinGW toolchain, AFAIK still MinGW32. It has worked a few times in the past, in the last few weeks,
> another update was made for MSVC (Win32), and hopefully that still works with trunk.

I'm in the process of fighting with it trying to get it to at least
compile, I suspect it will blow up at run-time however. There has to
be a lot of bugs lurking waiting for the right conditions even on the
64-bit builds for unices, there's just so much stuff like using
intptr_t as a return value for socket() (is there even an OS that will
allow me to have billions of file descriptors open at once?). If I get
anything spectacular going, I'll post a diff or something, but I
suspect I'm going to loop back into the docs and just work on
something a little closer to my needs and bypass tor's code base all
together.

> Re: security, Tor has most of the modern exe image flags properly tweaked with GCC toolchain. But not with MSVC toolchain. IMO, that'd be a > nice patch, for MSVC build. But not too serious since Tor doesn't ship any MSVC-based distros, only GCC-based ones, as public binaries.

Well it's not just exe header flags, but the heuristics for
reorganizing stack variables and similar is just vastly superior. I
can't even count the number of times what should have been an
exploitable bug wasn't or in trying to demonstrate vulnerable code
I've had to resort to inline assembly, et cetera. It's really
irresponsible of people to utilize mingw on a windows platform IMHO,
MSFT research has put a lot of time and money into things and at least
for the time being there's really not adequate replacement.


>On the positive side, it seems like many Win32 projects get about 15% faster (when run on NT64 systems, removing the overhead of the Win32 > subsystem) ..at least looking at use of MSVC toolchain, unclear about MinGW64 toolchain. So there's a chance that these patches would
> mean Windows Tor perf could get 15% better on modern (NT64-based: all servers, most desktops, and some mobile devices) Windows boxen. > :-)

That's a pretty compelling argument to me.

cheers.


On Fri, May 17, 2013 at 11:04 PM, Blibbet <blibbet at gmail.com> wrote:
>> It seems fairly self-evident that tor hasn't been build for 64-bit
>>
>> windows and questionable whether it's ever been built in an
>> environment that doesn't utilize mingw. [...]
>
> ...
>
> AFAIK, Tor has only been compiled as a Win32 app, never as a Win64 app.
>
>> I realize that many/most/all of the developers here are going to see
>> no problem with using mingw, but if you spend some time looking
>> underneath the hood and reviewing the code generated by mingw v. msvc
>> both in terms of security features and general performance, [...]
>
>
> In the past, most of the time, Tor only builds on Windows with GCC/MinGW.
> But recently,
>
> Tor works primarily on Windows via MinGW toolchain, AFAIK still MinGW32. It
> has worked a few times in the past, in the last few weeks, another update
> was made for MSVC (Win32), and hopefully that still works with trunk.
>
> Re: security, Tor has most of the modern exe image flags properly tweaked
> with GCC toolchain. But not with MSVC toolchain. IMO, that'd be a nice
> patch, for MSVC build. But not too serious since Tor doesn't ship any
> MSVC-based distros, only GCC-based ones, as public binaries.
>
> I think the issue is not MSVC -vs- GCC, but Win32 -vs- Win64, if they're
> willing to take all those kinds of patches.
>
> And the additional burden for them to distribute 2* the Windows packages,
> both Win32 and Win64.
>
> It *might* be an issue that Thandy is also probably only Win32, and might
> also need to be ported, when updating the WIX/NSIS installer scripts (Thandy
> gets called from within some of those scripts).
>
> On the positive side, it seems like many Win32 projects get about 15% faster
> (when run on NT64 systems, removing the overhead of the Win32 subsystem)
> ..at least looking at use of MSVC toolchain, unclear about MinGW64
> toolchain. So there's a chance that these patches would mean Windows Tor
> perf could get 15% better on modern (NT64-based: all servers, most desktops,
> and some mobile devices) Windows boxen. :-)
>
>
> _______________________________________________
> tor-dev mailing list
> tor-dev at lists.torproject.org
> https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev


More information about the tor-dev mailing list