Compiling Nginx on Windows 7

Maxim Dounin mdounin at mdounin.ru
Mon Jun 1 12:39:24 UTC 2015


Hello!

On Mon, Jun 01, 2015 at 10:45:04AM +0300, Andrei Belov wrote:

> 
> On 30 May 2015, at 23:00, z_kamikimo <nginx-forum at nginx.us> wrote:
> 
> > Im experiencing issues with compiling Nginx on Windows 7, every thing goes
> > good until nmake -f objs/Makefile.
> > I get the following error
> > 
> > Assembling: tmp32\sha1-586.asm
> > tmp32\sha1-586.asm(1432) : error A2070:invalid instruction operands
> > tmp32\sha1-586.asm(1576) : error A2070:invalid instruction operands
> > NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> > 10.0\VC\BI
> > N\ml.EXE"' : return code '0x1'
> > Stop.
> > NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> > 10.0\VC\BI
> > N\nmake.exe"' : return code '0x2'
> > Stop.
> > NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
> > 10.0\VC\BI
> > N\nmake.exe"' : return code '0x2'
> > Stop.
> 
> Are you trying to do the build on 64-bit Windows 7?
> 
> The attached patch may help (it was tested on Windows Server
> 2008 R2 Datacenter SP1 64-bit in the past).

This patch won't help, the error in question is a result of 
OpenSSL incorrect assembler handling in OpenSSL 1.0.2*.  In 
OpenSSL 1.* times OpenSSL folks did the following things:

- about 1.0.0 they changed default compilation procedure (the one 
  used by nginx on Windows), previously documented to be a way to 
  compile without asm at all, to use MASM; at the same time, they 
  declared that they will only support NASM.

- in 1.0.2 they broke both building with MASM (see errors 
  above) and building without asm at all (as per new compilation 
  procedure, introduced in 1.0.0).

Some comments about this can be found here (RT link seems to be 
dead for now):

https://github.com/openssl/openssl/issues/169
https://rt.openssl.org/Ticket/Display.html?id=3650&user=guest&pass=guest

Trivial workaround is to use latest OpenSSL from the 1.0.1 branch 
(1.0.1m as of now), it compiles fine either way.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list