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 <s...@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

Reply via email to