Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686356 - QA check for respection of LDFLAGS reports misformatted false positives for *.o files with __gentoo_check_ldflags__ symbol
Summary: QA check for respection of LDFLAGS reports misformatted false positives for *...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 686768
  Show dependency tree
 
Reported: 2019-05-20 01:24 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-08-01 19:19 UTC (History)
1 user (show)

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


Attachments
flags_test-0.ebuild (flags_test-0.ebuild,900 bytes, text/plain)
2019-05-20 01:24 UTC, Arfrever Frehtes Taifersar Arahesis
Details
Patch (portage.patch,1.27 KB, patch)
2019-05-20 01:35 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2019-05-20 01:24:03 UTC
Created attachment 577338 [details]
flags_test-0.ebuild

QA check for respectation of LDFLAGS reports misformatted false positives for *.o files with __gentoo_check_ldflags__ symbol.
Usually this problem would be seen for *.o files created by linker with -r option when LDFLAGS is respected.


Output from attached ebuild:

"""
 * QA Notice: Files built without respecting CFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/bin/k
 * /usr/bin/l
 * /usr/lib64/g.so
 * /usr/lib64/h.so


 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /    usr/lib64/e.o
 * /    usr/lib64/f.o
 * /usr/lib64/g.so
 * /usr/lib64/h.so

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/lib64/a.o
   /usr/lib64/b.o
   /usr/lib64/c.o
   /usr/lib64/d.o
   /usr/lib64/e.o
   /usr/lib64/f.o
   /usr/lib64/g.so
   /usr/lib64/h.so
   /usr/lib64/i.so
   /usr/lib64/j.so
   /usr/bin/k
   /usr/bin/l
   /usr/bin/m
   /usr/bin/n
"""


Misformatting comes from usage of `comm` tool in bin/install-qa-check.d/10ignored-flags:

f=$(LC_ALL=C comm -3 <(scanelf -qyRF '#k%p' -k .dynsym "${ED%/}/" | LC_ALL=C sort) \
        <(scanelf -qyRF '#s%p' -s __gentoo_check_ldflags__ "${ED%/}/" | LC_ALL=C sort))


From `comm --help`:
"""
With no options, produce three-column output.  Column one contains
lines unique to FILE1, column two contains lines unique to FILE2,
and column three contains lines common to both files.

  -1              suppress column 1 (lines unique to FILE1)
  -2              suppress column 2 (lines unique to FILE2)
  -3              suppress column 3 (lines that appear in both files)
"""
Comment 1 Arfrever Frehtes Taifersar Arahesis 2019-05-20 01:29:29 UTC
Actually output from attached ebuild, after stripping __gentoo_check_ldflags__ from Scrt1.o (bug #686282):

"""
 * QA Notice: Files built without respecting CFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/bin/k
 * /usr/bin/l
 * /usr/lib64/g.so
 * /usr/lib64/h.so


 * QA Notice: Files built without respecting LDFLAGS have been detected
 *  Please include the following list of files in your report:
 * /usr/bin/k
 * /usr/bin/l
 * /    usr/lib64/e.o
 * /    usr/lib64/f.o
 * /usr/lib64/g.so
 * /usr/lib64/h.so

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/lib64/a.o
   /usr/lib64/b.o
   /usr/lib64/c.o
   /usr/lib64/d.o
   /usr/lib64/e.o
   /usr/lib64/f.o
   /usr/lib64/g.so
   /usr/lib64/h.so
   /usr/lib64/i.so
   /usr/lib64/j.so
   /usr/bin/k
   /usr/bin/l
   /usr/bin/m
   /usr/bin/n
"""
Comment 2 Arfrever Frehtes Taifersar Arahesis 2019-05-20 01:35:38 UTC
Created attachment 577340 [details, diff]
Patch
Comment 3 Larry the Git Cow gentoo-dev 2019-05-20 04:41:13 UTC
The bug has been referenced in the following commit(s):

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

commit bdde97ba14e85ea2ca6b128fddca710081334b55
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2019-05-20 01:32:25 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-05-20 04:36:32 +0000

    install-qa-check.d/10ignored-flags: fix false positive
    
    Do not report not respecting LDFLAGS for *.o files with
    __gentoo_check_ldflags__ symbol.
    
    Bug: https://bugs.gentoo.org/686356
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/install-qa-check.d/10ignored-flags | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Alexander Tsoy 2019-06-21 17:16:57 UTC
(In reply to Larry the Git Cow from comment #3)
This patch also fixes false positives for static binaries.