]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgcc: Quote variable in Makefile.in
authorJonathan Wakely <jwakely@redhat.com>
Wed, 12 Oct 2022 11:35:00 +0000 (12:35 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 18 Oct 2022 11:09:53 +0000 (12:09 +0100)
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

index 1fe708a93f7316c557db2b9fc5952a92cf8040fa..6e2a0470944f3a100de69ae45b233a33efa8a331 100644 (file)
@@ -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)