public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] libgcc: Quote variable in Makefile.in
Date: Wed, 12 Oct 2022 12:52:52 +0100	[thread overview]
Message-ID: <20221012115252.1881060-1-jwakely@redhat.com> (raw)

This isn't very important as the error is harmless, but it's easy to fix
and so is one less thing that might confuse people when looking at build
logs.

OK for trunk?

-- >8 --

If the xgcc executable has not been built (or has been removed by 'make
clean') then the command to print the multilib dir fails, and so the
MULTIOSDIR variable is empty. That then causes:
/bin/sh: line 0: test: !=: unary operator expected

We can avoid it by quoting the variable.

libgcc/ChangeLog:

	* Makefile.in: Quote variable.
---
 libgcc/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 1fe708a93f7..6e2a0470944 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -310,7 +310,7 @@ CRTSTUFF_T_CFLAGS =
 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
 
-MULTIOSSUBDIR := $(shell if test $(MULTIOSDIR) != .; then echo /$(MULTIOSDIR); fi)
+MULTIOSSUBDIR := $(shell if test "$(MULTIOSDIR)" != .; then echo /$(MULTIOSDIR); fi)
 inst_libdir = $(libsubdir)$(MULTISUBDIR)
 inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
 
-- 
2.37.3


             reply	other threads:[~2022-10-12 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 11:52 Jonathan Wakely [this message]
2022-10-12 16:33 ` Jeff Law

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=20221012115252.1881060-1-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).