首页 > 解决方案 > OpenSSL 测试在使用 /MT 编译器选项使用静态版本的运行时库构建的 Windows 上失败

问题描述

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

我遵循 https://stackoverflow.com/a/50365514/220425的说明,基本上:

构建成功,但是许多测试失败。这是日志中的一个片段:

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

解决方案


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

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


推荐阅读