TonyI
TonyI

Reputation: 155

Failed build openssl 1.0.2p on SLES 12-SP2 x86_64

Tried to build openssl 1.0.2p on SLES 12-SP2 x86_64 and it failed I ran the following commands as standard user:

cd /usr/src/openssl-1.0.2p
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make

Excerpt from the console

make[4]: Entering directory '/usr/src/openssl-1.0.2p'
...
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: libcrypto.a(gost_sign.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile.shared:169: recipe for target 'link_a.gnu' failed
make[4]: *** [link_a.gnu] Error 1
make[4]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:357: recipe for target 'do_linux-shared' failed
make[3]: *** [do_linux-shared] Error 2
make[3]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:310: recipe for target 'libcrypto.so.1.0.0' failed
make[2]: *** [libcrypto.so.1.0.0] Error 2
make[2]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:109: recipe for target 'shared' failed
make[1]: *** [shared] Error 2
make[1]: Leaving directory '/usr/src/openssl-1.0.2p/crypto'
Makefile:287: recipe for target 'build_crypto' failed
make: *** [build_crypto] Error 1
tony@linux-31cz:/usr/src/openssl-1.0.2p> 

Upvotes: 4

Views: 2610

Answers (1)

jww
jww

Reputation: 102205

./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib

Followed by...

/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
libcrypto.a(gost_sign.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object;
recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
final link failed: Nonrepresentable section on output

It sounds like you built earlier but omitted shared. Then you reconfigured and added shared.

You should perform a make distclean and then start over. Perform a distclean, and then run ./config ..., make depends, make and then make install.

OpenSSL 1.0.2 requires the make depends, so be sure you include the step.

Also see Compilation and Installation on the OpenSSL wiki.

Upvotes: 3

Related Questions