Re: AIX: Symbols are missing in libpq.a

From: Noah Misch <noah(at)leadboat(dot)com>
To: "REIX, Tony" <tony(dot)reix(at)atos(dot)net>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: AIX: Symbols are missing in libpq.a
Date: 2021-08-30 14:52:56
Message-ID: 20210830145256.GA2162070@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 30, 2021 at 02:33:32PM +0000, REIX, Tony wrote:
> It appears that the Makefile in src/interfaces/libpq has been modified between v12 and v13, removing encnames.o (and wchar.o) from the object files being used for creating the static libpq.a file which is used for creating the libpq.so and libpq.a AIX shared-library files.
> And, since pg_encoding_to_char() is defined in encnames.o , it has disappeared from the libpq.exp file .
>
> # diff postgresql-12.8/32bit/src/interfaces/libpq/Makefile postgresql-13.1/32bit/src/interfaces/libpq/Makefile | grep encnames
> < OBJS += encnames.o wchar.o
> < encnames.c wchar.c: % : $(backend_src)/utils/mb/%
> < rm -f encnames.c wchar.c
>
> Remember how the final libpq.a is built on AIX:
>
> rm -f libpq.a
> /usr/bin/ar crs libpq.a fe-auth-scram.o ...
> touch libpq.a
> ../../../src/backend/port/aix/mkldexport.sh libpq.a libpq.so.5 >libpq.exp
> /opt/freeware/bin/gcc -maix64 -O3 ..... -o libpq.so.5 libpq.a -Wl,-bE:libpq.exp .......
> rm -f libpq.a
> /usr/bin/ar crs libpq.a libpq.so.5
>
> 12.8 : /usr/bin/ar crs libpq.a fe-auth.o fe-auth-scram.o fe-connect.o fe-exec.o fe-lobj.o fe-misc.o fe-print.o fe-protocol2.o fe-protocol3.o
> pqexpbuffer.o fe-secure.o legacy-pqsignal.o libpq-events.o encnames.o wchar.o fe-secure-openssl.o fe-secure-common.o
>
> 13.1 : /usr/bin/ar crs libpq.a fe-auth.o fe-auth-scram.o fe-connect.o fe-exec.o fe-lobj.o fe-misc.o fe-print.o fe-protocol2.o fe-protocol3.o
> pqexpbuffer.o fe-secure.o legacy-pqsignal.o libpq-events.o fe-secure-common.o fe-secure-openssl.o
>
>
> Maybe you can discover why these changes were made in v13 for src/interfaces/libpq/Makefile .
> And mkldexport.sh , unchanged between v12 and v13, works perfectly.

Thanks; that makes sense. Those files moved to libpgcommon_shlib.a. The
$(MKLDEXPORT) call sees symbols in the .o files, but it doesn't see symbols
pulled in via libpg*.a. Let's fix this by having Makefile.shlib skip
$(MKLDEXPORT) when a $(SHLIB_EXPORTS) file is available and have it instead
create lib$(NAME).exp from $(SHLIB_EXPORTS). That's more correct than
merging, and it's simpler. Would you like to try that?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-08-30 14:58:07 Re: Can we get rid of repeated queries from pg_dump?
Previous Message Tom Lane 2021-08-30 14:51:46 Re: Patch: shouldn't timezone(text, timestamp[tz]) be STABLE?