Unix Technical Forum

Re: [HACKERS] HEAD doesn't cope with libraries in non-default locations

This is a discussion on Re: [HACKERS] HEAD doesn't cope with libraries in non-default locations within the Pgsql Patches forums, part of the PostgreSQL category; --> Tom Lane wrote: > CVS tip fails with > ./configure --with-openssl \ > --with-includes=/usr/local/ssl/include --with-libs=/usr/local/ssl/lib > > ... > ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:36 AM
Bruce Momjian
 
Posts: n/a
Default Re: [HACKERS] HEAD doesn't cope with libraries in non-default locations

Tom Lane wrote:
> CVS tip fails with
> ./configure --with-openssl \
> --with-includes=/usr/local/ssl/include --with-libs=/usr/local/ssl/lib
>
> ...
> make[3]: Entering directory `/home/postgres/pgsql/src/interfaces/libpq'
> ...
> /usr/ccs/bin/ld +h libpq.sl.4 -b +b /home/postgres/testversion/lib 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 getaddrinfo.o -lssl -lcrypto `gcc -L../../../src/port -L/usr/local/ssl/lib -Wl,-z -Wl,+b -Wl,/home/postgres/testversion/lib -print-libgcc-file-name` -L../../../src/port -L/usr/local/ssl/lib -o libpq.sl.4
> /usr/ccs/bin/ld: Can't find library for -lssl
> make[3]: *** [libpq.sl.4] Error 1
>
> It appears that somebody has changed things so that the -L switches
> appear after the -l switches (ie, too late). I'm too tired to
> investigate now, but my money is on Autoconf 2.59 being the problem ...


I wonder if it was this commit. I am attaching the patch so you can
test to see if it fixes it. If it does, please let us know.

---------------------------------------------------------------------------

revision 1.91
date: 2005/07/02 23:28:22; author: momjian; state: Exp; lines: +2 -2
> A quick look shows that when you use --with-libraries=/foo/bar the
> generated link line for libraries says
>
> -L/foo/bar -lpq
>
> and it should probably be the other way around (as it is for the
> executables).
>
> So I suspect we need some makefile tuning.


You were correct. This patch fixes it.

Jim C. Nasby

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Index: Makefile.shlib
================================================== =================
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.90
retrieving revision 1.91
diff -c -c -r1.90 -r1.91
*** Makefile.shlib 20 Nov 2004 21:13:04 -0000 1.90
--- Makefile.shlib 2 Jul 2005 23:28:22 -0000 1.91
***************
*** 240,246 ****
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
endif

! SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
ifeq ($(enable_rpath), yes)
SHLIB_LINK += $(rpath)
endif
--- 240,246 ----
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
endif

! SHLIB_LINK := $(SHLIB_LINK) $(filter -L%, $(LDFLAGS))
ifeq ($(enable_rpath), yes)
SHLIB_LINK += $(rpath)
endif


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:36 AM
Tom Lane
 
Posts: n/a
Default Re: [HACKERS] HEAD doesn't cope with libraries in non-default locations

Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> It appears that somebody has changed things so that the -L switches
>> appear after the -l switches (ie, too late). I'm too tired to
>> investigate now, but my money is on Autoconf 2.59 being the problem ...


> I wonder if it was this commit. I am attaching the patch so you can
> test to see if it fixes it. If it does, please let us know.


> ! SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
> ...
> ! SHLIB_LINK := $(SHLIB_LINK) $(filter -L%, $(LDFLAGS))


Urgh. This was considered a good idea why exactly?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:36 AM
Bruce Momjian
 
Posts: n/a
Default Re: [HACKERS] HEAD doesn't cope with libraries in non-default

Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> It appears that somebody has changed things so that the -L switches
> >> appear after the -l switches (ie, too late). I'm too tired to
> >> investigate now, but my money is on Autoconf 2.59 being the problem ...

>
> > I wonder if it was this commit. I am attaching the patch so you can
> > test to see if it fixes it. If it does, please let us know.

>
> > ! SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
> > ...
> > ! SHLIB_LINK := $(SHLIB_LINK) $(filter -L%, $(LDFLAGS))

>
> Urgh. This was considered a good idea why exactly?


I didn't like it myself but it fixed a problem with a build farm
machine, and no one objected, so I applied it, but it seemed pretty
strange to be reversing those. I will reverse the patch.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:36 AM
Andrew Dunstan
 
Posts: n/a
Default Re: [HACKERS] HEAD doesn't cope with libraries in non-default

Bruce Momjian said:
> Tom Lane wrote:
>> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> > Tom Lane wrote:
>> >> It appears that somebody has changed things so that the -L switches
>> >> appear after the -l switches (ie, too late). I'm too tired to
>> >> investigate now, but my money is on Autoconf 2.59 being the problem
>> >> ...

>>
>> > I wonder if it was this commit. I am attaching the patch so you can
>> > test to see if it fixes it. If it does, please let us know.

>>
>> > ! SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK)
>> > ...
>> > ! SHLIB_LINK := $(SHLIB_LINK) $(filter -L%, $(LDFLAGS))

>>
>> Urgh. This was considered a good idea why exactly?

>
> I didn't like it myself but it fixed a problem with a build farm
> machine, and no one objected, so I applied it, but it seemed pretty
> strange to be reversing those. I will reverse the patch.
>



I was also slightly dubious about it. However, we do still need to solve the
problem that the patch addressed. Buildfarm members platypus and cuckoo are
currently failing because dblink is picking up the wrong libpq (and it
appears that incorrect libraries are also being picked up in the ecpg
libraries, although this isn't causing a buildfarm failure.)

Alternatively, if we can't say --with-libraries=/foo/bar when /foo/bar
contains possibly conflicting libraries, that should be tested for at
configure time.

cheers

andrew



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:28 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com