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

Nick Mathewson nickm at alum.mit.edu
Sat May 18 14:43:17 UTC 2013

On Fri, May 17, 2013 at 10:07 PM, not me <anemenja at gmail.com> wrote:
> Hi,
> 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.

Neither of these is true.

For one, Tor builds fine for me, with no warnings, for me under
mingw64.   (I just tried it out to be sure, and used
--enable-gcc-warnings to make sure I got all the weird fiddly

For the other, there's been an nmakefile for ages now.   That would
seem to suggest that an msvc build has happened at least once.  It
doesn't get updated too often, because msvc users don't test or send
patches very often.

>  There are literally hundreds
> of thousands of warnings about integer truncation, at least some of
> which seem somewhat problematic (64-bit pointer being stored in a
> 32-bit integer (why?! why?!)),

I bet you didn't edit src/win32/orconfig.h  ? Ordinarily, autoconf
would be setting all the types right for you, but if it isn't there,
you need those defines to be right for your platform.  For example, I
bet that you've still got a #define SIZEOF_VOID_P 4 in there.

A patch to add an appropriate set of #ifdefs for win64 to
src/win32/orconfig.h would be welcome.

>a small amount of signed/unsigned
> comparisons or sign extensions,

Those I'd like to fix, if they turn out to be real once the orconfig.h
issues are fixed.

> and a bunch of calls to functions
> without including the proper header files or using the correct
> function name ('open()' vs '_open()' without including io.h) and so
> on.

Clean patches would be welcome here.

> This of course is ignoring all the calls to
> str{,n}cpy/{v,}s{,n}printf/etc and posix function names long since
> deprecated (fileno() vs _fileno()) and so on. Errors relating to MSVC
> finally including a stdint header (cstdint) and typedef's for intptr_t
> not producing the right size primitive, etc.

strncpy and vsnprinf and fileno aren't deprecated in my world.

That said, I would sure not object to somebody doing the requisite
work to make Tor build happily and warning-free under msvc and under
msvc for windows 64, and I'd be happy to take whatever clean patches
come out of this.

(I keep saying "clean" to emphasize that I'm *not* going to take
patches that break other operating systems or compilers or older
versions of msvc, and I'm *not* going to take patches that litter the
code with #ifdefs in every single function that makes a syscall. I
shouldn't have to say this, but I've gotten a lot of patches like that
over the years.)


More information about the tor-dev mailing list