From: Gary D. Duzan Patches for OmniORB 2.4.0 under AIX 4.2 ======================================= There is a problem with shared libraries under AIX in OmniORB 2.4.0. The link step for the utilities in the tree look like: xlC_r -o nameclt -L../../../../lib/powerpc_aix_4.2 nameclt.o ../../../../lib/powerpc_aix_4.2/libomniORB24.a -lomniORB24 -lomnithread2 -lpthreads However, in AIX when you link in a library in this fashion, and the library is shared, the path is forced into the executable, and it will only find the library if it is on that exact relative path, even if LIBPATH is set: gdd0@lion { ~/omniORB_2.4.0/bin/powerpc_aix_4.2 } % ( setenv LIBPATH ~/omniORB_2.4.0/lib/powerpc_aix_4.2 ; ./nameclt list ) Could not load program ./nameclt Could not load library ../../../../lib/powerpc_aix_4.2/libomniORB24.a[libomniORB2.so.4.1] Error was: No such file or directory gdd0@lion { ~/omniORB_2.4.0/bin/powerpc_aix_4.2 } % If you instead link like this: xlC_r -o nameclt -L../../../../lib/powerpc_aix_4.2 nameclt.o -lomniORB24 -lomnithread2 -lpthreads simply removing the *.a file from the command, it works fine: root@lion { ~/omniORB_2.4.0/src/appl/utils/nameclt } # xlC_r -o nameclt -L../../../../lib/powerpc_aix_4.2 nameclt.o -lomniORB24 -lomnithread2 -lpthreads root@lion { ~/omniORB_2.4.0/src/appl/utils/nameclt } # cd .. root@lion { ~/omniORB_2.4.0/src/appl/utils } # nameclt/nameclt list Could not load program nameclt/nameclt Could not load library libomniORB24.a[libomniORB2.so.4.1] Error was: No such file or directory root@lion { ~/omniORB_2.4.0/src/appl/utils } # (setenv LIBPATH ~/omniORB_2.4.0/lib/powerpc_aix_4.2 ; nameclt/nameclt list) Configuration error: Invalid object reference supplied for NAMESERVICE. IOT trap (core dumped) root@lion { ~/omniORB_2.4.0/src/appl/utils } # You may note that the directory changes and that the second one is run as root, but I ran the first as root from the same directory as the second and got the same thing. After a bit of investigation, it appears that the problem is due to the use of $(LibSharedSuffixPattern) in AIX. $(LibSuffixPattern), which is set to %-ar.a, is filtered out, but $(LibSharedSuffixPattern), which is set to %.a, is not. If I add the following to mk/platforms/powerpc_aix_4.2.mk it seems to do the right thing: define CXXExecutable (set -x; \ $(RM) $@; \ $(CXXLINK) -o $@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \ $(filter-out $(LibSharedSuffixPattern), $(filter-out $(LibSuffixPattern),$^)) $$libs; \ ) endef define CExecutable (set -x; \ $(RM) $@; \ $(CLINK) -o $@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \ $(filter-out $(LibSharedSuffixPattern), $(filter-out $(LibSuffixPattern),$^)) $$libs; \ ) endef