From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Romain Naour <romain.naour@gmail.com>,
Buildroot List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH] support/scripts/check-host-rpath: send readelf error output to oblivion
Date: Wed, 27 Jul 2022 18:40:57 +0200 [thread overview]
Message-ID: <20220727164057.GG1134587@scaer> (raw)
In-Reply-To: <20220727104751.2505442-1-thomas.petazzoni@bootlin.com>
Thomas, All,
On 2022-07-27 12:47 +0200, Thomas Petazzoni via buildroot spake thusly:
> Somewhere between binutils 2.35 and 2.37, some functionality was
> added in readelf to parse more DWARF information. Unfortunately, as
> reported in binutils bug
> 28981 ("https://sourceware.org/bugzilla/show_bug.cgi?id=28981"), this
> feature causes a number of fairly scary warnings to be displayed when
> running readelf on binaries built with Clang, such as the pre-built
> rustc and rustdoc binaries part of the host-rust-bin package. It
> looks like this:
>
> readelf: /home/thomas/projets/buildroot/output/host/bin/rustc: Warning: Unrecognized form: 0x23
[--SNIP we got the idea, thanks--]
> These warnings are caused by the readelf calls done by the
> support/scripts/check-host-rpath script. The annoying thing is that
> once host-rust-bin has been installed in $(HOST_DIR), this warning
> appears after the installation of every single host package, because
> support/scripts/check-host-rpath rescans all binaries every time.
>
> To avoid showing those scary warnings, this commit sends the error
> output of readelf to /dev/null.
>
> Of course, it would be nicer to only filter out those warnings, but
> filtering the error output without merging the error output into the
> standard output is tricky, so let's keep things simple. If there is
> really an error, readelf will abort.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> support/scripts/check-host-rpath | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/support/scripts/check-host-rpath b/support/scripts/check-host-rpath
> index b27cb883f3..f36677cc96 100755
> --- a/support/scripts/check-host-rpath
> +++ b/support/scripts/check-host-rpath
> @@ -61,7 +61,7 @@ elf_needs_rpath() {
>
> while read lib; do
> [ -e "${hostdir}/lib/${lib}" ] && return 0
> - done < <( readelf -d "${file}" \
> + done < <( readelf -d "${file}" 2>/dev/null \
> |sed -r -e '/^.* \(NEEDED\) .*Shared library: \[(.+)\]$/!d;' \
> -e 's//\1/;' \
> )
> @@ -100,7 +100,7 @@ check_elf_has_rpath() {
> # false.
> [[ ${dir} =~ "${perpackagedir}/"[^/]+/host/lib ]] && return 0
> done
> - done < <( readelf -d "${file}" \
> + done < <( readelf -d "${file}" 2>/dev/null \
> |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \
> -e 's//\3/;' \
> )
> --
> 2.37.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-07-27 16:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 10:47 [Buildroot] [PATCH] support/scripts/check-host-rpath: send readelf error output to oblivion Thomas Petazzoni via buildroot
2022-07-27 16:40 ` Yann E. MORIN [this message]
2022-07-27 17:42 ` Thomas Petazzoni via buildroot
2022-07-30 16:31 ` Yann E. MORIN
2022-08-30 22:30 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220727164057.GG1134587@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox