Re: [PATCHES] Fix linking of OpenLDAP libraries - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Fix linking of OpenLDAP libraries
Date
Msg-id 22812.1157986468@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Fix linking of OpenLDAP libraries  ("Albe Laurenz" <all@adv.magwien.gv.at>)
Responses Re: [PATCHES] Fix linking of OpenLDAP libraries  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
"Albe Laurenz" <all@adv.magwien.gv.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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Fixed length data types issue
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Fixed length data types issue