Bug 390836 - Wrong RPATH in apper binary
Summary: Wrong RPATH in apper binary
Status: RESOLVED FIXED
Alias: None
Product: apper
Classification: Applications
Component: general (show other bugs)
Version: 1.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Nicoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-21 07:53 UTC by Antonio Rojas
Modified: 2018-02-22 08:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2018-02-21 07:53:44 UTC
After compiling 1.0.0, the apper binary gets the build-time path of libapper as RPATH, so it fails to run when installed on the system

> apper
apper: error while loading shared libraries: libapper_private.so: cannot open shared object file: No such file or directory

> readelf -d /usr/bin/apper | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/build/apper/src/build/libapper]

Strangely, this only affects the apper binary, all other binaries/libraries have the correct RPATH even though the CMakeLists.txt code is similar:
> LANG=C readelf -d /usr/lib/apper-pk-session | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib/apper]

Using cmake 3.10.2, and compiling with 

    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DAPPSTREAM=ON
Comment 1 Antonio Rojas 2018-02-21 08:20:02 UTC
https://phabricator.kde.org/D10706
Comment 2 Daniel Nicoletti 2018-02-21 10:16:32 UTC
What is odd is that it works on my system
Comment 3 Antonio Rojas 2018-02-22 08:40:03 UTC
Git commit 448527f765b1c4f9dc5452cc069baddecaf55e7e by Antonio Rojas.
Committed on 21/02/2018 at 12:57.
Pushed by arojas into branch 'master'.

Install apper binary as TARGET instead of PROGRAM

Otherwise the RPATH set in add_target_properties is ignored
Differential Revision: https://phabricator.kde.org/D10706

M  +1    -1    Apper/CMakeLists.txt

https://commits.kde.org/apper/448527f765b1c4f9dc5452cc069baddecaf55e7e