Re: kbuild: Implicit dependence on the C compiler

From: Sam Ravnborg
Date: Mon Jan 17 2005 - 17:59:41 EST


On Mon, Jan 17, 2005 at 09:40:55PM +0000, H. Peter Anvin wrote:
> Okay, this is driving me utterly crazy...
>
> How the heck do I get kbuild to *not* think that because I'm using a
> different C compiler (including "gcc" versus "distcc"), or I'm on a
> different host, that it has to rebuild every single object file in my
> directory? This is an unbelievable headache.

It better be difficult. You want to recompile when changing gcc.
Try this untested patch.

There is no way to tell kbuild "ignore gcc change"

Sam


===== Makefile.lib 1.27 vs edited =====
--- 1.27/scripts/Makefile.lib 2004-10-27 00:06:46 +02:00
+++ edited/Makefile.lib 2005-01-17 22:58:44 +01:00
@@ -187,9 +187,7 @@
# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars

-if_changed = $(if $(strip $? \
- $(filter-out $(cmd_$(1)),$(cmd_$@))\
- $(filter-out $(cmd_$@),$(cmd_$(1)))),\
+if_changed = \
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(cmd_$(1)); \
@@ -199,9 +197,7 @@
# execute the command and also postprocess generated .d dependencies
# file

-if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
- $(filter-out $(cmd_$(1)),$(cmd_$@))\
- $(filter-out $(cmd_$@),$(cmd_$(1)))),\
+if_changed_dep = \
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \
$(cmd_$(1)); \
@@ -213,9 +209,7 @@
# will check if $(cmd_foo) changed, or any of the prequisites changed,
# and if so will execute $(rule_foo)

-if_changed_rule = $(if $(strip $? \
- $(filter-out $(cmd_$(1)),$(cmd_$@))\
- $(filter-out $(cmd_$@),$(cmd_$(1)))),\
+if_changed_rule = \
@set -e; \
$(rule_$(1)))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/