The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13497 
====================================================================== 
Reported By:                marled
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13497
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-08-30 10:34 EDT
Last Modified:              2012-08-30 10:34 EDT
====================================================================== 
Summary:                    CMAKE_SKIP_INSTALL_RPATH removes RPATH but leaves
empty RUNPATH.
Description: 
Hello,

I used the downloadable binary version of cmake for this test.

If I do not specify options for RPATH specific features, then the behaviour is
the same - this is probably the default anyway.

My first question is that if this behaviour (= empty RUNPATH) is intendend?

Since I assume not, both fields, RPATH and RUNPATH, should always have the same
contents or should both not exist at all. I could use
CMAKE_BUILD_WITH_INSTALL_RPATH or CMAKE_SKIP_BUILD_RPATH which works around the
problem, but then of course I would not be able to run programs from the build
directory.

Thank you for your answer,

Martin Lederhilger

Steps to Reproduce: 
Please see the test case in the attached tar.gz-file.

#CONFIGURATION, BUILDING AND INSTALLING:
frosch3:/home/lederhi/rpath/build $ cmake
-DCMAKE_INSTALL_PREFIX=`pwd`/../install ..
-- The C compiler identification is GNU 4.5.0
-- The CXX compiler identification is GNU 4.5.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lederhi/rpath/build

frosch3:/home/lederhi/rpath/build $ make install
Scanning dependencies of target a
[ 33%] Building C object liba/CMakeFiles/a.dir/a.c.o
Linking C shared library liba.so
[ 33%] Built target a
Scanning dependencies of target b
[ 66%] Building C object libb/CMakeFiles/b.dir/b.c.o
Linking C shared library libb.so
[ 66%] Built target b
Scanning dependencies of target prg
[100%] Building C object CMakeFiles/prg.dir/prg.c.o
Linking C executable prg
[100%] Built target prg
Install the project...
-- Install configuration: ""
-- Installing: /home/lederhi/rpath/install/bin/prg
-- Removed runtime path from "/home/lederhi/rpath/install/bin/prg"
-- Installing: /home/lederhi/rpath/install/liba/liba.so
-- Installing: /home/lederhi/rpath/install/libb/libb.so
-- Removed runtime path from "/home/lederhi/rpath/install/libb/libb.so"

#IN THE BUILD DIRECTORY
frosch3:/home/lederhi/rpath/build $ readelf -d prg liba/liba.so libb/libb.so

File: prg

Dynamic section at offset 0xf08 contains 24 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libb.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000f (RPATH)                      Library rpath:
[/home/lederhi/rpath/build/libb:/home/lederhi/rpath/build/liba:]
 0x0000001d (RUNPATH)                    Library runpath:
[/home/lederhi/rpath/build/libb:/home/lederhi/rpath/build/liba:]
 0x0000000c (INIT)                       0x804852c
 0x0000000d (FINI)                       0x804871c
 0x00000004 (HASH)                       0x80481c4
 0x6ffffef5 (GNU_HASH)                   0x8048258
 0x00000005 (STRTAB)                     0x80483d8
 0x00000006 (SYMTAB)                     0x80482b8
 0x0000000a (STRSZ)                      238 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x8049ff4
 0x00000002 (PLTRELSZ)                   24 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x8048514
 0x00000011 (REL)                        0x804850c
 0x00000012 (RELSZ)                      8 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x80484ec
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x80484c6
 0x00000000 (NULL)                       0x0

File: liba/liba.so

Dynamic section at offset 0xf18 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [liba.so]
 0x0000000c (INIT)                       0x30c
 0x0000000d (FINI)                       0x478
 0x00000004 (HASH)                       0x118
 0x6ffffef5 (GNU_HASH)                   0x154
 0x00000005 (STRTAB)                     0x230
 0x00000006 (SYMTAB)                     0x190
 0x0000000a (STRSZ)                      117 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x1ff4
 0x00000002 (PLTRELSZ)                   16 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x2fc
 0x00000011 (REL)                        0x2dc
 0x00000012 (RELSZ)                      32 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x2bc
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x2a6
 0x6ffffffa (RELCOUNT)                   1
 0x00000000 (NULL)                       0x0

File: libb/libb.so

Dynamic section at offset 0xf00 contains 25 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [liba.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libb.so]
 0x0000000f (RPATH)                      Library rpath:
[/home/lederhi/rpath/build/liba:]
 0x0000001d (RUNPATH)                    Library runpath:
[/home/lederhi/rpath/build/liba:]
 0x0000000c (INIT)                       0x354
 0x0000000d (FINI)                       0x4e8
 0x00000004 (HASH)                       0x118
 0x6ffffef5 (GNU_HASH)                   0x158
 0x00000005 (STRTAB)                     0x244
 0x00000006 (SYMTAB)                     0x194
 0x0000000a (STRSZ)                      159 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x1ff4
 0x00000002 (PLTRELSZ)                   24 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x33c
 0x00000011 (REL)                        0x31c
 0x00000012 (RELSZ)                      32 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x2fc
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x2e4
 0x6ffffffa (RELCOUNT)                   1
 0x00000000 (NULL)                       0x0

#IN THE INSTALL DIRECTORY
frosch3:/home/lederhi/rpath/install $ readelf -d bin/prg liba/liba.so
libb/libb.so

File: bin/prg

Dynamic section at offset 0xf08 contains 23 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libb.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000001d (RUNPATH)                    Library runpath: []
 0x0000000c (INIT)                       0x804852c
 0x0000000d (FINI)                       0x804871c
 0x00000004 (HASH)                       0x80481c4
 0x6ffffef5 (GNU_HASH)                   0x8048258
 0x00000005 (STRTAB)                     0x80483d8
 0x00000006 (SYMTAB)                     0x80482b8
 0x0000000a (STRSZ)                      238 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x8049ff4
 0x00000002 (PLTRELSZ)                   24 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x8048514
 0x00000011 (REL)                        0x804850c
 0x00000012 (RELSZ)                      8 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x80484ec
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x80484c6
 0x00000000 (NULL)                       0x0

File: liba/liba.so

Dynamic section at offset 0xf18 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [liba.so]
 0x0000000c (INIT)                       0x30c
 0x0000000d (FINI)                       0x478
 0x00000004 (HASH)                       0x118
 0x6ffffef5 (GNU_HASH)                   0x154
 0x00000005 (STRTAB)                     0x230
 0x00000006 (SYMTAB)                     0x190
 0x0000000a (STRSZ)                      117 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x1ff4
 0x00000002 (PLTRELSZ)                   16 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x2fc
 0x00000011 (REL)                        0x2dc
 0x00000012 (RELSZ)                      32 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x2bc
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x2a6
 0x6ffffffa (RELCOUNT)                   1
 0x00000000 (NULL)                       0x0

File: libb/libb.so

Dynamic section at offset 0xf00 contains 24 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [liba.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libb.so]
 0x0000001d (RUNPATH)                    Library runpath: []
 0x0000000c (INIT)                       0x354
 0x0000000d (FINI)                       0x4e8
 0x00000004 (HASH)                       0x118
 0x6ffffef5 (GNU_HASH)                   0x158
 0x00000005 (STRTAB)                     0x244
 0x00000006 (SYMTAB)                     0x194
 0x0000000a (STRSZ)                      159 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x1ff4
 0x00000002 (PLTRELSZ)                   24 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x33c
 0x00000011 (REL)                        0x31c
 0x00000012 (RELSZ)                      32 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x2fc
 0x6fffffff (VERNEEDNUM)                 1
 0x6ffffff0 (VERSYM)                     0x2e4
 0x6ffffffa (RELCOUNT)                   1
 0x00000000 (NULL)                       0x0


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-08-30 10:34 marled         New Issue                                    
2012-08-30 10:34 marled         File Added: rpath.tar.gz                     
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to