c - 为什么我不能用多线程编译 OpenSSL? (制作-j3)

标签 c linux openssl makefile

我正在尝试构建 OpenSSL。如果我使用 make(1 个线程)构建它,它可以编译。但是如果我用 3 个线程构建它 (make -j3),我会得到很多链接器错误:

bntest.o: In function `message':
bntest.c:(.text+0x30): undefined reference to `BIO_puts'
bntest.c:(.text+0x3b): undefined reference to `BIO_puts'
bntest.o: In function `test_add':
bntest.c:(.text+0xe2): undefined reference to `BN_init'
bntest.c:(.text+0xec): undefined reference to `BN_init'
bntest.c:(.text+0xf6): undefined reference to `BN_init'
bntest.c:(.text+0x107): undefined reference to `BN_bntest_rand'
bntest.c:(.text+0x119): undefined reference to `BN_print'
bntest.c:(.text+0x126): undefined reference to `BIO_puts'
bntest.c:(.text+0x156): undefined reference to `BN_add'
bntest.c:(.text+0x166): undefined reference to `BN_add'
bntest.c:(.text+0x191): undefined reference to `BN_bntest_rand'
bntest.c:(.text+0x1d3): undefined reference to `BN_add'
bntest.c:(.text+0x1f5): undefined reference to `BN_print'
bntest.c:(.text+0x202): undefined reference to `BIO_puts'
bntest.c:(.text+0x20f): undefined reference to `BN_print'
bntest.c:(.text+0x21c): undefined reference to `BIO_puts'
bntest.c:(.text+0x264): undefined reference to `BN_free'
bntest.c:(.text+0x26e): undefined reference to `BN_free'
bntest.c:(.text+0x278): undefined reference to `BN_free'
bntest.o: In function `test_sub':
bntest.c:(.text+0x2af): undefined reference to `BN_init'
bntest.c:(.text+0x2b9): undefined reference to `BN_init'
bntest.c:(.text+0x2c3): undefined reference to `BN_init'
bntest.c:(.text+0x2e0): undefined reference to `BN_bntest_rand'
bntest.c:(.text+0x322): undefined reference to `BN_sub'
...and so on, for hundreds of lines...

明确地说,我运行的命令的确切顺序是:

$ wget https://www.openssl.org/source/openssl-1.0.1l.tar.gz
$ tar -xzf openssl-1.0.1l.tar.gz
$ cd openssl-1.0.1l
$ ./config
$ make -j3

我在 x64 机器上使用 Ubuntu 14.10。

这可能是一个 RTFM 类型的问题,但我没能看到任何地方说不支持使用多线程构建 OpenSSL。

所以问题是:是否支持使用多线程构建 OpenSSL?如果是这样,我做错了什么?

最佳答案

正如 MadScientist 的评论所指出的,makefile 必须设计为支持并行构建。显然 OpenSSL 应该支持并行 make 但他们的一个 bug reports表明这种支持有几次被打破。此错误最近一次标记为已修复是在 2014 年 12 月 12 日,因此使用较新版本的 OpenSSL 可能会解决您遇到的问题。

关于c - 为什么我不能用多线程编译 OpenSSL? (制作-j3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28639207/

相关文章:

linux - 需要脚本帮助

c++ - SSL_CTX_new仅在具有分发版本的32位iOS设备中崩溃

openssl - 创建 .p12 文件

php - 为什么用 PHP 加密的东西与用 Ruby 加密的相同字符串不匹配?

c - 相同数的最长序列&最长序列有多少个(无数组)

CUDA 内核函数比等效的主机函数花费更长的时间

类型转换,C编程

c - C89 关于两个负数 : round up, 向下舍入或未定义的整数除法的行为是什么?

java - 在Linux上使用rt.exec(mysql加载数据)执行命令

检查 C 项目中未使用的变量