I'll try and stick all relevant information into this one message - if I've missed anything let me know.
It looks like it might be the same /usr/lib/libiconv.a on TL5SP5 as your TL5SP4 - it's the same size and the MD5 checksum is as follows, so I would expect the issue to be reproducible there too.
$ oslevel -s
7100-05-05-1939
$ ls -l /usr/lib/libiconv.a-DIST
-r--r--r-- 1 root system 790271 Dec 12 08:49 /usr/lib/libiconv.a-DIST
$ md5sum /usr/lib/libiconv.a
827dff9b3bcbc2d062b188f2c685d4eb /usr/lib/libiconv.aWe haven't hit issues with previous versions installed by the toolbox in the past, but it seems like newer versions of things like coreutils (for example coreutils-8.29-4.ppc vs coreutils-8.29-3.ppc but it's the case with others - I think someone told me that git 2.18 vs 2.20 might have the same dependency update)
I wouldn't focus on the /usr/lib/libiconv.a -> /opt/freeware/lib/libiconv.a symlink as that was removed - someone else suggested that privately to me as a solution but it broken my ability to build our source code against the system libiconv.a so I backed it out.
The issue we seem to have is that if /usr/lib is in the LIBPATH first (and running from a java agent such as jenkins continuous integration which is a fairly common use case does this automatically) then it fails, and it didn't with previous installations from the AIX toolbox. It looks like there is now a dependency of libiconv.so that has changed from shr4.o in earlier versions, so it doesn't work against the system installed libiconv any more, which is presumably a change in how it was built
$ /opt/freeware/bin/git --version
git version 2.20.1
$ ldd /opt/freeware/bin/git
/opt/freeware/bin/git needs:
/usr/lib/libc.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/opt/freeware/lib64/libintl.a(libintl.so.
/opt/freeware/lib/libiconv.a(libiconv.so.2)
/opt/freeware/lib/libz.a(libz.so.1)
/unix
/usr/lib/libcrypt.a(shr_64.o)
$ export LIBPATH=/usr/lib
$ /opt/freeware/bin/git --version
exec(): 0509-036 Cannot load program /opt/freeware/bin/git because of the following errors:
0509-150 Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
0509-152 Member libiconv.so.2 is not found in archive
$ ldd /opt/freeware/bin/git
/opt/freeware/bin/git needs:
/usr/lib/libc.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/lib/libintl.a(libintl.so.
/usr/lib/libiconv.a(libiconv.so.2)
ar: 0707-109 Member name libiconv.so.2 does not exist.
dump: /tmp/tmpdir13041786/extract/libiconv.so.2: 0654-106 Cannot open the specified file.
/usr/lib/libz.a(libz.so.1)
/unix
/usr/lib/libcrypt.a(shr_64.o)
$On an older systems that I installed with an older version of git (this output was a system with an oslevel of 7200-02-02-1810 but I've got an earlier 7.1 system which also works ok with the older tools)
-bash-5.0$ /opt/freeware/bin/git --version
git version 2.8.1
-bash-5.0$ ldd /opt/freeware/bin/git
/opt/freeware/bin/git needs:
/usr/lib/libc.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libintl.a(libintl.so.1)
/usr/lib/libcrypto.a(libcrypto.so)
/usr/lib/libz.a(libz.so.1)
/usr/lib/libiconv.a(shr4.o)
/unix
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
-bash-5.0$ export LIBPATH=/usr/lib
-bash-5.0$ /opt/freeware/bin/git --version
git version 2.8.1
-bash-5.0$ ldd /opt/freeware/bin/git
/opt/freeware/bin/git needs:
/usr/lib/libc.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libintl.a(libintl.so.1)
/usr/lib/libcrypto.a(libcrypto.so)
/usr/lib/libz.a(libz.so.1)
/usr/lib/libiconv.a(shr4.o)
/unix
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)On the working system it's linked against libiconv(shr4.o) which is in the system AIX libiconv.a and on the failing one it's linked against libiconv(libiconv.so.2). If I do the same test with /opt/freeware/bin/ls I get the same symptoms:
$ /opt/freeware/bin/ls --version
ls (GNU coreutils) 8.29
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
$ ldd /opt/freeware/bin/ls
/opt/freeware/bin/ls needs:
/usr/lib/libc.a(shr_64.o)
/opt/freeware/lib/libintl.a(libintl.so.
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/opt/freeware/lib/libiconv.a(libiconv.so.2)
$ export LIBPATH=/usr/lib
$ /opt/freeware/bin/ls --version
exec(): 0509-036 Cannot load program /opt/freeware/bin/ls because of the following errors:
0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.
.
0509-150 Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
0509-152 Member libiconv.so.2 is not found in archive
0509-022 Cannot load module ls_64.
0509-150 Dependent module /opt/freeware/lib/libintl.a(libintl.so.
could not be loaded.
0509-022 Cannot load module .
$ ldd /opt/freeware/bin/ls
/opt/freeware/bin/ls needs:
/usr/lib/libc.a(shr_64.o)
/opt/freeware/lib/libintl.a(libintl.so.
/unix
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/lib/libiconv.a(libiconv.so.2)
ar: 0707-109 Member name libiconv.so.2 does not exist.In the case of the ls test above, my "working" system has ls from coreutils-8.29-3, the failing one 8.29-4 - if the only difference is the change of suffix then it is presumably a change that has been made in the AIX toolbox that has changed the dependency so it now depends in libiconv(libiconv.so.2) where it didn't before (Just for completeness on the working system with 8.29-3 /opt/freeware/bin/ls does not appear to have a dependency on libiconv.a at all) I don't think that either OSS or AIX packages are overwriting each other in this instance, but we do have a situation where we have both on the system in different locations and up til recently that hasn't caused a problem. Is it possible to remove the dependency on libiconv.so.2 and switch it back to the previous dependency of shr4.o?