简体   繁体   English

为什么我不能用多个线程编译OpenSSL? (使-j3)

[英]Why can't I compile OpenSSL with multiple threads? (make -j3)

I'm trying to build OpenSSL. 我正在尝试构建OpenSSL。 If I build it with make (1 thread), it compiles okay. 如果我用make (1个线程)构建它,则可以编译。 But if I build it with 3 threads ( make -j3 ), I get LOTS of linker errors: 但是,如果我用3个线程( make -j3 )构建它, 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...

To be clear, the exact sequence of commands I ran is: 需要明确的是,我运行的命令的确切顺序是:

$ 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

I'm on Ubuntu 14.10 on an x64 machine. 我在x64机器上的Ubuntu 14.10上。

This might be an RTFM-type question, but I haven't been able to see anywhere that says building OpenSSL with multiple threads is not supported. 这可能是一个RTFM类型的问题,但是我看不到任何地方都说不支持使用多个线程构建OpenSSL。

So the question: Is building OpenSSL with multiple threads supported? 那么问题来了: 是否支持使用多个线程构建OpenSSL? If so, what am I doing wrong? 如果是这样,我在做什么错?

As MadScientist's comment indicates a makefile has to be designed to support parallel builds. 正如MadScientist的评论表明,makefile必须设计为支持并行构建。 Apparently OpenSSL is supposed to support parallel make but one of their bug reports shows that this support has on a few occasions been broken. 显然,OpenSSL应该支持并行制作,但是他们的错误报告之一表明,这种支持在某些情况下已被取消。 This bug was most recently marked as fixed on December 12th, 2014, so it's possible that using a newer version of OpenSSL will fix the problem you've encountered. 此错误最近被标记为已在2014年12月12日修复,因此使用较新版本的OpenSSL可能会解决您遇到的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM