Openssl ./config shared error (libcrypto.a)

openssl

/usr/bin/ld: libcrypto.a(x86_64-gcc.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
libcrypto.a(x86_64-gcc.o): could not read symbols: Bad value'

I got this error while trying to compile and make openssl.

I have tried

export CFLAGS=-fPIC

But still no luck in solving the error. Please advise.

Best Answer

I also face same problem. so I solved it the following way:
First uninstall that file and download new version like openssl-1.0.2-latest.tar.gz

  1. untar this file using command tar -xf openssl-1.0.2-latest.tar.gz
  2. export CFLAGS=-fPIC
  3. ./config shared --prefix=/your/path
  4. make
  5. make install