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

Fix runtime linking when installed outside default prefix (#153) #934

Closed
wants to merge 1 commit into from
Closed

Fix runtime linking when installed outside default prefix (#153) #934

wants to merge 1 commit into from

Conversation

hpjansson
Copy link

When libiperf was installed in a directory not searched by default (e.g. /usr/local/lib on some systems), iperf3 would fail to find it at runtime. Pass -rpath when linking iperf3 to remedy this. The problem was originally discovered on Ubuntu Linux.

When libiperf was installed in a directory not searched by default
(e.g. /usr/local/lib on some systems), iperf3 would fail to find
it at runtime. Pass -rpath when linking iperf3 to remedy this. The
problem was originally discovered on Ubuntu Linux.
@hpjansson
Copy link
Author

I ran into this while looking for the best practice solution for a similar situation in one of my projects. This is the solution I ended up with. It's a small change, so I thought maybe it'd work for you too.

@bmah888
Copy link
Contributor

bmah888 commented Nov 27, 2019

Thanks for the PR...that's very helpful. Wondering if anyone who packages iperf3 for their OS/distro has any feedback/comments on this change?

@hpjansson
Copy link
Author

I don't package iperf3 myself, but I have experience with packaging for openSUSE. With my packager hat on, I'd probably patch out the -rpath to make linking consistent with the rest of the platform and because the package installs to a standard location.

A possible compromise would be to make it optional (on by default) and add a --without-rpath flag to configure.

Historically, using -rpath to link with libraries in common paths has been frowned upon, because the DT_RPATH entry makes binaries impossible to relocate -- i.e. it would always look for the library at the full path first and if found, would ignore LD_LIBRARY_PATH and other attempts to override it. Newer ld (since ~2017) adds DT_RUNPATH which has a lower priority than LD_LIBRARY_PATH, so it's less of a problem than it used to be.

The Debian wiki has a useful summary. It's probably representative of how packagers think about the situation.

@bmah888
Copy link
Contributor

bmah888 commented Sep 14, 2020

After a really long time, we decided to give up on #153 and not try to solve it, so I'm going to respectfully decline this pull request. Thank you for the submission!

@bmah888 bmah888 closed this Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants