openssl ./config共享错误(libcrypto.a)

/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' 

我试图编译openssl时出现这个错误。

我努力了

 export CFLAGS=-fPIC 

但是解决这个错误还是没有运气。 请指教。

我也面临同样的问题。 所以我用下面的方法解决了它:
首先卸载该文件并下载新版本,如openssl-1.0.2-latest.tar.gz

  1. 使用命令tar -xf openssl-1.0.2-latest.tar.gz解压缩此文件
  2. export CFLAGS=-fPIC
  3. ./config shared --prefix=/your/path
  4. make
  5. make install

我得到这个错误后,第一次做./config没有shared ,然后知道我需要共享库,并运行

 ./config shared ... make 

这个问题消失了, make clean ,然后从头开始

 ./config shared ... make make test make install