Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2E2409F9FDD for ; Sat, 3 Nov 2007 01:35:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 87659-08 for ; Sat, 3 Nov 2007 01:35:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from services110.cs.uwaterloo.ca (services110.cs.uwaterloo.ca [129.97.152.166]) by postgresql.org (Postfix) with ESMTP id F18BF9F9FDA for ; Sat, 3 Nov 2007 01:35:26 -0300 (ADT) Received: from [192.168.0.4] (CPE00055d2d0a37-CM001692fa7092.cpe.net.cable.rogers.com [99.236.38.163]) (authenticated bits=0) by services110.cs.uwaterloo.ca (8.13.8/8.13.8) with ESMTP id lA34ZIm3020741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 3 Nov 2007 00:35:25 -0400 (EDT) Message-ID: <472BFA84.4070707@cs.uwaterloo.ca> Date: Sat, 03 Nov 2007 00:35:16 -0400 From: Jason Testart User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: RPATH issue with libpq on Solaris 8 (gcc) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at mailchk-w03 with ID 472BFA86.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on localhost X-Virus-Status: Clean X-UUID: 9124044e-cb3c-4d62-b43d-a07016597480 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/35 X-Sequence-Number: 27278 I'm interested in some guidance on how to best deal with the following issue. I'm building postgres-8.2.5 on Solaris 8 SPARC, using a gcc built (not by me) for our environment. We have an old home-grown software distribution/configuration management system that arranges shared-objects and binaries are in non-standard places. So to find them, I use -L and -R in $(CFLAGS) and $(LFLAGS) to make sure dependencies (like krb5/ssl libraries) are found. The problem is, the Makefile.shlib doesn't arrange to have the $(CFLAGS) passed to gcc, since maybe it assumes gcc on Solaris SPARC doesn't need it? So, while psql can find the shared objects, libpq can't, because libpq doesn't have the rpath I gave it! An example: % env | grep FLAGS LDFLAGS=-R/software/readline-5.2/lib:/software/gcc-3.4.5/lib:/software/openssl-0.9.8_runtime/lib:/software/krb5-1.6/lib CFLAGS=-R/software/readline-5.2/lib:/software/gcc-3.4.5/lib:/software/openssl-0.9.8_runtime/lib:/software/krb5-1.6/lib Then I configure && make && make install, only to find: % ldd -s libpq.so | head find object=libssl.so.0.9.8; required by ./libpq.so search path=/software/gcc-3.4.5_runtime/lib:/software/postgresql-8.2/lib (RPATH from file ./libpq.so) trying path=/software/gcc-3.4.5_runtime/lib/libssl.so.0.9.8 trying path=/software/postgresql-8.2/lib/libssl.so.0.9.8 search path=/usr/lib (default) trying path=/usr/lib/libssl.so.0.9.8 libssl.so.0.9.8 => (file not found) yet from 'ldd -s psql': find object=libssl.so.0.9.8; required by psql search path=/software/readline-5.2/lib:/software/gcc-3.4.5_runtime/lib:/software/openssl-0.9.8_runtime/lib:/software/krb5-1.6/lib:/softwar e/postgresql-8.2/lib (RPATH from file psql) trying path=/software/readline-5.2/lib/libssl.so.0.9.8 trying path=/software/gcc-3.4.5_runtime/lib/libssl.so.0.9.8 trying path=/software/openssl-0.9.8_runtime/lib/libssl.so.0.9.8 libssl.so.0.9.8 => /software/openssl-0.9.8_runtime/lib/libssl.so.0.9.8 If I hack Makefile.shlib in pgsql/src: ifeq ($(PORTNAME), solaris) ifeq ($(GCC), yes) LINK.shared = $(CC) -shared $(CFLAGS) # ^^^^^^^^^ I added this. else LINK.shared = $(CC) -G $(CFLAGS) # CFLAGS added for X86_64 then it's all good. Would this be considered a bug, or would my environment be considered "unsupported"???