AIX: Symbols are missing in libpq.a

From: "REIX, Tony" <tony(dot)reix(at)atos(dot)net>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: AIX: Symbols are missing in libpq.a
Date: 2021-08-26 12:49:01
Message-ID: PR3PR02MB6396742E2FC3E77D37A920BC86C79@PR3PR02MB6396.eurprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While porting postgresql-odbc v13 to AIX, we have found that (at least) 2 symbols are missing in libpq.a provided by the port of PostgreSQL v13.1 to AIX 7.1 by the BullFreeware project :

pg_char_to_encoding
pg_encoding_to_char

Looking at details, it appears that these symbols are present in version 12.8 .
They were still missing in 13.4 .
Something has changed between v12 and v13.

Looking at more details, the way libpq.a is built on AIX is different from the way libpq.so is built on Linux.
On Linux, the file "exports.txt" is used for building the list of symbols to be exported.
On AIX, the tool mkldexport.sh is used for dynamically generating the symbols to be exported.
And it appears that 5 symbols (including the 2 above) are missing on AIX. Don't know why.

A solution is to merge the two list of symbols to be exported in one list.
This is done by the patch attached here.
This patch does:
- add a new 11-lines script ./src/backend/port/aix/mergeldexport.sh which makes the merge only if the file exports.txt does exist.
- add the use of this script in: ./src/Makefile.shlib to be used for AIX only
- add the definition of variable MERGELDEXPORT in: ./src/makefiles/Makefile.aix
Very simple.

I suggest to apply the change for v14 .

Regards/Cordialement,

Tony Reix

tony(dot)reix(at)atos(dot)net

ATOS / Bull SAS
ATOS Expert
IBM-Bull Cooperation Project: Architect & OpenSource Technical Leader
1, rue de Provence - 38432 ECHIROLLES - FRANCE
www.atos.net<https://mail.ad.bull.net/owa/redir.aspx?C=PvphmPvCZkGrAgHVnWGsdMcDKgzl_dEIsM6rX0g4u4v8V81YffzBGkWrtQeAXNovd3ttkJL8JIc.&URL=http%3a%2f%2fwww.atos.net%2f>

Attachment Content-Type Size
postgresql-14.1-MergeExports.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-08-26 12:53:46 Re: Skipping logical replication transactions on subscriber side
Previous Message Ronan Dunklau 2021-08-26 12:14:27 Re: pg_receivewal starting position