Skip to contentSkip to conversation

2.2.18pre18: many calls to kwhich

PATCH TenThumbs 2 participants 2 messages Nov 2, 2000 – Nov 4, 2000 Kbuild

lore
Share & tools
lore

TenThumbs

author
#0 lore raw

I noticed that kwhich is called a lot:

make oldconfig:        10
make dep:              65
make bzImage modules: 142

Assuming that this is unintentional, this patch helps a lot.

Makefile Tue Oct 31 11:39:11 2000 renamed from Makefile.orig Sun Oct 29 09:09:16 2000 +1 -1
@@ -28,7 +28,7 @@
 #      kgcc for Conectiva and Red Hat 7
 #      otherwise 'cc'
 #
-CC     =$(shell if [ -n "$(CROSS_COMPILE)" ]; then echo $(CROSS_COMPILE)gcc; else \
+CC     :=$(shell if [ -n "$(CROSS_COMPILE)" ]; then echo $(CROSS_COMPILE)gcc; else \
        $(CONFIG_SHELL) scripts/kwhich gcc272 2>/dev/null || $(CONFIG_SHELL) scripts/kwhich kgcc 2>/dev/null || echo cc; fi) \
        -D__KERNEL__ -I$(HPATH)
 CPP    =$(CC) -E

(If it gets wrapped, it's just "=" -> ":=").

It's also interesting that make dep calls kwhich an odd number of times including one case where it looked for "gcc." I suspect a makefile isn't playing nice but I haven't looked for it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw

[TenThumbs]

Quoted 5 lines

I noticed that kwhich is called a lot:

make oldconfig:        10
make dep:              65
make bzImage modules: 142

Yes indeed, I suggested the ':=' when kwhich first went in, for this reason. I suspect my mail was either ignored or overlooked.

That whole raft of variables uses '=' instead of ':=' and I've occasionally wondered if this was intentional. Possibly so, because arch/{mips,m68k}/Makefile both set CROSS_COMPILE, which wouldn't work if the toplevel used ':='.

I don't like it, though. I think the user should be assumed to either have a standard toolchain installed, in which case gcc and binutils should be in the path under standard names --- or the user should know enough to specify ARCH= and CROSS_COMPILE= on the compile line.

Alan: to avoid the 'CROSS_COMPILE defined too early' problem in the stable series, I suggest the following, which will at least prevent the kwhich script from being execed 200 times as reported.

Peter

Makefile renamed from Makefile~ +2 -2
@@ -28,8 +28,8 @@
 #	kgcc for Conectiva and Red Hat 7
 #	otherwise 'cc'
 #
-CC	=$(shell if [ -n "$(CROSS_COMPILE)" ]; then echo $(CROSS_COMPILE)gcc; else \
-	$(CONFIG_SHELL) scripts/kwhich gcc272 2>/dev/null || $(CONFIG_SHELL) scripts/kwhich kgcc 2>/dev/null || echo cc; fi) \
+FOUNDCC := $(shell $(CONFIG_SHELL) scripts/kwhich gcc272 kgcc cc 2>/dev/null)
+CC	=$(shell if [ -n "$(CROSS_COMPILE)" ]; then echo $(CROSS_COMPILE)gcc; else echo $(FOUNDCC); fi) \
 	-D__KERNEL__ -I$(HPATH)
 CPP	=$(CC) -E
 AR	=$(CROSS_COMPILE)ar

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/