Bug 273798 - devel/binutils: binutils is missing a required shared library: libdebuginfod.so.1
Summary: devel/binutils: binutils is missing a required shared library: libdebuginfod....
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2023-09-14 20:43 UTC by Ivan Rozhuk
Modified: 2023-09-17 04:08 UTC (History)
2 users (show)

See Also:
cy: maintainer-feedback-


Attachments
patch (768 bytes, patch)
2023-09-15 21:30 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff
Depend on devel/elfutils if found in $LOCALBASE. (998 bytes, patch)
2023-09-17 01:48 UTC, Cy Schubert
no flags Details | Diff
GIve the user the option to depend on elfutils (2.62 KB, patch)
2023-09-17 04:08 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2023-09-14 20:43:21 UTC
binutils links with libdebuginfod.so.1 if devel/elfutils installed, but this is not reflected in deps list.
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2023-09-14 23:38:39 UTC
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.
Comment 2 Ivan Rozhuk 2023-09-14 23:43:51 UTC
This is not how it should work.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2023-09-15 15:18:35 UTC
(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?
Comment 4 Ivan Rozhuk 2023-09-15 19:15:54 UTC
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
Comment 5 Ivan Rozhuk 2023-09-15 21:29:47 UTC
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
...
Comment 6 Ivan Rozhuk 2023-09-15 21:30:11 UTC
Created attachment 244905 [details]
patch
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-09-16 02:01:15 UTC
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(+)
Comment 8 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 02:03:57 UTC
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.
Comment 9 Ivan Rozhuk 2023-09-16 04:07:22 UTC
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
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-09-16 13:38:45 UTC
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(-)
Comment 11 Ivan Rozhuk 2023-09-16 22:11:32 UTC
"--without-debuginfod" - correct change, this disables autodetect and linking with libdebuginfod.so.1.
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 22:53:15 UTC
I will need to test this myself.
Comment 13 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 22:55:24 UTC
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.
Comment 14 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 22:55:40 UTC
New fix planned.
Comment 15 Cy Schubert freebsd_committer freebsd_triage 2023-09-17 01:48:52 UTC
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?
Comment 16 Ivan Rozhuk 2023-09-17 03:07:00 UTC
(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.
Comment 17 Cy Schubert freebsd_committer freebsd_triage 2023-09-17 04:08:49 UTC
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.