Skip to contentSkip to conversation

checker-shell still hosed...

DISCUSSION David Miller 2 participants 5 messages Feb 8, 2007 Kbuild

lore
Share & tools
lore
#0 lore raw

Linus, things still fail for me even with the $(strip ...) construct you added works properly.

For some reason things like $(call cc-option-yn...) still fail.

My make version 3.81beta4 has the space problem, and with your change it just returns a space. :-) Without your change it gives the problematic " y" string.

A running theory of mine is that it's a "$(call)" within a $(call) which generates the space. So I wrote a little make.test:

define test1
$(shell echo "str1")
endef

define test2
$(call test1)
endef

FOO := A$(call test2)B

all:

	echo A$(FOO)B

If I run "make -f make.test" I get:

davem@sunset:~/src/GIT/net-2.6$ make -f make.test
echo AA    str1BB
AA str1BB
davem@sunset:~/src/GIT/net-2.6$

Hmmm... but I just checked on a proper "GNU Make 3.81" and that prints the space in the example above too.

Weird...

#1 lore raw

From: David Miller <[email protected]>
Date: Thu, 08 Feb 2007 03:05:31 -0800 (PST)

Quoted 7 lines

define test1
$(shell echo "str1")
endef

define test2
$(call test1)
endef

Someone just privately explained that my test case is broken because of the spaces before the "$(shell " in the defines. Removing them makes the spaces go away.

#2 lore raw

From: David Miller <[email protected]>
Date: Thu, 08 Feb 2007 04:10:04 -0800 (PST)

Quoted 1 line

Removing them makes the spaces go away.

FWIW, this patch below seems to fix the sparc64 build for me.

Paul, does it work for you on powerpc too?

scripts/Kbuild.include +9 -10
index 8d7eabf..a1880e8 100644
@@ -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
-  $(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
#3 lore raw
Quoted 8 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 08 Feb 2007 04:10:04 -0800 (PST)

Quoted 1 line

Removing them makes the spaces go away.

FWIW, this patch below seems to fix the sparc64 build for me.

Paul, does it work for you on powerpc too?

Thx, it seems to build now. I'll tell you whether it boots on PS3 soon.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

#4 lore raw
Quoted 11 lines · Geert Uytterhoeven
Quoted 8 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 08 Feb 2007 04:10:04 -0800 (PST)

Quoted 1 line

Removing them makes the spaces go away.

FWIW, this patch below seems to fix the sparc64 build for me.

Paul, does it work for you on powerpc too?

Thx, it seems to build now. I'll tell you whether it boots on PS3 soon.

Build and boot were successful.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium