【问题标题】:/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value/usr/local/ssl/lib/libcrypto.a:无法读取符号:错误值
【发布时间】:2015-03-29 20:02:18
【问题描述】:

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

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

因为否则它会传递一些错误。如果没有 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

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

这实际上进行得很好,我确保包含 -fPIC 标志。然后我又去安装Curl,但最终还是出现了这个错误..这很奇怪..所以现在我坐在这里摸不着头脑。我已经卸载、重新安装、重新编译和安装,做了所有我能想到的事情,但我仍然非常难过。

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

【问题讨论】:

    标签: linux ssl curl openssl debian


    【解决方案1】:
    /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 使其存在。

    【讨论】:

    • 最终成为大量错误的软件包安装和系统中缺少的软件包。我忘了用这个更新我的 OP。我最初是从两个初级系统管理员那里得到这个系统的。只是学习这些东西,不幸的是不知道他们在做什么。他们在那里为最先进的 Debian 版本和 mint 提供了存储库。当我修复东西时,显然它卸载了一些它需要的包。一旦我重新安装了 openssh 服务器,我就明白了。比较有趣的小经历。最终我只是重做了整个盒子,这样更容易。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2016-08-11
      • 2020-11-29
      • 1970-01-01
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-05
      • 2014-10-01
      相关资源
      最近更新 更多