qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Weil <sw@weilnetz.de>, Mike Frysinger <vapier@gentoo.org>,
	QEMU Developer <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] configure: Use strings command from cross development tools
Date: Tue, 15 May 2018 10:00:47 -0500	[thread overview]
Message-ID: <e2b0f5a2-18df-79a2-7caa-45afdc09a172@redhat.com> (raw)
In-Reply-To: <20180513085032.27773-1-sw@weilnetz.de>

On 05/13/2018 03:50 AM, Stefan Weil wrote:
> This fixes cross builds for the (rare) case where cross binutils
> but no native binutils are installed.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>   configure | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 

> +strings="${STRINGS-${cross_prefix}strings}"
>   strip="${STRIP-${cross_prefix}strip}"

Hmm - we have pre-existing problems in our configure file.  More on that 
below...

>   windres="${WINDRES-${cross_prefix}windres}"
>   pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
> @@ -1956,9 +1957,9 @@ int main(int argc, char *argv[]) {
>   EOF
>   
>   if compile_object ; then
> -    if strings -a $TMPO | grep -q BiGeNdIaN ; then
> +    if "$strings" -a $TMPO | grep -q BiGeNdIaN ; then

I'd much prefer this to be:

if $strings -a $TMPO | grep...

That's because if I have something like this in my environment:

STRINGS='/path/to/strings -a'

it will only work if you allow word splitting on my variable.

...having said that, here's the pre-existing problem with user 
replacement tools that contain whitespace:

if test "$strip_opt" = "yes" ; then
   echo "STRIP=${strip}" >> $config_host_mak
fi

we are improperly quoting the whitespace when populating 
$config_host_mak, and therefore could end up attempting to execute the 
user's first argument as a standalone command, rather than the intended 
result of assigning a two-word command to a single variable.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  parent reply	other threads:[~2018-05-15 15:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-13  8:50 [Qemu-devel] [PATCH] configure: Use strings command from cross development tools Stefan Weil
2018-05-13 21:12 ` Philippe Mathieu-Daudé
2018-05-14 15:26 ` Richard Henderson
2018-05-15 15:00 ` Eric Blake [this message]
2018-05-15 15:04   ` Peter Maydell
2018-05-15 15:52     ` Eric Blake

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=e2b0f5a2-18df-79a2-7caa-45afdc09a172@redhat.com \
    --to=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    --cc=vapier@gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).