BUG #2608: dblink compile fails on AIX 5.3

Lists: pgsql-bugs
From: "Michael Hoffmann" <hoffmann(at)fh-trier(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-04 14:21:01
Message-ID: 200609041421.k84EL1qW007250@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2608
Logged by: Michael Hoffmann
Email address: hoffmann(at)fh-trier(dot)de
PostgreSQL version: 8.1.2
Operating system: AIX 5.3
Description: dblink compile fails on AIX 5.3
Details:

>/usr/local/pgsql/src/postgresql-8.1.2/contrib/dblink>gmake
../../src/backend/port/aix/mkldexport.sh libdblink.a > libdblink.exp
xlC -O2 -qmaxmem=16384 -qsrcmsg -qlonglong -Wl,-bnoentry -Wl,-H512
-Wl,-bM:SRE -o libdblink.so libdblink.a -Wl,-bE:libdblink.exp
-L../../src/interfaces/libpq -L../../src/port -lpq
-Wl,-bI:../../src/backend/postgres.imp
ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
ld: 0711-317 ERROR: Undefined symbol: .dgettext
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
gmake: *** [libdblink.so] Error 8


From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-bugs(at)postgresql(dot)org pgsql-ports(at)postgresql(dot)org
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-07 22:54:04
Message-ID: 60u03jqodv.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

hoffmann(at)fh-trier(dot)de ("Michael Hoffmann") writes:
> The following bug has been logged online:
>
> Bug reference: 2608
> Logged by: Michael Hoffmann
> Email address: hoffmann(at)fh-trier(dot)de
> PostgreSQL version: 8.1.2
> Operating system: AIX 5.3
> Description: dblink compile fails on AIX 5.3
> Details:
>
>>/usr/local/pgsql/src/postgresql-8.1.2/contrib/dblink>gmake
> ../../src/backend/port/aix/mkldexport.sh libdblink.a > libdblink.exp
> xlC -O2 -qmaxmem=16384 -qsrcmsg -qlonglong -Wl,-bnoentry -Wl,-H512
> -Wl,-bM:SRE -o libdblink.so libdblink.a -Wl,-bE:libdblink.exp
> -L../../src/interfaces/libpq -L../../src/port -lpq
> -Wl,-bI:../../src/backend/postgres.imp
> ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
> ld: 0711-317 ERROR: Undefined symbol: .dgettext
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> gmake: *** [libdblink.so] Error 8

This looks like another instance of missing libraries, akin to a
problem I'm having with compiling (AIX 5.3 with GCC 4.1.1) with
OpenSSL support.

Those objects are part of gettext, which gets linked in if you request
NLS support.

What has proven helpful to me with the OpenSSL issue is to modify
contrib/dblink/Makefile

SHLIB_LINK = $(libpq)

-- becomes -->>

SHLIB_LINK = $(libpq) $(LIBS)

You might find that helpful.

You might also try to recompile some non-contrib component, let's say
the postmaster, or psql. See what libraries are included; adding them
to the SHLIB_LINK line may do the trick.

Tom Lane has indicated that simply adding in $(LIBS) isn't quite
right; it may draw in too many libraries. I don't see any other
binding that is more suitable, alas.
--
output = ("cbbrowne" "@" "linuxdatabases.info")
http://www3.sympatico.ca/cbbrowne/languages.html
"No, I'm not interested in developing a powerful brain. All I'm after
is just a mediocre brain, something like the president of American
Telephone and Telegraph Company." -- Alan Turing on the possibilities
of a thinking machine, 1943.


From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-10 20:05:56
Message-ID: 87ac57xza3.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

In the last exciting episode, hoffmann(at)fh-trier(dot)de ("Michael Hoffmann") wrote:
> The following bug has been logged online:
>
> Bug reference: 2608
> Logged by: Michael Hoffmann
> Email address: hoffmann(at)fh-trier(dot)de
> PostgreSQL version: 8.1.2
> Operating system: AIX 5.3
> Description: dblink compile fails on AIX 5.3
> Details:
>
>>/usr/local/pgsql/src/postgresql-8.1.2/contrib/dblink>gmake
> ../../src/backend/port/aix/mkldexport.sh libdblink.a > libdblink.exp
> xlC -O2 -qmaxmem=16384 -qsrcmsg -qlonglong -Wl,-bnoentry -Wl,-H512
> -Wl,-bM:SRE -o libdblink.so libdblink.a -Wl,-bE:libdblink.exp
> -L../../src/interfaces/libpq -L../../src/port -lpq
> -Wl,-bI:../../src/backend/postgres.imp
> ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
> ld: 0711-317 ERROR: Undefined symbol: .dgettext
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> gmake: *** [libdblink.so] Error 8

I mentioned earlier that changing SHLIB_LINK might be helpful.

The patch that turns out to be needful for crypto is the following:

Index: Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/dblink/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile 27 Feb 2006 12:54:38 -0000 1.11
+++ Makefile 10 Sep 2006 21:01:45 -0000
@@ -20,3 +20,5 @@
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
+
+SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))

In effect, we need to take LIBS, which contains all the libraries
pulled in as "defaults" for builds of objects in the main tree, filter
that against the 4 crypto libraries, and add them to the set of libs
we need to link with (e.g. - SHLIB_LINK).

I'm not sure what libraries gettext draws in; supposing it adds, to a
build of psql, -lgettext, then you might also add the line:

SHLIB_LINK += $(filter -lgettext, $(LIBS))
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','gmail.com').
http://cbbrowne.com/info/nonrdbms.html
"In computing, invariants are ephemeral." -- Alan Perlis


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-10 21:40:04
Message-ID: 3275.1157924404@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Christopher Browne <cbbrowne(at)acm(dot)org> writes:
> +SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))

Done, but it's really pretty ugly. I am thinking it'd make more sense
for Makefile.global to define a macro for the libraries libpq depends
on ...

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-10 22:11:15
Message-ID: 4982.1157926275@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

I wrote:
> Done, but it's really pretty ugly. I am thinking it'd make more sense
> for Makefile.global to define a macro for the libraries libpq depends
> on ...

I went ahead and did this as per discussion here:
http://archives.postgresql.org/pgsql-bugs/2006-08/msg00200.php

Please see if I managed to break AIX ;-). It'd be a good idea to
compile with every configure option you can find turned on.

regards, tom lane


From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2608: dblink compile fails on AIX 5.3
Date: 2006-09-11 01:08:12
Message-ID: 87y7srw6pv.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Quoth tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane):
> I wrote:
>> Done, but it's really pretty ugly. I am thinking it'd make more sense
>> for Makefile.global to define a macro for the libraries libpq depends
>> on ...
>
> I went ahead and did this as per discussion here:
> http://archives.postgresql.org/pgsql-bugs/2006-08/msg00200.php
>
> Please see if I managed to break AIX ;-). It'd be a good idea to
> compile with every configure option you can find turned on.

A run on buildfarm member "grebe" just completed successfully, now
with openssl support, so I gotta say "thumbs up!"

I don't have gettext libraries installed, so that won't get tested
right away. SSL is an addition I'd quite like. The list of "nice to
try" would be gettext, ldap, Kerberos; I don't think I can promise all
those during this particular cycle, but I'd certainly be keen on
adding them, ultimately.

I also just verified that readline is playing well, too. Sweet!
(The difficulties of AIX + readline were the initiator of a fair bit
of change to linking of libs and such, so it's particularly pleasing
that this is working fine :-))
--
"cbbrowne","@","gmail.com"
http://linuxdatabases.info/info/emacs.html
Rules of the Evil Overlord #146. "If my surveillance reports any
un-manned or seemingly innocent ships found where they are not
supposed to be, they will be immediately vaporized instead of brought
in for salvage." <http://www.eviloverlord.com/>