[cmake-developers] [CMake 0012171]: Runpaths incorrect for all hpux/pa_risc systems

Mantis Bug Tracker mantis at public.kitware.com
Mon May 9 23:07:57 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12171 
====================================================================== 
Reported By:                Peter O'Gorman (The Written Word, Inc.)
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12171
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-05-09 23:07 EDT
Last Modified:              2011-05-09 23:07 EDT
====================================================================== 
Summary:                    Runpaths incorrect for all hpux/pa_risc systems
Description: 
Installing a build with shared libraries on this system causes builddir runpaths
to be coded into the installed shared libraries and executables.

e.g.

/opt/TWWfsw/libproxy04/lib/libproxy.sl:
         shared library
         shared library dynamic path search:
             SHLIB_PATH     disabled  second
             embedded path  enabled   first  /opt/TWWfsw/libproxy04/lib:/usr/lib
         internal name:
             libproxy.sl.1
         shared library list:
             static   
/opt/build/libproxy-0.4.6/libproxy/../libmodman/libmodman.sl.1
             dynamic   /usr/lib/libnsl.1
             dynamic   /usr/lib/libcma.2


Because ld is invoked with a command like
aCC -o /path/to/libproxy.sl.1 .... ../libmodman/libmodman.sl.1 ....

The library is added and its type is set to static, this means that the RPATH
and env vars have no effect, if the library does not exist at
/opt/build/libproxy-0.4.6/libmodman/libmodman.sl.1 the executable will abort.

Steps to Reproduce: 
Build libproxy on HP-UX/PA 32bit. (the 64 bit linker behaves differently).

Additional Information: 
Attached is the hack that we used to let hpux builds use -L.. -lfoo, which makes
the entry "dynamic" so that SHLIB_PATH and the RPATH can have a chance to work.
This includes a hack to the install to add -L flags for every path in RPATH
prior to other -L paths, this allows us to do 'make install' then rm all the
relinked binaries in the build dir, do 'make install' again and have no
references to the build dir appear in the installed libraries, because the
second relink will use the installed libraries.

Relinking happens in a 'preinstall' rule, and I don't know how to move it to an
install rule. If it were in the install: rule then it would work well. Assuming
that cmake installs things in dependency order (it appears to, but I don't know
if that is guaranteed), we would, for libproxy for example, relink libmodman,
install libmodman, relink libproxy using the installed libmodman, install
libproxy, relink the 'proxy' utility using both installed libraries, install
proxy, and all the embedded paths would be correct. Time permitting, I will
continue to look at fixing this properly.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-09 23:07 Peter O'Gorman (The Written Word, Inc.)New Issue               
                    
2011-05-09 23:07 Peter O'Gorman (The Written Word, Inc.)File Added:
cmake.hack.patch                    
======================================================================




More information about the cmake-developers mailing list