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

The*_*man 4 linux ssl debian curl openssl

所以在今晚对这个问题做了一些详尽的研究之后,我仍然被难住了。我正在运行 Debian Wheezy,我正在尝试让 curl 支持 ssl,但它显然拒绝这样做。我试图删除 OpenSSL 和 Curl 的所有痕迹。然后使用 apt-get install OpenSSL,它会安装“OpenSSL 1.0.1e”。然后我去尝试从源代码编译 curl,认为 apt-get 安装 curl 可能只是愚蠢的。我尝试使用它进行配置。

./configure --with-ssl LDFLAGS="-ldl"
Run Code Online (Sandbox Code Playgroud)

因为它会以其他方式传递一些错误。如果没有 LDFLAGS,我会在我的日志中得到它。config.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
Run Code Online (Sandbox Code Playgroud)

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

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

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

jww*_*jww 6

/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
Run Code Online (Sandbox Code Playgroud)

使用-fPIC. 本地副本是位于/usr/local/ssl/lib/.

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