Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing, set rpath relative to executables #77

Closed
s3rvac opened this issue Jan 3, 2018 · 1 comment
Closed

When installing, set rpath relative to executables #77

s3rvac opened this issue Jan 3, 2018 · 1 comment

Comments

@s3rvac
Copy link
Member

s3rvac commented Jan 3, 2018

Currently, after make install, rpath of executables is set to an absolute path into the installation directory:

$ readelf fileinfo -d | grep rpath
0x000000000000000f (RPATH)     Library rpath: [/home/XXX/projects/retdec-install/lib]

This prevents us from moving the installation directory into a different location, which is useful e.g. when the installation is performed on one machine but we want to run the executables on a different machine. A better way would be to set rpath relative to executables. With GCC/Clang on Linux, this can be done by passing -Wl,-rpath,"\$ORIGIN/../lib".

Notes:

  • CMake RPATH handling
  • The solution should ideally work on both Linux and macOS. However, when comes to dynamic linking, both operating systems have their specifics, so this needs to be taken into account.
@s3rvac
Copy link
Member Author

s3rvac commented Jan 16, 2018

Implemented in 3c76114.

@s3rvac s3rvac closed this as completed Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant