Sunfreeware openssl has duplicate references to libgcc_s.so.1

John Buehrer picture John Buehrer · Jun 2, 2011 · Viewed 17.6k times · Source

Any tips how to solve this missing library problem? In this case I'm using Sunfreeware packages, instead of compiling from source.

$ /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

--- more info ---

$ 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:  [email protected]
    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

--- grungy workaround ---

$ 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

--- another attempt fails ---

$ 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

Answer

gerhardl picture gerhardl · Jan 12, 2012

or

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

in /etc/profile

the correct order of the library-Paths playes a role for all programms.

Check the functionality like:

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