构建OpenSSL时未定义的引用

Max*_*xim 4 openssl fedora

我需要构建自己的OpenSSL二进制文件,因为Fedora-18提供的软件包没有椭圆曲线加密.我执行这些命令:

./config --prefix=/home/USERNAME/bin/ssl --openssldir=/home/USERNAME/bin/ssl/openssl -fPIC zlib no-idea no-mdc2 no-rc5
make depend
make
Run Code Online (Sandbox Code Playgroud)

但我有链接错误:

../libcrypto.a(x86_64cpuid.o): In function `OPENSSL_cleanse':
(.text+0x1a0): multiple definition of `OPENSSL_cleanse'
../libcrypto.a(mem_clr.o):mem_clr.c:(.text+0x0): first defined here
../libcrypto.a(cmll-x86_64.o): In function `Camellia_cbc_encrypt':
(.text+0x1f00): multiple definition of `Camellia_cbc_encrypt'
../libcrypto.a(cmll_cbc.o):cmll_cbc.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `AES_encrypt':
(.text+0x460): multiple definition of `AES_encrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x62a): first defined here
../libcrypto.a(aes-x86_64.o): In function `AES_decrypt':
(.text+0x9f0): multiple definition of `AES_decrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0xad0): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_encrypt_key':
(.text+0xab0): multiple definition of `private_AES_set_encrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_decrypt_key':
(.text+0xd80): multiple definition of `private_AES_set_decrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x403): first defined here
../libcrypto.a(aes-x86_64.o): In function `AES_cbc_encrypt':
(.text+0xfa0): multiple definition of `AES_cbc_encrypt'
../libcrypto.a(aes_cbc.o):aes_cbc.c:(.text+0x0): first defined here
Run Code Online (Sandbox Code Playgroud)

小智 8

我在SLES 11 Linux上编译OpenSSL 1.0.1e时遇到了同样的问题.在另一个网站上,我发现提示在调用make之前发出"make clean".

在我的情况下,第一次尝试是不成功的:

以普通用户(非root用户)身份登录:

. ./config
make
Run Code Online (Sandbox Code Playgroud)

这与您在问题中提到的相同错误失败了.

成功的尝试是:

su
make clean
./config zlib
make
make install
Run Code Online (Sandbox Code Playgroud)