dbTalk Databases Forums  

[BUGS] Compiling problem on Solaris

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Compiling problem on Solaris in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SAKAI Kiyotaka
 
Posts: n/a

Default [BUGS] Compiling problem on Solaris - 12-14-2006 , 09:32 AM






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.o pqexpbuffer.o pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o inet_aton.o strlcpy.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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

Reply With Quote
  #2  
Old   
Zdenek Kotala
 
Posts: n/a

Default Re: [BUGS] Compiling problem on Solaris - 12-14-2006 , 11:04 AM






SAKAI Kiyotaka wrote:
Quote:
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.o pqexpbuffer.o pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o inet_aton.o strlcpy.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

Gcc compiler is not part of Solaris 8. You can use LD_LIBRARY_PATH in
runtime or LDFLAGS for ./configure setup. I guess, that your suggested
patch could be generate unexpected result for other people.

By the way, sun studio compiler is significantly better on SPARC cpu
than gcc. You can download it from sun webpage. Also if you can upgrade
OS than Solaris 10 is faster and you can use DTrace probes in postgres.

Zdenek

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Compiling problem on Solaris - 12-14-2006 , 09:21 PM



SAKAI Kiyotaka <ksakai (AT) isr (DOT) co.jp> writes:
Quote:
I think the following patch is needed, so that LD_RUN_PATH is also
passed to -R option.
Hmm ... this puts the build-time LD_RUN_PATH into the executables, which
doesn't seem very appropriate --- rpathdir is the correct thing IMHO.
Also, what happens if LD_RUN_PATH isn't set at all ... don't you end up
with incorrect syntax for the rpath option?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.