Error “error A2009: syntax error in expression” when building OpenSSL x64 static libs

帅比萌擦擦* 提交于 2019-12-13 15:24:39

问题


I need the static libs of Openssl. I followed the instructions from here. The steps I did were as follows:

  1. Run the "Visual Studio 2008 x64 Cross Tools Command Prompt".
  2. Execute perl Configure VC-WIN64A no-shared no-idea
  3. Execute ms\do_win64a
  4. Edited ms\nt.mak and change "32" to "64" in the output dirs.
  5. Execute nmake -f ms\nt.mak

After doing all this, I get an error on the 5th step:

Assembling: tmp32\md5-x86_64.asm
tmp32\md5-x86_64.asm(8) : error A2009: syntax error in expression
tmp32\md5-x86_64.asm(9) : error A2009: syntax error in expression
tmp32\md5-x86_64.asm(677) : error A2009: syntax error in expression
tmp32\md5-x86_64.asm(678) : error A2009: syntax error in expression
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 8\VC
\BIN\x86_amd64\ml64.EXE"' : return code '0x1'
Stop.

What is going wrong here? Or can anyone provide me a link to the static libs of Openssl that I can use in my Visual Studio 20005?


回答1:


I found the answer to this problem. Somehow, nasm wasn't installed in my machine. The error shown here also didn't say anything about nasm either.




回答2:


I had the problem too, and found out that Perl was too old. The following line in x86_64-xlate.pl did not generate "PTR", although the variable $PTR was set:

$func .= "  mov QWORD${PTR}[8+rsp],rdi\t;WIN64 prologue\n";

When I installed ActiveState Perl 5.16.3 it worked fine!

(I only had Visual Studio masm installed, I guess that with nasm the generated code would've worked, since nasm doesn't seem to need the PTR keyword).




回答3:


Seems Active sate is also old in my environment. I am not sure if I was using correct version of nasm but my ml64.exe was not compatible with nasm by command line parameters. People said I had to add asm variable into my environment. So I did a global change in crypto\perlasm\x86_64-xlate.pl file: "PTR}[" to "PTR} [". Just added a space after variable.



来源:https://stackoverflow.com/questions/10546234/error-error-a2009-syntax-error-in-expression-when-building-openssl-x64-static

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!