在使用/ MT编译器选项,使用静态版本的运行时库构建的Windows上,OpenSSL测试失败

时间:2020-04-02 12:29:04

标签: openssl

我正在尝试使用以下工具为Windows构建OpenSSL 1.1.1f:

  • 最新的Visual Studio 2019(v16.4.6)
  • Strawberry Perl(为MSWin32-x86-multi-thread-64int构建的perl 5,版本28,版本1(v5.28.1))
  • Windows 10 64位

我基本上是按照 https://stackoverflow.com/a/50365514/220425中的说明进行操作的:

  • 从官方网站下载OpenSSL 1.1.1f
  • perl Configure VC-WIN32 no-asm --prefix=C:\some_dir\ --libdir=lib --openssldir=conf
  • openssl-1.1.1e\makefile中,我将/MD更改为/MT
  • x86 Native Tools Command Prompt for VS 2019中:
    • nmake
    • nmake测试

构建成功,但是许多测试失败。这是日志的一部分:

test\recipes\01-test_abort.t .................... ok
test\recipes\01-test_sanity.t ................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\01-test_symbol_presence.t .......... ok
test\recipes\01-test_test.t ..................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\02-test_errstr.t ................... skipped: This is unsupported on MSYS/MinGW or MSWin32
test\recipes\02-test_internal_ctype.t ........... ok
test\recipes\02-test_lhash.t .................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\02-test_ordinals.t ................. ok
test\recipes\02-test_stack.t .................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\03-test_exdata.t ................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\03-test_internal_asn1.t ............ ok
test\recipes\03-test_internal_chacha.t .......... ok
test\recipes\03-test_internal_curve448.t ........ ok
test\recipes\03-test_internal_ec.t .............. ok
test\recipes\03-test_internal_mdc2.t ............ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

如果我使用nmake test V=1以详细模式运行测试,则会显示更多详细信息:

Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
test\recipes\04-test_bio_callback.t .............
1..1
OPENSSL_Uplink(798E0330,08): no OPENSSL_Applink
..\bio_callback_test.exe => 1
not ok 1 - running bio_callback_test

测试为什么失败,以及如何解决?我需要使用/MT

构建OpenSSL。

注释:

  • 如果我没有将/MD更改为/MT,那么一切都会按预期进行,并且所有测试都通过了
  • 构建早期版本的OpenSSL是可行的,例如1.0.1,但是从1.1.x开始它们会失败

1 个答案:

答案 0 :(得分:0)

获取/ MT的标准方法是配置“不共享”,即不 产生DLL。

https://www.mail-archive.com/openssl-users@openssl.org/msg88356.html