final (Re: Kbuild change breaks the ppc64 build)

Oleg Verych
2007-02-08T13:37:24Z

Date: Feb 08, 2007 at 05:17:06AM -0800
From: David Miller

> From: Oleg Verych <olecom@flower.upol.cz>
> Date: Thu, 8 Feb 2007 13:47:56 +0100
>
[]
> > As i have refactored some CC checking code in Kbuild.include, it
> > turned, that some versions of `make' after calling nested functions,
> > add (or leave) prefix whitespace to result, thus ifeq[0] fails:
>
> That's not it, did you see my fix for this problem posted
> already?

Yes, i did. Thanks, David, for fix and for comprehencive approach.

Kudos to everyone, who was forced to deal with this cr@p. Sorry for my
confusion, that fast commit was a bit of stress.

> The issue is the leading spaces on the first line of the define for
> checker-shell. Those propagate into the callers, although they are
> reduced down to a single space.

Yes, defines leave spaces/tabs as is, it's known thing, but again,
sorry.

> This will give you spaces in the result on any version of
> make.
>
> Here is my fix again for your reference.
>
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index 8d7eabf..a1880e8 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -60,16 +60,15 @@ endef
> # Usage: option = $(call checker-shell,$(CC)...-o $$OUT,option-ok,otherwise)
> # Exit code chooses option. $$OUT is safe location for needless output.
> define checker-shell
> - $(strip
^
Roland had no space here in his patch ;)

> - $(shell set -e; \
> - DIR=$(KBUILD_EXTMOD); \
> - cd $${DIR:-$(objtree)}; \
> - OUT=$$PWD/.$$$$.null; \
> - if $(1) >/dev/null 2>&1; \
> - then echo "$(2)"; \
> - else echo "$(3)"; \
> - fi; \
> - rm -f $$OUT))
> +$(shell set -e; \
> + DIR=$(KBUILD_EXTMOD); \
> + cd $${DIR:-$(objtree)}; \
> + OUT=$$PWD/.$$$$.null; \
> + if $(1) >/dev/null 2>&1; \
> + then echo "$(2)"; \
> + else echo "$(3)"; \
> + fi; \
> + rm -f $$OUT)
> endef
>
> # as-option
>
>

Thanks!
____