From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <pmaydell@chiark.greenend.org.uk>, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/2] configure: Make AVX2 test robust to non-ELF systems
Date: Sun, 19 Jun 2016 07:53:21 +0200 [thread overview]
Message-ID: <57663351.50802@weilnetz.de> (raw)
In-Reply-To: <1466287502-18730-3-git-send-email-pmaydell@chiark.greenend.org.uk>
Am 19.06.2016 um 00:05 schrieb Peter Maydell:
> From: Peter Maydell <peter.maydell@linaro.org>
>
> The AVX2 optimization test assumes that the object format
> is ELF and the system has the readelf utility. If this isn't
> true then configure might fail or emit a warning (since in
> a pipe "foo | bar >/dev/null 2>&1" does not redirect the
> stderr of foo, only of bar). Adjust the check so that if
> we don't have readelf or don't have an ELF object then we
> just don't enable the AVX2 optimization.
>
> Reported-by: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> configure | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 7beefcd..30bca55 100755
> --- a/configure
> +++ b/configure
> @@ -1792,8 +1792,10 @@ int foo(void *a) __attribute__((ifunc("bar_ifunc")));
> int main(int argc, char *argv[]) { return foo(argv[0]);}
> EOF
> if compile_object "" ; then
> - if readelf --syms $TMPO |grep "IFUNC.*foo" >/dev/null 2>&1; then
> - avx2_opt="yes"
> + if has readelf; then
> + if readelf --syms $TMPO 2>/dev/null |grep -q "IFUNC.*foo"; then
> + avx2_opt="yes"
> + fi
> fi
> fi
>
>
You could check "has readelf" earlier and avoid the compile test
if there is no readelf (saves a little time).
The final I/O redirection is still needed (otherwise Linux users will
see the grep output).
Regards
Stefan
next prev parent reply other threads:[~2016-06-19 5:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 22:05 [Qemu-devel] [PATCH 0/2] configure: Avoid warnings on OSX Peter Maydell
2016-06-18 22:05 ` [Qemu-devel] [PATCH 1/2] configure: Improve usermode relocation linker option probe Peter Maydell
2016-06-19 5:47 ` Stefan Weil
2016-06-18 22:05 ` [Qemu-devel] [PATCH 2/2] configure: Make AVX2 test robust to non-ELF systems Peter Maydell
2016-06-19 5:53 ` Stefan Weil [this message]
2016-06-19 9:41 ` Peter Maydell
2016-06-19 11:19 ` Stefan Weil
2016-06-28 15:07 ` [Qemu-devel] [PATCH 0/2] configure: Avoid warnings on OSX Peter Maydell
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=57663351.50802@weilnetz.de \
--to=sw@weilnetz.de \
--cc=patches@linaro.org \
--cc=pmaydell@chiark.greenend.org.uk \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.