2003-09-15 23:05:57

by Adam J. Richter

[permalink] [raw]
Subject: linux-2.6.0-test5/drivers/eisa verbose build failure

linux-2.6.0-test5/drivers/eisa fails to build if KBUILD_VERBOSE=1
in the top level Linux Makefile (KBUILD_VERBOSE=1 causes the build
process to show the actual commands that are being executed).

linux-2.6.0-test5/drivers/eisa/Makefile contains a change
that tries to use the Linux KBUILD_VERBOSE system to control
echoing of a command that contains some single quotes. It looks
like scripts/Makefile.lib contains some macros designed to put
backslashes in front of single quotes as necessary to handle this
case, but, somehow, this is not happening. The build process attempts
to execute an echo command without the single quotes escaped, and the
result is a shell syntax error:

make -f scripts/Makefile.build obj=drivers/eisa
/bin/sh: -c: line 1: syntax error near unexpected token `("'
/bin/sh: -c: line 1: `echo ' sed -e '/^#/D' -e 's/^\([[:alnum:]]\{7\}\) \+"\([^"]\{1,49\}\).*"/EISA_DEVINFO ("\1", "\2"),/' drivers/eisa/eisa.ids > drivers/eisa/devlist.h' && sed -e '/^#/D' -e 's/^\([[:alnum:]]\{7\}\) \+"\([^"]\{1,49\}\).*"/EISA_DEVINFO ("\1", "\2"),/' drivers/eisa/eisa.ids > drivers/eisa/devlist.h'
make[2]: *** [drivers/eisa/devlist.h] Error 2
make[1]: *** [drivers/eisa] Error 2
make: *** [drivers] Error 2

I'm not sure if this is a bug in drivers/eisa/Makefile or
some part of kbuild (probably something in scripts/Makefile.lib).
I do not see any changes in linux-2.6.0-test5-bk3 that look like
they would fix the problem, although I have yet to try it.

Adam J. Richter __ ______________ 575 Oroville Road
[email protected] \ / Milpitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America


2003-09-20 11:29:16

by Sam Ravnborg

[permalink] [raw]
Subject: Re: linux-2.6.0-test5/drivers/eisa verbose build failure

On Mon, Sep 15, 2003 at 03:31:51PM -0700, Adam J. Richter wrote:
> linux-2.6.0-test5/drivers/eisa fails to build if KBUILD_VERBOSE=1
> in the top level Linux Makefile (KBUILD_VERBOSE=1 causes the build
> process to show the actual commands that are being executed).
>
> linux-2.6.0-test5/drivers/eisa/Makefile contains a change
> that tries to use the Linux KBUILD_VERBOSE system to control
> echoing of a command that contains some single quotes. It looks
> like scripts/Makefile.lib contains some macros designed to put
> backslashes in front of single quotes as necessary to handle this
> case, but, somehow, this is not happening.

Good analysis, thanks.
The following patch fixes it for me.
Would you mind trying this and report back.

Sam

===== scripts/Makefile.lib 1.20 vs edited =====
--- 1.20/scripts/Makefile.lib Sun Jun 8 20:06:56 2003
+++ edited/scripts/Makefile.lib Sat Sep 20 09:11:28 2003
@@ -225,7 +225,7 @@

# If quiet is set, only print short version of command

-cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
+cmd = @$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))

# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>

2003-09-21 02:54:53

by Adam J. Richter

[permalink] [raw]
Subject: Re: linux-2.6.0-test5/drivers/eisa verbose build failure

On Sat, 20 Sep 2003 13:29:12 +0200, Sam Ravnborg:
[...]
>The following patch fixes it for me.
>Would you mind trying this and report back.

> Sam

>===== scripts/Makefile.lib 1.20 vs edited =====
>--- 1.20/scripts/Makefile.lib Sun Jun 8 20:06:56 2003
>+++ edited/scripts/Makefile.lib Sat Sep 20 09:11:28 2003
>@@ -225,7 +225,7 @@
>
> # If quiet is set, only print short version of command
>
>-cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
>+cmd = @$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))
>
> # $(call descend,<dir>,<target>)
> # Recursively call a sub-make in <dir> with target <target>

Thank you for the patch. It seems to fix the problem for me.

Adam J. Richter __ ______________ 575 Oroville Road
[email protected] \ / Milpitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America