/usr/local/ssl/lib/libcrypto.a:无法读取符号:错误值



所以今晚对这个问题做了一些详尽的研究之后,我仍然感到困惑。我正在运行 Debian Wheezy 并且我试图让 curl 支持 ssl,它只是明确拒绝这样做。我试图删除OpenSSL和Curl的所有痕迹。然后使用 apt-get install OpenSSL,它会安装 "OpenSSL 1.0.1e"。然后我去尝试从源代码编译 curl,认为也许 apt-get 只是安装 curl 很愚蠢。我尝试使用它进行配置。

./configure --with-ssl LDFLAGS="-ldl"

因为它会在其他方面传递一些错误。如果没有 LDFLAGS,我会在我的日志中得到这个。配置.log但正如我所说,打开 LDFLAGS 后,我能够实际创建配置,但是当我去制作时。井。。那时,一切似乎都松动了,她不会安装。

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libcurl.la] Error 1
make[2]: Leaving directory `/home/openssl/curl-7.27.0/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/openssl/curl-7.27.0/lib'
make: *** [all-recursive] Error 1

经过一些研究,有些人建议使用-fPIC构建OpenSSL。所以我从系统中清除了OpenSSL并尝试从源代码安装,选择安装版本,1.0.2从此链接 https://www.openssl.org/source/openssl-1.0.2.tar.gz

这实际上进行得很顺利,我确保包含 -fPIC 标志。然后我再次去安装 Curl,但最终仍然收到此错误。这很奇怪..所以现在我坐在这里挠头。我已经卸载,重新安装,重新编译和安装并完成了我能想到的所有事情,但我仍然非常难倒。

对不起,如果我今晚的格式很糟糕,对我来说已经很晚了。但如果有人能帮我一把,将不胜感激。

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value

使用 -fPIC 重建 OpenSSL 的本地副本。本地副本是位于 /usr/local/ssl/lib/ 的副本。

我也在 Fedora 上看到了这个问题。有时你可以用 export CFLAGS=-fPIC .其他时候,您必须修改Makefile.org以便它存在。

./config shared CFLAGS=-fPIC重新编译你的openssl

最新更新