public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kbuild@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	zippel@linux-m68k.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Better way to force a rebuild
Date: Wed, 10 Dec 2008 22:28:21 +0100	[thread overview]
Message-ID: <20081210212821.GA18348@uranus.ravnborg.org> (raw)
In-Reply-To: <20081210200242.GA15692@uranus.ravnborg.org>

On Wed, Dec 10, 2008 at 09:02:42PM +0100, Sam Ravnborg wrote:
> On Wed, Dec 10, 2008 at 02:48:35PM -0500, Steven Rostedt wrote:
> > 
> > Hi,
> > 
> > In include/linux/kernel.h I currently have the following lines at the 
> > bottom of the file:
> > 
> > /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
> > #ifdef CONFIG_FTRACE_MCOUNT_RECORD
> > # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
> > #endif
> > 
> > 
> > This is only there to force a rebuild of all files when 
> > CONFIG_FTRACE_MCOUNT_RECORD is modified. Since the modification of that 
> > config causes the build to act different, we need to rebuild all C 
> > objects. I added the #ifdef in kernel.h as a hack to force the rebuild by 
> > the config dependencies used in kbuild.
> > 
> > My question is, is there a better way to force a full rebuild on a 
> > modification of a config?
> 
> Why is that hack required in the first place?
> We rebuild if:
> - target file is missing (not the case here)
> - any prerequisite files are newer than target (not the case here)
> - any CONFIG_* options used by any prerequisite has changed (not the case here)
>   [It is due to your hack]
> - gcc changed (not the case here)
> - options are added/deleted to gcc (this should be the case for relevant files)
> 
> 
> Looking a bit deeper into this.
> I see that we have in Makefile.build:
> 
> define rule_cc_o_c
>         $(call echo-cmd,checksrc) $(cmd_checksrc)                         \
>         $(call echo-cmd,cc_o_c) $(cmd_cc_o_c);                            \
>         $(cmd_modversions)                                                \
>         $(cmd_record_mcount)   
> 
> So you want everyting to be rebuild if the command above changes.
> That should be doable - and it is indeed a bug that we do not do so.
> The integration of record_mcount needs to be improved.

I made the following quick hack.
I think it should do the trick.

	Sam

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 468fbc9..8b5bf43 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -215,7 +215,8 @@ define rule_cc_o_c
 	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
 	$(cmd_modversions)						  \
 	$(cmd_record_mcount)						  \
-	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
+	scripts/basic/fixdep $(depfile) $@                                \
+	'$(call make-cmd,cc_o_c) $(call make-cmd,record_mcount)' >        \
 	                                              $(dot-target).tmp;  \
 	rm -f $(depfile);						  \
 	mv -f $(dot-target).tmp $(dot-target).cmd

  parent reply	other threads:[~2008-12-10 21:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10 19:48 Better way to force a rebuild Steven Rostedt
2008-12-10 20:02 ` Sam Ravnborg
2008-12-10 20:10   ` Andrew Morton
2008-12-10 20:37     ` Sam Ravnborg
2008-12-10 20:44       ` Steven Rostedt
2008-12-10 20:19   ` Steven Rostedt
2008-12-10 20:26   ` Steven Rostedt
2008-12-10 20:27     ` Steven Rostedt
2008-12-10 20:39     ` Sam Ravnborg
2008-12-10 21:28   ` Sam Ravnborg [this message]
2008-12-13 23:16     ` Sam Ravnborg
2008-12-14 17:05       ` Steven Rostedt
2008-12-16 20:06         ` Steven Rostedt

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=20081210212821.GA18348@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=zippel@linux-m68k.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