[openssl-users] openssl 1.0.2g build linking to wrong libs -- 'system' instead of 'own'. How to correct?

PGNet Dev pgnet.dev at gmail.com
Thu Mar 10 17:23:05 UTC 2016

I'm building 1.0.2g on linux64.

I'm trying to get a self-consistent build, linked to the right libs.


	cd ./openssl-1.0.2g
	./config \
	 --openssldir=/home/dev/ssl --libdir=lib64 \
	 threads shared zlib -D_GNU_SOURCE -DPURIFY -DTERMIO \
	 -Wa,--noexecstack -Wl,-z,relro,-z,now -Wall -fno-common

	make depend
	make install

Then checking

	ldd /home/dev/ssl/lib64/*.so* | egrep "ssl|crypto"
		        libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 
		        libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 

Why are these libs linked to SYSTEM libs, not the just-built libs, in 
the specified $openssldir/$libdir ?

It can be fixed after the fact,

	patchelf --set-rpath "/home/dev/ssl/lib64" --force-rpath 
	ldd /home/dev/ssl/lib64/libssl.so | egrep "ssl|crypto"
		libcrypto.so.1.0.0 => /home/dev/ssl/lib64/libcrypto.so.1.0.0 

but that shouldn't be required.

What's the correct config+build procedure for ending up with 
self-consistent linking?

More information about the openssl-users mailing list