与openssl链接器和编译器错误

问题描述:

我想从github发布https://github.com/openssl/openssl/archive/OpenSSL-fips-2_0_13.tar.gz建立openssl并尝试手动编译它。我试图编译这个在Mac OSX版本10.11.5,这是我采取与openssl链接器和编译器错误

./Configure darwin64-x86_64-cc 
make 

一系列的步骤,但是当我编译通常根据我得到这个错误

bsaes-x86_64.s:580:1: error: invalid symbol redefinition 
_bsaes_enc_key_convert: 

INSTALL文件,我在链接步骤中出现en错误,大概是因为存档文件是为32位系统构建的。这是警告从./config && make步存档链接时运行./config

WARNING! If you wish to build 64-bit library, then you have to 
     invoke './Configure darwin64-x86_64-cc' *manually*. 
     You have about 5 seconds to press Ctrl-C to abort. 

,然后得到相应的错误,当我得到的是这种

ld: warning: ld: warning: ignoring file openssl/lib/libssl.a, file was 
built for archive which is not the architecture being linked (x86_64): 
openssl/lib/libssl.aignoring file openssl/lib/libcrypto.a, file was built 
for archive which is not the architecture being linked (x86_64): 
openssl/lib/libcrypto.a 

我建立这一个C++项目使用C编译器编译C代码并使用C++编译器(或者因为两个编译器使用相同的链接器,所以使用ld?)来链接代码(不知道这是否有所作用)

有人能告诉我如何正确构建和链接openssl吗?

+0

您***不能用C++编译器构建OpenSSL库。您必须使用C编译器。稍后,您可以使用C++编译器编译用户程序。您也可以执行'KERNEL_BITS = 64 ./config shared no-ssl2 no-ssl3 enable-ec_nistp_64_gcc_128 ...'。一个相关的问题是Stack Overflow上的[在OS X上构建多元OpenSSL](http://*.com/q/25530429)。另请参阅OpenSSL wiki上的[编译和安装](https://wiki.openssl.org/index.php/Compilation_and_Installation)。 – jww

+0

@jww我在说我使用的是C++编译器时错了,我正在使用C编译器编译代码,然后使用C++编译器进行链接。我将更正问题 – Curious

尝试在./configure使用no-asm选项:

$ make clean 
$ ./Configure darwin64-x86_64-cc no-asm 
$ make test 
$ make 
.... 

椭圆曲线程序似乎在这个版本中被打破,所以也许提交有关的bug报告,否则它应该编译/构建没有问题。

+0

谢谢。我向openssl报告:https://github.com/openssl/openssl/issues/4860 – gary