Created attachment 229031 [details] patch Binutils ld currently doesn't use new dtags by default, unlike LLVM ld. This patch adds the --enable-new-dtags configure flag for FreeBSD targets. This makes binutils ld use DT_RUNPATH instead of DT_RPATH by default. The difference between the two is explained in the rtld man page.
Should this be merged to quarterly branch? Does it need or would an exp-run be handy? ^Triage: Reporter is committer, assign accordingly
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=dea411ca0ce1f3152bad6609868146f383b720c6 commit dea411ca0ce1f3152bad6609868146f383b720c6 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2021-10-25 16:33:09 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2021-11-11 21:18:12 +0000 devel/binutils: configure with --enable-new-dtags This makes binutils ld use DT_RUNPATH instead of DT_RPATH by default for FreeBSD targets and brings it in line with LLVM ld. The difference between the two is that DT_RUNPATH has a lower priority than the LD_LIBRARY_PATH environment variable. This variable is used by libtool to override DT_RUNPATH when running programs directly from the build directory (e.g. during make test). PR: 259446 Approved by: maintainer timeout (2 weeks) devel/binutils/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
A commit in branch 2021Q4 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=06072fa94da786cb7c20f5a3eb9e8144bcb87fa5 commit 06072fa94da786cb7c20f5a3eb9e8144bcb87fa5 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2021-10-25 16:33:09 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2021-11-20 19:30:02 +0000 devel/binutils: configure with --enable-new-dtags This makes binutils ld use DT_RUNPATH instead of DT_RPATH by default for FreeBSD targets and brings it in line with LLVM ld. The difference between the two is that DT_RUNPATH has a lower priority than the LD_LIBRARY_PATH environment variable. This variable is used by libtool to override DT_RUNPATH when running programs directly from the build directory (e.g. during make test). PR: 259446 Approved by: maintainer timeout (2 weeks) (cherry picked from commit dea411ca0ce1f3152bad6609868146f383b720c6) devel/binutils/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)