mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH] kbuild: work around distcc/icecc madness
Date: Thu, 19 Mar 2009 22:02:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0903192121300.29264@localhost.localdomain> (raw)

Impact: workaround for distcc/icecc

Peter and I noticed that distcc and icecc based kernel compiles
started to show random full kernel rebuilds even when nothing or just
a .c file changed. The reason is "change of the command line" which
caused scripts/mod/empty.o to rebuild and due to the dependencies the
complete kernel tree. I never change the command line simply because I
use a script for my builds.

The root cause for this problem is the check for the CFI support in
x86 binutils. The call is generated via:

    echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -

This works fine as long as a local gcc is used or distcc/icecc use the
local machine. When distcc/icecc offload the compile to a remote
machine the compile fails with the following error message:
   gcc: : No such file or directory

Now we get command lines with -DCONFIG_CFI* and without every other
compile which causes the full rebuilds.

Digging trough the distcc/icecc code it seems that the stdin input for
remote compiles is not handled correctly. Indeed there is some strange
comment about this, but unfortunately no decision to compile it
local. :(

distcc and icecc are used by many developers and we can not fix the
versions which are out there in the wild, but we can avoid the stdin
based call easily: echo the asm code into the temp file which is used
for the output and use it as input file for the compiler.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 scripts/Kbuild.include |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6-tip/scripts/Kbuild.include
===================================================================
--- linux-2.6-tip.orig/scripts/Kbuild.include
+++ linux-2.6-tip/scripts/Kbuild.include
@@ -98,8 +98,9 @@ as-option = $(call try-run,\
 # as-instr
 # Usage: cflags-y += $(call as-instr,instr,option1,option2)
 
-as-instr = $(call try-run,\
-	echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
+as-instr = $(call try-run,		\
+	echo -e "$(1)" > "$$TMP"; 	\
+	$(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" "$$TMP",$(2),$(3))
 
 # cc-option
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)

             reply	other threads:[~2009-03-19 21:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 21:02 Thomas Gleixner [this message]
2009-03-20  9:22 ` Ingo Molnar
2009-03-20 10:31   ` Thomas Gleixner
2009-03-20 18:59     ` Ingo Molnar
2009-03-20 19:31       ` Thomas Gleixner
2009-03-20 19:33         ` Ingo Molnar
2009-03-20 20:41           ` Thomas Gleixner
2009-03-21 14:18             ` Ingo Molnar
2009-04-02 21:33               ` Thomas Gleixner
2009-04-08 16:13                 ` Ingo Molnar
2009-04-08 16:59                   ` Ingo Molnar
2009-03-20 12:23 ` Peter Zijlstra
2009-03-20 16:00   ` Thomas Gleixner
2009-03-20 19:16     ` Peter Zijlstra
2009-03-20 21:57       ` Thomas Gleixner
2009-04-02 23:56         ` Johannes Weiner
2009-04-03  0:39           ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0903192121300.29264@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®