Re: [PATCHES] Fix linking of OpenLDAP libraries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] Fix linking of OpenLDAP libraries
Date: 2006-09-11 14:54:28
Message-ID: 22812.1157986468@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at> 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.
If they use ".a" for both shared and static libraries, how does anyone
tell the difference?

> So the linker does not prefer static over dynamic libraries,
> it just perfers libXX.a over libXX.so.

> 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 -btrl to LDFLAGS would help
within the context of our own build, but external clients that link
to libpq without saying that are going to get undesirable results.

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.

> Should -brtl be added to src/template/aix?

Sounds that way, but that'll only help for psql and other stuff built
within our build. Could you try this against CVS tip:

* add -brtl to LDFLAGS in the template
* Remove the AIX-specific hack on $(libpq) at lines 349-354 of
src/Makefile.global.in
* see if it configures and builds

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-09-11 14:55:14 Re: Fixed length data types issue
Previous Message Alvaro Herrera 2006-09-11 14:52:04 Re: Fixed length data types issue