构建 OpenSSL VC++ 静态 64 位库 [英] Building OpenSSL VC++ Static 64bit Libs

查看:37
本文介绍了构建 OpenSSL VC++ 静态 64 位库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 VC++ 2010 构建 OpenSSL 1.0.1e 静态 64 位库.(我像这样成功构建的最后一个是 1.0.1c,如果这可能是一个因素.目前我也能够成功构建 1.0.1e 的 32 位风格,没有任何问题.)

我相信,我正在使用 ActiveState Perl、nasm 和所有正确的工具来进行此构建.INSTALL.W64 文件只有构建 DLL 的说明,不幸的是我不能使用.

我正在调用正确的%VS100COMNTOOLS%....vcinx86_amd64vcvarsx86_amd64.bat"来设置环境,并且我确保 ActivePerl 位于我路径的开头.

在尝试构建之前,我将删除所有旧的 inc*(当然include"除外)、tmp* 和 out* 文件夹.我像过去一样调用perl Configure no-shared VC-WIN64A";不过,我注意到 no-shared 似乎是此版本中的默认设置.我正在编辑 msdo_win64a.bat 并将 no-asm 更改为 nasm,就像我在以前的版本中一样.

然后我运行 msdo_win64a.bat,并编辑生成的 ms t.mak 文件以将32"更改为64",以防止我的 64 位构建破坏我的 32 位构建.我还将/MD 更改为/MT(正如我过去一直所做的那样),同样是为了满足我的特定构建环境要求.

然后我运行 ms t.mak.这似乎构建了所有源代码,只有一些警告消息,但是当 makefile 尝试编译 libeay32.lib 时,我得到一个函数 BN_GF2m_mod_mul_arr 中引用的未解析的外部符号 bn_GF2m_mul_2x2".(这是在cryptonn_gf2m.c源代码中.)

所以我知道这是因为 OPENSSL_BN_ASM_GF2m 是在 nt.mak 的 CFLAG 中定义的,如果我对 Perl 编程有更好的了解,我可能可以找到我没有看到的配置选项,但现在我只能'想办法.

同样,按照非常相似的构建说明,32 位似乎可以正常工作.我想知道尊敬的 Eric Young 和 Tim Hudson 是否可能没有时间测试这个特定的构建配置,或者我是否忽略了一些完全愚蠢的东西.

非常感谢任何能够帮助调试此问题的人!

解决方案

好的,所以这个问题的答案似乎是两者兼而有之.是的,对于 64 位版本的 OpenSSL 1.0.1e 的汇编器版本似乎还有一些工作要做.而且,是的,暂时有一个应该很明显的解决方法.

使用我在上面的 perl 配置步骤中使用 no-shared 的 no-asm 指令.

当然,这告诉 OpenSSL 我们不是在构建汇编程序库,因此它将在 C 代码中编译.问题解决了!

感谢 Eric 和 Tim,感谢你们免费提供给我们其他人的这个非常有价值的软件库!

I am attempting to build OpenSSL 1.0.1e static 64-bit libs with VC++ 2010. (The last one that I successfully built like this was 1.0.1c, if that might be a factor. And currently I am also able to successfully build the 32-bit flavor of 1.0.1e with no problems.)

I am using ActiveState Perl, nasm, and all the correct tools to do this build, I believe. The INSTALL.W64 file only has instructions for building the DLL, which unfortunately I cannot use.

I am calling the proper "%VS100COMNTOOLS%....vcinx86_amd64vcvarsx86_amd64.bat" to set up the environment, and I am making sure that ActivePerl is on the beginning of my path.

I am deleting all the old inc* (except "include" of course), tmp* and out* folders before trying to build. I call "perl Configure no-shared VC-WIN64A" as I did in the past; although, I notice that no-shared seems to be the default in this version. I am editing the msdo_win64a.bat and changing no-asm to nasm, as I have in previous versions.

Then I run msdo_win64a.bat, and edit the resulting ms t.mak files to change "32" to "64" in part to keep my 64-bit builds from clobbering my 32-bit builds. I also change /MD to /MT (as I have always done in the past), again, for my specific build environment requirements.

Then I run ms t.mak. This seems to build all the sources with only a few warning messages, but when the makefile tries to compile libeay32.lib, I get an " unresolved external symbol bn_GF2m_mul_2x2 referenced in function BN_GF2m_mod_mul_arr." (This is in cryptonn_gf2m.c source code.)

So I know this is because OPENSSL_BN_ASM_GF2m is defined in my CFLAG in nt.mak, and if I understood Perl programming a little better, I could probably track down which configuration option I am not seeing, but right now I just can't figure it out.

Again, 32-bit seems to work just fine following very similar build instructions. I wonder if possibly the venerable Eric Young and Tim Hudson have not had time to test this particular build configuration, or if it is something completely silly that I am overlooking.

Thanks so much to anyone who might be able to help debug this issue!

解决方案

OK, so the answer to this question appears to be a little of both. Yes, there does appear to be some more work to do with the assembler version of the 64-bit version of OpenSSL 1.0.1e. And, yes, there is a work-around for the time being that should have been obvious.

Using the no-asm instruction where I was using no-shared in the perl Configuration step above.

This, of course, tells OpenSSL that we are not building assembler libs, so it will compile in the C code instead. Problem solved!

Thanks, Eric and Tim, for this very valuable software library that you provide to the rest of us for free!

这篇关于构建 OpenSSL VC++ 静态 64 位库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆