Re: [PATCHES] Fix linking of OpenLDAP libraries

From: "Rocco Altier" <RoccoA(at)Routescape(dot)com>
To: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>, "Tom Lane *EXTERN*" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Fix linking of OpenLDAP libraries
Date: 2006-09-13 15:40:03
Message-ID: 6E0907A94904D94B99D7F387E08C4F57016D1A8B@FALCON.INSIGHT
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The patch did not work for me :-(

My buildfarm members failed in local testing to execute the
install-check, because initdb failed to find libpq.so.

Make check did succeed, so I think there is a possibility of getting it
working, but it won't be as simple as adding -brtl to the template.

I was also getting duplicate symbols in the link, that I wasn't before
either.

I don't have time right now to work through all the issues, but wanted
to give feedback that the patch isn't quite this simple.

Thanks,
-rocco

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Albe Laurenz
> Sent: Tuesday, September 12, 2006 9:01 AM
> To: Tom Lane *EXTERN*
> Cc: pgsql-hackers(at)postgresql(dot)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 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.
>
> 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
>
> For a static build on AIX, you have to specify all the libraries and
> give the linker -bstatic and -bI:/lib/syscalls.exp
>
> >> 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
>
> I have done that (see the attached patch) and it works fine.
> I don't have the native AIX C compiler, so I could only test
> it with gcc.
>
> I have taken the liberty to modify the static link line
> in Makefile.global.in to contain the LDAP libraries, I hope
> that's appropriate.
>
> Yours,
> Laurenz Albe
>

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2006-09-13 15:51:12 Re: [PATCHES] Linking on AIX (Was: Fix linking of OpenLDAP libraries )
Previous Message Tom Dunstan 2006-09-13 15:38:30 Re: Getting a move on for 8.2 beta