title: How to build OpenSSL in VS2015: x86cpuid.asm is an empty file
body: <p>I need to build OpenSSL for a project that's using VS2015, 32-bit. </p>
  
  <p>The instructions I found are <a href="http://developer.covenanteyes.com/building-openssl-for-visual-studio/">http://developer.covenanteyes.com/building-openssl-for-visual-studio/</a> and an updated/edited version reportedly using VS2015 
  at <a href="http://blog.box.kr/?p=953">http://blog.box.kr/?p=953</a> .</p>
  
  <p>In the directory where I unpacked the distribution, I first did <code>cl</code> to verify that I had a MS Compiler build prompt (as set up by their batch file), and <code>perl -v</code> to make sure I had Perl.  Then,</p>
  
  <pre><code>perl Configure VC-WIN32   no-idea no-mdc2 no-rc5  --prefix=e:\some\path
  ms\do_ms
  nmake -f ms\nt.mak
  </code></pre>
  
  <p>and at this last step I get:</p>
  
  <pre><code>Building OpenSSL
      perl .\util\copy-if-different.pl ".\crypto\buildinf.h" "tmp32\buildinf.h"
  Copying: ./crypto/buildinf.h to tmp32/buildinf.h
      perl .\util\copy-if-different.pl ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h"
  Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
      ml /nologo /Cp /coff /c /Cx /Zi /Fotmp32\x86cpuid.obj tmp32\x86cpuid.asm
  Assembling: tmp32\x86cpuid.asm
  tmp32\x86cpuid.asm(1) : error A2088:END directive required at end of file
  NMAKE : fatal error U1077: '"D:\@Prog-Charon\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\ml.EXE"' : return code '0x1'
  Stop.
  </code></pre>
  
  <p>I find that <code>E:\C++Libs\openssl-1.0.2e\tmp32\x86cpuid.asm</code> is a <strong>zero-length file</strong>.</p>
  
  <p>What I <em>really want</em> is to have (build or find ready-made) a static library for a project that will use the dynamic run-time library.</p>
  
  <hr>
  
  <p>Update:  if I run the step manually, </p>
  
  <pre><code>perl crypto\x86cpuid.pl win32 &gt; tmp32\x86cpuid.asm
  </code></pre>
  
  <p>then when the makefile gets to that file it gives me </p>
  
  <pre><code>    ml /nologo /Cp /coff /c /Cx /Zi /Fotmp32\x86cpuid.obj tmp32\x86cpuid.asm
  Assembling: tmp32\x86cpuid.asm
  tmp32\x86cpuid.asm(35) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(59) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(64) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(70) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(75) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(90) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(98) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(105) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(165) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(182) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(186) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(322) : error A2085:instruction or register not accepted in current CPU mode
  tmp32\x86cpuid.asm(335) : error A2085:instruction or register not accepted in current CPU mode
  NMAKE : fatal error U1077: '"D:\@Prog-Charon\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\ml.EXE"' : return code '0x1'
  </code></pre>
  
  <p>Now it happens that line 35 etc. is <code>cpuid</code>, which is the whole point of having this file!  </p>