Skip to content

AIX: Not enough room for XCOFF editor to set install_rpath

Respected community members,

Hi,

In AIX currently, if we CMAKE_INSTALL_RPATH="/Aditya/Aditya" currently in AIX, it concatenates the install_rpath to the build_rpath.

For example the LIBPATH during build is

# dump -Hov ./libhello_shared.a
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib:/usr/lib:/lib:::::::::::::

But during install we get,

Set runtime path of "/usr/local/lib/libhello_shared_no_so.a" to "/aditya/aditya:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib:/usr/lib:/lib"

One thing I observed in Linux is that if a user gives CMAKE_INSTALL_RPATH="/Aditya/Aditya" then it simply keeps it as /Aditya/Aditya not anything else. We would like to keep this the same for AIX.

I want to fix this in SetLibpath in cmXCOFF.cxx

The second problem we have is the cmake policy CMP0095 https://cmake.org/cmake/help/latest/prop_tgt/INSTALL_RPATH.html

This $ORIGIN is not parsed in AIX. Also, this $ORIGIN is given preference over CMAKE_INSTALL_RPATH which causes problems in certain projects like abseil-cpp since $ORIGIN is not replaced in binary's blibpath.

One example of not parsing is as shown below

Set runtime path of "/home/aditya/abseil-cpp-20240722.0/install/lib64/libabsl_bad_any_cast_impl.a" to "$ORIGIN:/opt/freeware/lib/pthread:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/pthread/ppc64:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/lib"

Kindly let me know what you think of these two issues and how we can design and solve this problem for CMake and AIX.

Regards,

Edited by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information