如何在 VS2015 中构建 OpenSSL:x86cpuid.asm 是一个空文件 [英] How to build OpenSSL in VS2015: x86cpuid.asm is an empty file
问题描述
我需要为使用 VS2015、32 位的项目构建 OpenSSL.
I need to build OpenSSL for a project that's using VS2015, 32-bit.
我发现的说明是 http://developer.covenanteyes.com/building-openssl-for-visual-studio/ 和据报道使用 VS2015 的更新/编辑版本http://blog.box.kr/?p=953.
The instructions I found are http://developer.covenanteyes.com/building-openssl-for-visual-studio/ and an updated/edited version reportedly using VS2015 at http://blog.box.kr/?p=953 .
在我解压发行版的目录中,我首先执行 cl
以验证我有一个 MS Compiler 构建提示(由他们的批处理文件设置),以及 perl -v
以确保我有 Perl.那么,
In the directory where I unpacked the distribution, I first did cl
to verify that I had a MS Compiler build prompt (as set up by their batch file), and perl -v
to make sure I had Perl. Then,
perl Configure VC-WIN32 no-idea no-mdc2 no-rc5 --prefix=e:somepath
msdo_ms
nmake -f ms
t.mak
在这最后一步我得到:
Building OpenSSL
perl .utilcopy-if-different.pl ".cryptouildinf.h" "tmp32uildinf.h"
Copying: ./crypto/buildinf.h to tmp32/buildinf.h
perl .utilcopy-if-different.pl ".cryptoopensslconf.h" "inc32opensslopensslconf.h"
Copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
ml /nologo /Cp /coff /c /Cx /Zi /Fotmp32x86cpuid.obj tmp32x86cpuid.asm
Assembling: tmp32x86cpuid.asm
tmp32x86cpuid.asm(1) : error A2088:END directive required at end of file
NMAKE : fatal error U1077: '"D:@Prog-CharonProgram Files (x86)Microsoft Visual Studio 14.0VCBINml.EXE"' : return code '0x1'
Stop.
我发现 E:C++Libsopenssl-1.0.2e mp32x86cpuid.asm
是一个零长度文件.
我真正想要的是为将使用动态运行时库的项目拥有(构建或查找现成的)静态库.
What I really want is to have (build or find ready-made) a static library for a project that will use the dynamic run-time library.
更新:如果我手动运行该步骤,
Update: if I run the step manually,
perl cryptox86cpuid.pl win32 > tmp32x86cpuid.asm
然后当 makefile 到达该文件时,它给了我
then when the makefile gets to that file it gives me
ml /nologo /Cp /coff /c /Cx /Zi /Fotmp32x86cpuid.obj tmp32x86cpuid.asm
Assembling: tmp32x86cpuid.asm
tmp32x86cpuid.asm(35) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(59) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(64) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(70) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(75) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(90) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(98) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(105) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(165) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(182) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(186) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(322) : error A2085:instruction or register not accepted in current CPU mode
tmp32x86cpuid.asm(335) : error A2085:instruction or register not accepted in current CPU mode
NMAKE : fatal error U1077: '"D:@Prog-CharonProgram Files (x86)Microsoft Visual Studio 14.0VCBINml.EXE"' : return code '0x1'
现在恰好第 35 行等是 cpuid
,这就是拥有这个文件的全部意义所在!
Now it happens that line 35 etc. is cpuid
, which is the whole point of having this file!
推荐答案
在 Windows 上构建 OpenSSL 1.0.2d 作为静态库
注意:以下文字摘自我的 SoftHSM2 构建说明.
- Visual Studio(2015 社区)
- 适用于 Windows 的 GNU 隐私保护 (2.2.5)
- 7-zip (9.20)
- 草莓 Perl (5.22.0.1)
- 网络汇编器 (2.11.08)
- Visual Studio (2015 Community)
- GNU Privacy Guard for Windows (2.2.5)
- 7-zip (9.20)
- Strawberry Perl (5.22.0.1)
- The Netwide Assembler (2.11.08)
创建工作目录:
mkdir C:uildin
mkdir C:uildsrc
使用 OpenSSL 1.0.2d.org/source/openssl-1.0.2d.tar.gz.asc">它的签名进入C:uildsrc
目录并验证下载档案的签名:
Download OpenSSL 1.0.2d with its signature into C:uildsrc
directory and verify signature of the downloaded archive:
cd C:uildsrc
gpg --keyserver pgp.mit.edu --recv-keys 0E604491
gpg --verify openssl-1.0.2d.tar.gz.asc openssl-1.0.2d.tar.gz
构建 32 位版本
将存档 openssl-1.0.2d.tar.gz
解压到 C:uildsrcopenssl-1.0.2d-x86
目录:
cd C:uildsrc
"C:Program Files7-Zip7z" x openssl-1.0.2d.tar.gz
"C:Program Files7-Zip7z" x openssl-1.0.2d.tar
rename openssl-1.0.2d openssl-1.0.2d-x86
del openssl-1.0.2d.tar
在新的命令行窗口中构建 OpenSSL 并将其安装到 C:uildinopenssl-1.0.2d-x86
目录:
In a new command line window build OpenSSL and install it into C:uildinopenssl-1.0.2d-x86
directory:
cd C:uildsrcopenssl-1.0.2d-x86
set PATH=%PATH%;C:
asm
"C:Program Files (x86)Microsoft Visual Studio 14.0VCvcvarsall.bat"
perl Configure VC-WIN32 --prefix=C:uildinopenssl-1.0.2d-x86 enable-static-engine
msdo_nasm
nmake /f ms
t.mak
nmake /f ms
t.mak test
nmake /f ms
t.mak install
生成的构建位于 C:uildinopenssl-1.0.2d-x86
目录中.
Resulting build is located in C:uildinopenssl-1.0.2d-x86
directory.
解压存档 openssl-1.0.2d.tar.gz
到 C:uildsrcopenssl-1.0.2d-x64
目录:
Extract archive openssl-1.0.2d.tar.gz
into C:uildsrcopenssl-1.0.2d-x64
directory:
cd C:uildsrc
"C:Program Files7-Zip7z" x openssl-1.0.2d.tar.gz
"C:Program Files7-Zip7z" x openssl-1.0.2d.tar
rename openssl-1.0.2d openssl-1.0.2d-x64
del openssl-1.0.2d.tar
在新的命令行窗口中构建 OpenSSL 并将其安装到 C:uildinopenssl-1.0.2d-x64
目录:
In a new command line window build OpenSSL and install it into C:uildinopenssl-1.0.2d-x64
directory:
cd C:uildsrcopenssl-1.0.2d-x64
set PATH=%PATH%;C:
asm
"C:Program Files (x86)Microsoft Visual Studio 14.0VCvcvarsall.bat" amd64
perl Configure VC-WIN64A --prefix=C:uildinopenssl-1.0.2d-x64 enable-static-engine
msdo_win64a
nmake /f ms
t.mak
nmake /f ms
t.mak test
nmake /f ms
t.mak install
生成的构建位于 C:uildinopenssl-1.0.2d-x64
目录中.
Resulting build is located in C:uildinopenssl-1.0.2d-x64
directory.
这篇关于如何在 VS2015 中构建 OpenSSL:x86cpuid.asm 是一个空文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!