[Top] [All Lists]

[PATCH] mips: fix the build with C=1

Subject: [PATCH] mips: fix the build with C=1
From: Aaro Koskinen <>
Date: Thu, 20 Oct 2011 01:33:27 +0300
When trying to compile the 3.1-rc10 kernel for my MIPS board with C=1
(sparse checking), the build fails early with the error:

          CHK     include/linux/version.h
          UPD     include/linux/version.h
          CHK     include/generated/utsrelease.h
          UPD     include/generated/utsrelease.h
          Checking missing-syscalls for N32
          CALL    scripts/
          Checking missing-syscalls for O32
          CALL    scripts/
          CC      kernel/bounds.s
          GEN     include/generated/bounds.h
          CC      arch/mips/kernel/asm-offsets.s
          GEN     include/generated/asm-offsets.h
          CALL    scripts/
          HOSTCC  scripts/genksyms/genksyms.o
          SHIPPED scripts/genksyms/lex.lex.c
          SHIPPED scripts/genksyms/keywords.hash.c
          SHIPPED scripts/genksyms/
          HOSTCC  scripts/genksyms/lex.lex.o
          SHIPPED scripts/genksyms/
          HOSTCC  scripts/genksyms/
          HOSTLD  scripts/genksyms/genksyms
        /bin/sh: Syntax error: "(" unexpected
        make[3]: *** [scripts/mod/empty.o] Error 2
        make[2]: *** [scripts/mod] Error 2
        make[1]: *** [scripts] Error 2

It seems the shell chokes because sparse is called with command line
arguments such as:


Converting these to form:


seems to fix the problem.

Signed-off-by: Aaro Koskinen <>
 arch/mips/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 53e3514..30346b0 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -226,7 +226,7 @@ LDFLAGS                     += -m $(ld-emul)
 CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -xc /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/$$/'/")
 ifdef CONFIG_64BIT
 CHECKFLAGS             += -m64

<Prev in Thread] Current Thread [Next in Thread>