Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] install-qa-check.d/10ignored-flags: fix LDFLAGS check (bug 455232)
Date: Mon, 16 Oct 2017 15:04:43
Message-Id: 20171016080441.7a30756b@professor-x
In Reply to: [gentoo-portage-dev] [PATCH] install-qa-check.d/10ignored-flags: fix LDFLAGS check (bug 455232) by Zac Medico
1 On Sun, 15 Oct 2017 20:59:55 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > From: Felix Janda <felix.janda@××××××.de>
5 >
6 > Since binutils-2.23.51.0.9+ defaults to hash-style=gnu, use
7 > a __gentoo_check_ldflags__ symbol instead. The check is now
8 > enabled by adding "-Wl,--defsym=__gentoo_check_ldflags__=0"
9 > to LDFLAGS. The symbol will be automatically removed when
10 > the binary is stripped.
11 >
12 > Bug: https://bugs.gentoo.org/455232
13 > Closes: https://github.com/gentoo/portage/pull/220
14 > ---
15 > bin/install-qa-check.d/10ignored-flags | 5 +++--
16 > 1 file changed, 3 insertions(+), 2 deletions(-)
17 >
18 > diff --git a/bin/install-qa-check.d/10ignored-flags
19 > b/bin/install-qa-check.d/10ignored-flags index 7aa9eb695..28aec6787
20 > 100644 --- a/bin/install-qa-check.d/10ignored-flags
21 > +++ b/bin/install-qa-check.d/10ignored-flags
22 > @@ -64,9 +64,10 @@ ignored_flag_check() {
23 > fi
24 >
25 > # Check for files built without respecting LDFLAGS
26 > - if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \
27 > + if [[ "${LDFLAGS}" == *,--defsym=__gentoo_check_ldflags__*
28 > ]] && \ ! has binchecks ${RESTRICT} ; then
29 > - f=$(scanelf -qyRF '#k%p' -k .hash "${ED}")
30 > + f=$(LC_ALL=C comm -3 <(scanelf -qyRF '#k%p'
31 > -k .dynsym "${ED}" | LC_ALL=C sort) \
32 > + <(scanelf -qyRF '#s%p' -s
33 > __gentoo_check_ldflags__ "${ED}" | LC_ALL=C sort)) if [[ -n ${f} ]] ;
34 > then echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log
35 > if [ "${QA_STRICT_FLAGS_IGNORED-unset}" =
36 > unset ] ; then
37
38
39 looks good
40
41 --
42 Brian Dolbec <dolsen>