Some packages install shared libraries, which contain only some data and do not use any symbols from any other libraries. QA check in Portage (bin/misc-functions.sh:install_qa_check) should not detect such libraries. I think that the solution might be to try to link a simple executable (e.g. "int main(int argc, char** argv){}") with any library detected with current algorithm and report QA notice only for libraries, with whom linking fails.
Actually parsing 'nm -D' should be easier. If 'nm -D ${library} | grep -E "^ +U "' is empty, then given library should not be reported.
*** Bug 685364 has been marked as a duplicate of this bug. ***
Created attachment 575624 [details, diff] Patch
Created attachment 575626 [details, diff] Patch (Fix for "nm: '': No such file")
Created attachment 575628 [details, diff] Patch
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #5) > Created attachment 575628 [details, diff] [details, diff] > Patch Looks good, except I suppose we should use ${CHOST}-nm if found, like we do for other binutils programs inside bin/estrip.
Created attachment 577342 [details, diff] Patch
Created attachment 577344 [details] DT_NEEDED_libraries_test-0.ebuild Ebuild allowing easy testing. Libraries with even numbers have no NEEDED entries. """ * QA Notice: The following shared libraries lack NEEDED entries * /usr/lib64/libtest04.so * /usr/lib64/libtest06.so """ libtest02.so might seem like it should also be reported, but apparently call to printf() is optimized away by compiler...
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=e54bc64a3779d4546b70a7a82d677a18d3c37b67 commit e54bc64a3779d4546b70a7a82d677a18d3c37b67 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> AuthorDate: 2019-05-10 01:20:14 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-05-20 04:53:48 +0000 install-qa-check.d/80libraries: fix false positive Do not report libraries missing DT_NEEDED and not containing undefined non-weak symbols. Bug: https://bugs.gentoo.org/516016 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Zac Medico <zmedico@gentoo.org> bin/install-qa-check.d/80libraries | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)