Compiling problem on Solaris - Mailing list pgsql-bugs

From SAKAI Kiyotaka
Subject Compiling problem on Solaris
Date
Msg-id 20061214.153135.46613455.ksakai@isr.co.jp
Whole thread Raw
Responses Re: Compiling problem on Solaris  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Re: Compiling problem on Solaris  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I compiled PostgreSQL-8.2.0 on Solaris 8, but I cannot execute
binaries because it cannot find linked shared libraries, like
libgcc_s.so.

    % cd src/interfaces/libp
    % rm libpq.so*
    % make
    gcc -shared -h libpq.so.5  fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o fe-protocol2.o
fe-protocol3.opqexpbuffer.o pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o
inet_aton.ostrlcpy.o getaddrinfo.o  -L../../../src/port -lsocket -lnsl -Wl,-R'/usr/local/pgsql/lib' -o libpq.so.5.0 
    rm -f libpq.so.5
    ln -s libpq.so.5.0 libpq.so.5
    rm -f libpq.so
    ln -s libpq.so.5.0 libpq.so
    % ldd libpq.so
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libgcc_s.so.1 =>         (file not found)
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1


I think the following patch is needed, so that LD_RUN_PATH is also
passed to -R option.

*** src/makefiles/Makefile.solaris.old    Sat Dec 10 06:19:36 2005
--- src/makefiles/Makefile.solaris    Thu Dec  7 14:03:43 2006
***************
*** 4,12 ****

  ifeq ($(with_gnu_ld), yes)
  export_dynamic = -Wl,-E
! rpath = -Wl,-rpath,'$(rpathdir)'
  else
! rpath = -Wl,-R'$(rpathdir)'
  endif

  DLSUFFIX = .so
--- 4,12 ----

  ifeq ($(with_gnu_ld), yes)
  export_dynamic = -Wl,-E
! rpath = -Wl,-rpath,'$(rpathdir):$(LD_RUN_PATH)'
  else
! rpath = -Wl,-R'$(rpathdir):$(LD_RUN_PATH)'
  endif

  DLSUFFIX = .so

pgsql-bugs by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: the bug report form doesn't accepts the email address
Next
From: Andrew MacLeod
Date:
Subject: Re: BUG #2645: pg_restore crashes