﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1396	Compiling for win32 fails with VS2017	Mardoxx@…		"Build fails with


{{{
 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 (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\ml.EXE""' : return code '0x1'
Stop.
}}}

Workaround is to add `no-asm` option to openSSL configure.
i.e. edit line 9 of `makefile.msvc` to read `perl Configure VC-WIN32 no-shared	 no-asm \`

This workaround does not work with OpenSSL 1.0.2l.

Solution is change your build instructions to require nasm. OpenSSL only supports NASM, see `INSTALL.W32`. THen update `makefile.msvc` to the following:

{{{

# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.


all:
	cd $(OPENSSL)

	perl Configure VC-WIN32 no-shared				\
		--prefix=""%cd%/openssl"" 				\
		--openssldir=""%cd%/openssl/ssl"" 			\
		$(OPENSSL_OPT)

	if exist ms\do_nasm.bat (						\
		ms\do_nasm						\
		&& $(MAKE) -f ms\nt.mak					\
		&& $(MAKE) -f ms\nt.mak install				\
	) else (							\
		$(MAKE)							\
		&& $(MAKE) install_sw					\
	)
}}}

And update your build instructions to require installation of `NASM`. OpenSSL then builds fine and this allows you to build nginx with 1.0.2k and 1.0.2l. Can also build without `--with-openssl-opt=no-asm`"	defect	closed	minor		documentation	1.13.x	fixed				"nginx version: nginx/1.13.7
built by cl 19.11.25547 for x86
built with OpenSSL 1.0.2k  26 Jan 2017
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.41 --with-zlib=objs/lib/zlib-1.2.11 --with-select_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-openssl=objs/lib/openssl-1.0.2k --with-openssl-opt=no-asm --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module"
