public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgcc: Quote variable in Makefile.in
@ 2022-10-12 11:52 Jonathan Wakely
  2022-10-12 16:33 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2022-10-12 11:52 UTC (permalink / raw)
  To: gcc-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libgcc: Quote variable in Makefile.in
  2022-10-12 11:52 [PATCH] libgcc: Quote variable in Makefile.in Jonathan Wakely
@ 2022-10-12 16:33 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2022-10-12 16:33 UTC (permalink / raw)
  To: gcc-patches


On 10/12/22 05:52, Jonathan Wakely via Gcc-patches wrote:
> 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.

OK

jeff



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-12 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 11:52 [PATCH] libgcc: Quote variable in Makefile.in Jonathan Wakely
2022-10-12 16:33 ` Jeff Law

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).