Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721336 - sys-apps/portage: use scanelf -B, --nobanner instead of -q, --quiet
Summary: sys-apps/portage: use scanelf -B, --nobanner instead of -q, --quiet
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 715162 721152
  Show dependency tree
 
Reported: 2020-05-06 23:04 UTC by Zac Medico
Modified: 2020-07-22 16:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2020-05-06 23:04:51 UTC
The pax-utils code is full of odd cases related to the -q, --quiet flag. Within the context of bug 711244, we've found an unexpected interaction with musl's /usr/lib/libc.so that's triggered by the -q, --quiet flag.

Therefore, it's probably best to use -B, --nobanner instead of -q, --quiet.
Comment 1 Zac Medico gentoo-dev 2020-05-09 21:48:31 UTC
The scanelf -q call actually behaves as intended. It doesn't output anything for musl's /usr/lib/libc.so because the file has no DT_NEEDED or DT_SONAME settings.

For the particular scanelf command that's used to generate NEEDED.ELF.2, we can safely omit the scanelf -q option as long as we account for the fact the this will cause the scanelf_file_rpath function to output "  -  " when there are no DT_NEEDED settings.
Comment 3 Larry the Git Cow gentoo-dev 2020-05-24 22:18:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0bd5b693ef12c266000aafeb9557c1437fdfc1b2

commit 0bd5b693ef12c266000aafeb9557c1437fdfc1b2
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-05-09 22:07:17 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-05-24 22:15:24 +0000

    NeededEntry: don't use scanelf -q (bug 721336)
    
    We don't use scanelf -q, since that would omit libraries like
    musl's /usr/lib/libc.so which do not have any DT_NEEDED or
    DT_SONAME settings. Since we don't use scanelf -q, we have to
    handle the special rpath value "  -  ".
    
    Bug: https://bugs.gentoo.org/721336
    Fixes: 25fbe7bc1a92 ("NeededEntry: infer implicit soname from file basename (bug 715162)")
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/misc-functions.sh                       | 6 +++++-
 lib/portage/util/_dyn_libs/LinkageMapELF.py | 5 ++++-
 lib/portage/util/_dyn_libs/NeededEntry.py   | 5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)