From: Aaro Koskinen <aaro.koskinen@iki.fi>
Date: Mon, 11 May 2015 20:37:05 +0000 (+0300)
Subject: MIPS: Fix wrong CHECKFLAGS (sparse builds) with GCC 5.1
X-Git-Tag: v4.1-rc4~11^2~5
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=73d8f99ce42c7da97822faed6aa14578a708b19d;p=users%2Fjedix%2Flinux-maple.git

MIPS: Fix wrong CHECKFLAGS (sparse builds) with GCC 5.1

GCC 5.1 defines __REGISTER_PREFIX__ to $. This will break sparse
command line (and build fails with: /bin/sh: syntax error:
unexpected "(") since make tries to expand starting with the dollar
sign with a make variable. Prevent that by using double dollar sign.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10025/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 5200f649dd4e3..ae2dd59050f74 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -277,7 +277,7 @@ LDFLAGS			+= -m $(ld-emul)
 ifdef CONFIG_MIPS
 CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
 	egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
-	sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/")
+	sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
 ifdef CONFIG_64BIT
 CHECKFLAGS		+= -m64
 endif