3

任何提示如何解决这个缺少库的问题?在这种情况下,我使用的是 Sunfreeware 软件包,而不是从源代码编译。

$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed

$ ldd /usr/local/ssl/bin/openssl
        libssl.so.1.0.0 =>       /usr/local/ssl/lib/libssl.so.1.0.0
        libcrypto.so.1.0.0 =>    /usr/local/ssl/lib/libcrypto.so.1.0.0
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libgcc_s.so.1 =>         (file not found)
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libm.so.2 =>     /lib/libm.so.2

- - 更多信息 - -

$ uname -a
SunOS sunws04 5.10 Generic_144489-04 i86pc i386 i86pc

$ pkginfo -l SMCossl
   PKGINST:  SMCossl
      NAME:  openssl
  CATEGORY:  application
      ARCH:  x86
   VERSION:  1.0.0d
   BASEDIR:  /usr/local
    VENDOR:  The OpenSSL Group
    PSTAMP:  Steve Christensen
  INSTDATE:  Jun 02 2011 12:20
     EMAIL:  steve@smc.vnet.net
    STATUS:  completely installed
     FILES:     1864 installed pathnames
                   1 shared pathnames
                  43 directories
                  32 executables
               28209 blocks used (approx)


$ echo $LD_LIBRARY_PATH

$ grep libgcc_s.so.1 /var/sadm/install/contents
/usr/local/lib/libgcc_s.so=libgcc_s.so.1 s none SMCgcc SMClgcc346
/usr/local/lib/libgcc_s.so.1 f none 0644 bin bin 158940 21764 1160370299 SMCgcc SMClgcc346

$ ldd -s /usr/local/ssl/bin/openssl
...
   find object=libgcc_s.so.1; required by openssl
    search path=/usr/local/ssl/lib  (RPATH from file openssl)
    trying path=/usr/local/ssl/lib/libgcc_s.so.1
    search path=/lib:/usr/lib  (default)
    trying path=/lib/libgcc_s.so.1
    trying path=/usr/lib/libgcc_s.so.1
        libgcc_s.so.1 =>         (file not found)
...
   find object=libgcc_s.so.1; required by /usr/local/ssl/lib/libssl.so.1.0.0
    search path=/usr/local/lib:/usr/local/ssl/lib  (RPATH from file /usr/local/ssl/lib/libssl.so.1.0.0)
    trying path=/usr/local/lib/libgcc_s.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1

---蹩脚的解决方法---

$ setrpath /usr/local/ssl/bin/openssl /usr/local/lib
Old RPATH: /usr/local/ssl/lib
New RPATH set to: /usr/local/lib

$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: libssl.so.1.0.0: open failed: No such file or directory
Killed

$ export LD_LIBRARY_PATH=/usr/local/ssl/lib
$ /usr/local/ssl/bin/openssl version
OpenSSL 1.0.0d 8 Feb 2011

--- 另一次尝试失败 ---

$ unset LD_LIBRARY_PATH
$ setrpath /usr/local/ssl/bin/openssl /usr/local/lib:/usr/local/ssl/lib
Old RPATH: /usr/local/lib
New RPATH would be longer than current RPATH.
(Use -f to use any extra space in string table)

$ setrpath -f /usr/local/ssl/bin/openssl /usr/local/lib:/usr/local/ssl/lib
Old RPATH: /usr/local/lib
New RPATH set to: /usr/local/lib:/usr/local/ssl/lib

$ /usr/local/ssl/bin/openssl version
ld.so.1: openssl: fatal: relocation error: file openssl: symbol /local/ssl/lib: referenced symbol not found
Killed
4

3 回答 3

3

或者

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/csw/lib:/usr/local/lib:/usr/sfw/lib
export LD_LIBRARY_PATH

在 /etc/profile

库路径的正确顺序对所有程序都起作用。

检查功能,如:

ldd /usr/local/ssl/bin/openssl
        libssl.so.1.0.0 =>       /usr/local/ssl/lib/libssl.so.1.0.0
        libcrypto.so.1.0.0 =>    /usr/local/ssl/lib/libcrypto.so.1.0.0
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libm.so.2 =>     /lib/libm.so.2
        /lib/libm/libm_hwcap1.so.2
        /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
于 2012-01-12T15:37:34.963 回答
2

或者您可以:

ln -s /usr/local/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1

为我工作:)

# /usr/local/ssl/bin/openssl version
OpenSSL 1.0.0d 8 Feb 2011
于 2011-06-13T04:03:56.000 回答
1

我对 sudo 有完全相同的问题。我试过了,但没有运气。我实际上已经准备好安装补丁来纠正这个问题。然后我发现我使用的是从 sunfreeware.com 下载的两个不同版本的 sudo 包。1.8.1p2 与 1.8.3p2。我删除了文件,转出了新文件,一切顺利。我知道这个答案听起来很愚蠢,但是我被困了大约一个星期左右没有答案,才发现这是我的错。

于 2012-07-31T20:44:07.263 回答