public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kbuild + Cross compiling
@ 2006-05-05  1:52 Dan Merillat
  2006-05-05  4:55 ` Sam Ravnborg
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Merillat @ 2006-05-05  1:52 UTC (permalink / raw)
  To: linux-kernel

I must be an idiot, but why does Kbuild rebuild every file when cross-compiling?
I'm not editing .config or touching any headers, I'm making tweaks to
a single .c driver,
and it is taking forever due to continual full-rebuilds.

building on i386 for ARCH=arm CROSS_COMPILE=arm-linux-uclibc-

I tried following the logic, but everything is a forced build using
if_changed and if_changed_dep, and I can't read GNU Make well enough
to figure out what it thinks is new.  I know make -d says all the
dependancies are up-to-date, so it's being forced some other way.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05  1:52 Kbuild + Cross compiling Dan Merillat
@ 2006-05-05  4:55 ` Sam Ravnborg
  2006-05-05  6:30   ` Dan Merillat
  2006-05-05  9:56 ` Ben Dooks
  2006-05-05 14:36 ` Martin Schwidefsky
  2 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2006-05-05  4:55 UTC (permalink / raw)
  To: Dan Merillat; +Cc: linux-kernel

On Thu, May 04, 2006 at 09:52:56PM -0400, Dan Merillat wrote:
> I must be an idiot, but why does Kbuild rebuild every file when 
> cross-compiling?
> I'm not editing .config or touching any headers, I'm making tweaks to
> a single .c driver,
> and it is taking forever due to continual full-rebuilds.
> 
> building on i386 for ARCH=arm CROSS_COMPILE=arm-linux-uclibc-
> 
> I tried following the logic, but everything is a forced build using
> if_changed and if_changed_dep, and I can't read GNU Make well enough
> to figure out what it thinks is new.  I know make -d says all the
> dependancies are up-to-date, so it's being forced some other way.
kbuild checks for any differences in the commandline alos - so a rebuild
happens if you change options to gcc (think -O2 => -Os).
If you experience that for example mm/slab.c is rebuild then try to
do the following:
cp mm/.slab.o.cmd foo
make mm/
diff -u foo mm/.slab.o.cmd

If diff detects any difference then you know why and need to find out
why there is a difference.

Btw. what make version and what kernel version are you compiling?
There was some inconsistency in kbuild that triggered with make 3.81-rc1
and which will trigger with make 3.82-cvs also.
This issue was only fixed lately - recall it was for 2.6.16

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05  4:55 ` Sam Ravnborg
@ 2006-05-05  6:30   ` Dan Merillat
  2006-05-05 15:15     ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Merillat @ 2006-05-05  6:30 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel

On 5/5/06, Sam Ravnborg <sam@ravnborg.org> wrote:
> kbuild checks for any differences in the commandline alos - so a rebuild
> happens if you change options to gcc (think -O2 => -Os).
> If you experience that for example mm/slab.c is rebuild then try to
> do the following:
> cp mm/.slab.o.cmd foo
> make mm/
> diff -u foo mm/.slab.o.cmd
>
> If diff detects any difference then you know why and need to find out
> why there is a difference.

Nothing, even md5sums match.
2abfcbee132335ba8e1da120569abf67  .do_mounts.o.cmd
2abfcbee132335ba8e1da120569abf67  .do_mounts.o.cmd.1

but it gets rebuilt every time.
>
> Btw. what make version and what kernel version are you compiling?
> There was some inconsistency in kbuild that triggered with make 3.81-rc1
> and which will trigger with make 3.82-cvs also.
> This issue was only fixed lately - recall it was for 2.6.16

2.6.15, but make 3.80.  Is that the same problem?

I havn't developed on i386 lately so I don't know if it's only a
cross-compile issue.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05  1:52 Kbuild + Cross compiling Dan Merillat
  2006-05-05  4:55 ` Sam Ravnborg
@ 2006-05-05  9:56 ` Ben Dooks
  2006-05-05 14:36 ` Martin Schwidefsky
  2 siblings, 0 replies; 8+ messages in thread
From: Ben Dooks @ 2006-05-05  9:56 UTC (permalink / raw)
  To: Dan Merillat; +Cc: linux-kernel

On Thu, May 04, 2006 at 09:52:56PM -0400, Dan Merillat wrote:
> I must be an idiot, but why does Kbuild rebuild every file when 
> cross-compiling?
> I'm not editing .config or touching any headers, I'm making tweaks to
> a single .c driver,
> and it is taking forever due to continual full-rebuilds.
> 
> building on i386 for ARCH=arm CROSS_COMPILE=arm-linux-uclibc-
> 
> I tried following the logic, but everything is a forced build using
> if_changed and if_changed_dep, and I can't read GNU Make well enough
> to figure out what it thinks is new.  I know make -d says all the
> dependancies are up-to-date, so it's being forced some other way.

I do not see the problem building ARM kernels using i386
so this is possibly specific to the setup, or something
you are doing, like changing compiler or compiler options.

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05  1:52 Kbuild + Cross compiling Dan Merillat
  2006-05-05  4:55 ` Sam Ravnborg
  2006-05-05  9:56 ` Ben Dooks
@ 2006-05-05 14:36 ` Martin Schwidefsky
  2006-05-05 20:53   ` Dan Merillat
  2 siblings, 1 reply; 8+ messages in thread
From: Martin Schwidefsky @ 2006-05-05 14:36 UTC (permalink / raw)
  To: Dan Merillat; +Cc: linux-kernel

On 5/5/06, Dan Merillat <harik.attar@gmail.com> wrote:
> I must be an idiot, but why does Kbuild rebuild every file when cross-compiling?
> I'm not editing .config or touching any headers, I'm making tweaks to
> a single .c driver,
> and it is taking forever due to continual full-rebuilds.

I had that problem a while ago. Turned out that the version of make I used on
my debian had a bug.

--
blue skies,
  Martin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05  6:30   ` Dan Merillat
@ 2006-05-05 15:15     ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2006-05-05 15:15 UTC (permalink / raw)
  To: Dan Merillat; +Cc: linux-kernel

On Fri, May 05, 2006 at 02:30:05AM -0400, Dan Merillat wrote:
> On 5/5/06, Sam Ravnborg <sam@ravnborg.org> wrote:
> >kbuild checks for any differences in the commandline alos - so a rebuild
> >happens if you change options to gcc (think -O2 => -Os).
> >If you experience that for example mm/slab.c is rebuild then try to
> >do the following:
> >cp mm/.slab.o.cmd foo
> >make mm/
> >diff -u foo mm/.slab.o.cmd
> >
> >If diff detects any difference then you know why and need to find out
> >why there is a difference.
> 
> Nothing, even md5sums match.
> 2abfcbee132335ba8e1da120569abf67  .do_mounts.o.cmd
> 2abfcbee132335ba8e1da120569abf67  .do_mounts.o.cmd.1
> 
> but it gets rebuilt every time.

So we need to dive a bit deeper to understand why everything gets
rebuild.
Try following patch:

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e48e60d..4c52131 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -189,6 +189,9 @@ endef
 # Built-in and composite module parts
 
 %.o: %.c FORCE
+	@echo $@
+	@echo chg=$?
+	@echo arg-check=$(call arg-check, $(cmd_cc_o_c), $(cmd_$@))
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 
This will not fix anything - but will give us a hint why things gets
rebuild.
After applying the patch try:
make init/do_mounts.o

And then post the output.
Also include the .do_mounts.o.cmd file

	Sam

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05 14:36 ` Martin Schwidefsky
@ 2006-05-05 20:53   ` Dan Merillat
  2006-05-05 21:18     ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Merillat @ 2006-05-05 20:53 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: linux-kernel

On 5/5/06, Martin Schwidefsky <schwidefsky@googlemail.com> wrote:
> On 5/5/06, Dan Merillat <harik.attar@gmail.com> wrote:
> > I must be an idiot, but why does Kbuild rebuild every file when cross-compiling?
> > I'm not editing .config or touching any headers, I'm making tweaks to
> > a single .c driver,
> > and it is taking forever due to continual full-rebuilds.
>
> I had that problem a while ago. Turned out that the version of make I used on
> my debian had a bug.

That was it.  debian make 3.80 was buggy.   Since make was a likely
culprit I upgraded it anyway, then I read this and it confirmed what I
found.

Thanks for the help, everyone.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Kbuild + Cross compiling
  2006-05-05 20:53   ` Dan Merillat
@ 2006-05-05 21:18     ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2006-05-05 21:18 UTC (permalink / raw)
  To: Dan Merillat; +Cc: Martin Schwidefsky, linux-kernel

On Fri, May 05, 2006 at 04:53:36PM -0400, Dan Merillat wrote:
> 
> That was it.  debian make 3.80 was buggy.   Since make was a likely
> culprit I upgraded it anyway, then I read this and it confirmed what I
> found.
If debian reports make 3.80-rc1 as 3.80 then either debian or make has a
problem.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-05-05 21:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-05  1:52 Kbuild + Cross compiling Dan Merillat
2006-05-05  4:55 ` Sam Ravnborg
2006-05-05  6:30   ` Dan Merillat
2006-05-05 15:15     ` Sam Ravnborg
2006-05-05  9:56 ` Ben Dooks
2006-05-05 14:36 ` Martin Schwidefsky
2006-05-05 20:53   ` Dan Merillat
2006-05-05 21:18     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox