Hi, On 2022-08-17 15:28:18 -0400, Robert Haas wrote: > On Wed, Aug 17, 2022 at 3:02 PM Andres Freund <and...@anarazel.de> wrote: > > 2) Do we care about static libraries not suriving on AIX? There could also > > be > > a race in the buildrules leading to sometimes static libs sometimes > > shared > > libs winning, I think. > > Instead of overwriting the same file, can we not use different > filenames for different things?
Not easily, as far as I understand. The way one customarily links to shared libraries on aix is to have an .a archive containing the shared library. That way the -lpq picks up libpq.a, which then triggers the shared library to be referenced. E.g. andres@gcc119:[/home/andres/src/postgres/build-ac]$ LIBPATH=$(pwd)/src/interfaces/libpq ldd src/bin/scripts/clusterdb src/bin/scripts/clusterdb needs: /usr/lib/libc.a(shr_64.o) /usr/lib/libpthread.a(shr_xpg5_64.o) /usr/lib/libreadline.a(libreadline.so.6) /home/andres/src/postgres/build-ac/src/interfaces/libpq/libpq.a(libpq.so.5) /unix /usr/lib/libcrypt.a(shr_64.o) /usr/lib/libcurses.a(shr42_64.o) /usr/lib/libpthreads.a(shr_xpg5_64.o) Note the .a(libpq.so.5) bit. Unfortunately that's exactly how one links to a static library as well. So we'd have to change the name used as -l$this between linking to a shared libpq and a static libpq. Greetings, Andres Freund