【问题标题】:Failed build openssl 1.0.2p on SLES 12-SP2 x86_64在 SLES 12-SP2 x86_64 上构建 openssl 1.0.2p 失败
【发布时间】:2019-03-01 00:01:15
【问题描述】:

尝试在 SLES 12-SP2 x86_64 上构建 openssl 1.0.2p 但失败了 我以标准用户身份运行了以下命令:

cd /usr/src/openssl-1.0.2p
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make

控制台摘录

make[4]: Entering directory '/usr/src/openssl-1.0.2p'
...
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: libcrypto.a(gost_sign.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile.shared:169: recipe for target 'link_a.gnu' failed
make[4]: *** [link_a.gnu] Error 1
make[4]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:357: recipe for target 'do_linux-shared' failed
make[3]: *** [do_linux-shared] Error 2
make[3]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:310: recipe for target 'libcrypto.so.1.0.0' failed
make[2]: *** [libcrypto.so.1.0.0] Error 2
make[2]: Leaving directory '/usr/src/openssl-1.0.2p'
Makefile:109: recipe for target 'shared' failed
make[1]: *** [shared] Error 2
make[1]: Leaving directory '/usr/src/openssl-1.0.2p/crypto'
Makefile:287: recipe for target 'build_crypto' failed
make: *** [build_crypto] Error 1
tony@linux-31cz:/usr/src/openssl-1.0.2p> 

【问题讨论】:

    标签: linux openssl sles


    【解决方案1】:
    ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
    

    接着……

    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
    libcrypto.a(gost_sign.o): relocation R_X86_64_32 against
    `.rodata.str1.1' can not be used when making a shared object;
    recompile with -fPIC
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
    final link failed: Nonrepresentable section on output
    

    听起来您之前构建了但省略了shared。然后你重新配置并添加了shared

    您应该执行make distclean,然后重新开始。执行distclean,然后运行./config ...make dependsmake,然后运行make install

    OpenSSL 1.0.2 需要 make depends,因此请确保包含该步骤。

    另请参阅 OpenSSL wiki 上的 Compilation and Installation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      • 2017-11-13
      • 2017-09-25
      • 2013-03-04
      • 1970-01-01
      • 2023-03-08
      • 2016-05-13
      相关资源
      最近更新 更多