Undefined links when building OpenSSL

I need to create my own OpenSSL binary, because the package that comes with Fedora-18 does not have cryptography with an elliptic curve. I execute the following commands:

./config --prefix=/home/USERNAME/bin/ssl --openssldir=/home/USERNAME/bin/ssl/openssl -fPIC zlib no-idea no-mdc2 no-rc5 make depend make 

But I have error links:

 ../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 
+4
source share
2 answers

I had the same problem compiling OpenSSL 1.0.1e on SLES 11 Linux. On another website, I found a hint to give out "make clean" before calling make.

In my case, the first unsuccessful attempt was:

Logged in as a regular user (not root):

 . ./config make 

This failed with the same errors that you mentioned in your question.

Successful attempt:

 su make clean ./config zlib make make install 
+8
source
 ./config --prefix=/home/USERNAME/bin/ssl --openssldir=/home/USERNAME/bin/ssl/openssl -fPIC zlib no-idea no-mdc2 no-rc5 make depend make 

For -fPIC you use shared .

There is no need for --prefix , because it will use --openssldir . Thus, the configuration call will look like:

 ./config shared zlib no-idea no-mdc2 no-rc5 no-ssl2 no-ssl3 \ enable-ec_nistp_64_gcc_128 --openssldir=/home/USERNAME/bin/ssl/openssl 

Some notes on the line:

  • enable-ec_nistp_64_gcc_128 is an acceleration for 64-bit platforms where GCC offers a 128-bit integer.
  • Usually you want no-comp because compression can leak information
  • Since information about compression leaks, you usually don't want zlib
  • no-ssl2 completely removes SSLv2 because its insecure
  • no-ssl3 completely removes SSLv3 because its insecure

--openssldir=/home/USERNAME/bin/ssl/openssl means:

  • binaries will be located in /home/USERNAME/bin/ssl/openssl/bin
  • libraries will be located in /home/USERNAME/bin/ssl/openssl/lib
  • will be in /home/USERNAME/bin/ssl/openssl/include

Then you just need to run the following. No need to make depend .

 $ make $ sudo make install 

If you need to clear an existing configuration and then change the configuration, follow these steps:

 make clean && make dclean 

make dclean is the key to make dclean .


Also see Compiling and Installing on the OpenSSL Wiki.

+3
source

Source: https://habr.com/ru/post/1480154/


All Articles