Re: AIX shared libraries (was Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries)

2006-09-13 Thread Rocco Altier
Tom Lane wrote: Is it possible that the rules have changed across AIX versions, and that the code in there now is needful for older versions? I don't think that this behaviour has changed. I remember it from AIX 4.3.2. AIX 4.3 is the first version to support the -brtl. The current

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-13 Thread Rocco Altier
PROTECTED] On Behalf Of Albe Laurenz Sent: Tuesday, September 12, 2006 9:01 AM To: Tom Lane *EXTERN* Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries Tom Lane wrote: In our case, we have libpq.a and libpq.so in the same directory, so

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-12 Thread Albe Laurenz
Kevin Brown wrote: Let me expand a little on some of the peculiarities of shared libraries on AIX: - A normal AIX shared library is called libXX.a It is an 'ar' archive that contains the shared object(s). Ah, so the problem really boils down to funny naming conventions. If they use .a

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-12 Thread Albe Laurenz
Tom Lane wrote: In our case, we have libpq.a and libpq.so in the same directory, so unless you link with -brtl you will get a static link (because libpq.a is a static library). I wonder whether we ought to suppress building (or at least installing) our .a libraries at all on AIX. Adding

AIX shared libraries (was Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries)

2006-09-12 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: Tom Lane wrote: I think there's a reasonable argument that by installing a .a file that isn't a shared library, we are violating the platform's conventions. The natural way in AIX would be: - Create libpq.so - Create libpq.a by 'rm -f libpq.a; ar -rc

Re: AIX shared libraries (was Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries)

2006-09-12 Thread Albe Laurenz
Tom Lane wrote: The natural way in AIX would be: - Create libpq.so - Create libpq.a by 'rm -f libpq.a; ar -rc libpq.a libpq.so' - Install only libpq.a Hm. This seems possible with some moderate hacking on Makefile.shlib (certainly it'd be no more invasive than the existing

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: Tom Lane wrote: Applied, but without that last part. It builds OK for me on Darwin, which is moderately picky about that sort of thing, but someone should try AIX. It builds fine on AIX 5.3 as long as you tell it to link with libpq.so. Static builds

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: Static links are going to require it on every platform, not just AIX. The question do we want to ask is how easy do we want to make static linking, because the same treatment will have to apply to -lssl, -lcrypto, -lkrb5, -lk5crypto and quite

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Albe Laurenz
Tom Lane wrote: It builds fine on AIX 5.3 as long as you tell it to link with libpq.so. Static builds against libpq.a will fail. Hm. We have been assuming that AIX's problem is that dynamic libraries don't remember their dependencies properly, but maybe the real issue is that it prefers

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: Let me expand a little on some of the peculiarities of shared libraries on AIX: - A normal AIX shared library is called libXX.a It is an 'ar' archive that contains the shared object(s). Ah, so the problem really boils down to funny naming conventions.

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Albe Laurenz
Tom Lane wrote: Here is a new patch that replaces the previous one; it adds two macros LDAP_LIBS_FE and LDAP_LIBS_BE for frontend and backend, respectively. I did not only add them to the Makefile for interfaces/libpq, but also everywhere something is linked against libpq in case somebody

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Martijn van Oosterhout
On Mon, Sep 11, 2006 at 12:13:29PM +0200, Albe Laurenz wrote: Applied, but without that last part. It builds OK for me on Darwin, which is moderately picky about that sort of thing, but someone should try AIX. It builds fine on AIX 5.3 as long as you tell it to link with libpq.so.

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Albe Laurenz
Here is a new patch that replaces the previous one; it adds two macros LDAP_LIBS_FE and LDAP_LIBS_BE for frontend and backend, respectively. I did not only add them to the Makefile for interfaces/libpq, but also everywhere something is linked against libpq in case somebody links static.

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-11 Thread Kevin Brown
Tom Lane wrote: Albe Laurenz [EMAIL PROTECTED] writes: Let me expand a little on some of the peculiarities of shared libraries on AIX: - A normal AIX shared library is called libXX.a It is an 'ar' archive that contains the shared object(s). Ah, so the problem really boils down to

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-08 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: I did not only add them to the Makefile for interfaces/libpq, but also everywhere something is linked against libpq in case somebody links static. I intensely dislike that part of the patch, but will work on applying the rest. If we do need to start

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-08 Thread Martijn van Oosterhout
On Fri, Sep 08, 2006 at 03:20:00PM -0400, Tom Lane wrote: Albe Laurenz [EMAIL PROTECTED] writes: I did not only add them to the Makefile for interfaces/libpq, but also everywhere something is linked against libpq in case somebody links static. If we do need to start mentioning all of

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-08 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: Here is a new patch that replaces the previous one; it adds two macros LDAP_LIBS_FE and LDAP_LIBS_BE for frontend and backend, respectively. I did not only add them to the Makefile for interfaces/libpq, but also everywhere something is linked against

Re: [PATCHES] [HACKERS] Fix linking of OpenLDAP libraries

2006-09-07 Thread Albe Laurenz
Tom Lane wrote: I have realized that my modifications in configure.in and src/interfaces/libpq/Makefile to link libpq against OpenLDAP are buggy. Here is a proposed patch to fix it. [...] # The backend doesn't need everything that's in LIBS, however ! LIBS := $(filter-out -lz -lreadline

Re: [HACKERS] Fix linking of OpenLDAP libraries

2006-09-05 Thread Albe Laurenz
Tom Lane wrote on September 04, 2006: Albe Laurenz [EMAIL PROTECTED] writes: # The backend doesn't need everything that's in LIBS, however ! LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses -lldap_r $(PTHREAD_LIBS), $(LIBS)) This seems pretty risky. What if

Re: [HACKERS] Fix linking of OpenLDAP libraries

2006-09-04 Thread Tom Lane
Albe Laurenz [EMAIL PROTECTED] writes: # The backend doesn't need everything that's in LIBS, however ! LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses -lldap_r $(PTHREAD_LIBS), $(LIBS)) This seems pretty risky. What if PTHREAD_LIBS contains -L switches? They'd get

[HACKERS] Fix linking of OpenLDAP libraries

2006-08-21 Thread Albe Laurenz
I have realized that my modifications in configure.in and src/interfaces/libpq/Makefile to link libpq against OpenLDAP are buggy. Here is a proposed patch to fix it. I write this to pgsql-hackers too because I want to share the difficulty I'm facing - maybe somebody has a better idea. To handle