binutils links with libdebuginfod.so.1 if devel/elfutils installed, but this is not reflected in deps list.
This is because elfutils is not required. One could add an option but other than that, the port is working as designed. Recommend you build binutils using poudriere, build in a clean jail, or uninstall elfutils prior to building binutils.
This is not how it should work.
(In reply to Ivan Rozhuk from comment #2) What are you suggesting then? That binutils depend on elfutils? What if a person doesn't want to install elfutils in order to install binutils? What about binary package users? Should they also be forced to install elfutils (via dependency) when they install binutils?
1. Add option to enable/disable linking with libdebuginfod.so.1 or 2. Disable linking with libdebuginfod.so.1 or 3. Add port dep devel/elfutils Other ports maintainer in same case trying to fix it: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273799 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273479 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273801 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273805
Before: ... checking pkg-config is at least version 0.9.0... yes checking whether to use debuginfod... auto checking for libdebuginfod >= 0.179... no checking dynamic linker characteristics... yes checking for thread support... yes ... After: ... checking for pkg-config... /usr/local/bin/pkg-config checking pkg-config is at least version 0.9.0... cmp --ignore-initial=16 $$f1 $$f2 yes checking whether to use debuginfod... no configure: WARNING: debuginfod support disabled; some features may be unavailable. yes no checking dynamic linker characteristics... checking for vsprintf... yes checking for thread support... yes ...
Created attachment 244905 [details] patch
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=90f14401dea714ea5558bd4ae0b704aeb0fecc9c commit 90f14401dea714ea5558bd4ae0b704aeb0fecc9c Author: Rozhuk Ivan <rozhuk.im@gmail.com> AuthorDate: 2023-09-15 21:29:20 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-09-16 01:59:58 +0000 devel/binutils: Disable randomly discovered libelf dependency Users who build binutils from ports source will discover an implied dependency for elfutils should elfutils be installed at the time make is run. PORTREVISION is not bumped because this bug does not affect building of binary packages. The binary package never has an elfutils dependency because elfutils is never installed in the poudriere jail prior to building binutils. This avoids a gratuitous rebuild of binary packages when none is needed. PR: 273798 devel/binutils/Makefile | 1 + 1 file changed, 1 insertion(+)
Thank you for the patch. I won't MFH it because this has no affect on binary package content because binary packages are built in a poudriere jail without elfutils being pre-installed, avoiding a gratuitous rebuild of binary packages.
Thanks, and sorry :) I dig a bit more inside [1] and found that FreeBSD have its own libelf.so, "--without-libelf" is not required and should be removed, IMHO. 1. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273839
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=b7f2c91ae8f9b047c7e9af6b1d8772752cfcc08f commit b7f2c91ae8f9b047c7e9af6b1d8772752cfcc08f Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2023-09-16 13:33:34 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-09-16 13:36:40 +0000 Revert "devel/binutils: Disable randomly discovered libelf dependency" The author requests revert. His patch has caused PR/273839. PR: 273798, 273839 This reverts commit 90f14401dea714ea5558bd4ae0b704aeb0fecc9c. devel/binutils/Makefile | 1 - 1 file changed, 1 deletion(-)
"--without-debuginfod" - correct change, this disables autodetect and linking with libdebuginfod.so.1.
I will need to test this myself.
conditional dependency might be in store. I'll find some time to produce a patch early next week, as this weekend is unavailable to me ATM.
New fix planned.
Created attachment 244947 [details] Depend on devel/elfutils if found in $LOCALBASE. This patch will automatically register a library dependency on devel/elfutils if libdebuginfod.so is found in $LOCALBASE. Does this work for you?
(In reply to Cy Schubert from comment #15) I do not want devel/elfutils as dep port at all. It is strange way to solve issue.
Created attachment 244949 [details] GIve the user the option to depend on elfutils Added options. Select the ELFU_NO option after running make config. I will fully test in a jail on Monday.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ccc21de09381b5fc0e19980d69c0d1ee2bde84de commit ccc21de09381b5fc0e19980d69c0d1ee2bde84de Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2023-09-17 01:40:57 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2024-08-28 15:56:33 +0000 devel/binutils: Add devel/elfutils dependency options Currently binutils auto-discovers libdebuginfod.so existence in $LOCALBASE and if found, it will use it. This doesn't matter when building under poudriere because devel/elfutils is never pre-installed as a dependency. However users building binutils on systems with a pre-installed devel/elfutils will discover that binutils will auto-detect the existence of libdebuginfod.so and use it. This is not always desired. Therefore add an option so that users who build binuitls by hand can optionally force binutils not to detect or use libdebuginfod.so. On the flip side other users may want to depend on devel/elfutils and have the ports infrastructure preinstall it for them. The default option is to auto-detect and depend on devel/elfutils if found. PR: 273798 devel/binutils/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)