linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rebuilding object files from asm files
@ 2008-02-20 18:12 Andi Kleen
  2008-02-20 19:16 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2008-02-20 18:12 UTC (permalink / raw)
  To: sam; +Cc: linux-kbuild


Here's a small kbuild quirk I noticed on 2.6.25rc2. I tried to rebuild
the obj file of a assembler file (.S) with make path/to/file.o.

Normally when I do this for .o file only its dependencies and 
and the object file are built as I expect.

But with an assembler file (like arch/x86/kernel/head_64.o) kbuild
starts to rebuild everything. 

-Andi


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

* Re: rebuilding object files from asm files
  2008-02-20 18:12 rebuilding object files from asm files Andi Kleen
@ 2008-02-20 19:16 ` Sam Ravnborg
  2008-02-20 19:51   ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2008-02-20 19:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kbuild

Hi Andi.

On Wed, Feb 20, 2008 at 07:12:00PM +0100, Andi Kleen wrote:
> 
> Here's a small kbuild quirk I noticed on 2.6.25rc2. I tried to rebuild
> the obj file of a assembler file (.S) with make path/to/file.o.
> 
> Normally when I do this for .o file only its dependencies and 
> and the object file are built as I expect.
> 
> But with an assembler file (like arch/x86/kernel/head_64.o) kbuild
> starts to rebuild everything. 

Took a look at this.
You will notice that there is a difference in the behaviour
betweet arch/x86/kernel/entry_64.o and head_64.o from same dir.
For entry_64.o it works as expected.

The 'problem' is that kbuild when deciding to use the rule:
%.o: %.S prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)

Already have done most of the work and mainly is has defined
the dependencies for vmlinux.
As head_64.o is listed in $(head-y) kbuild do as
told in following rule:

Note: vmlinux-init is equal to $(head-y) + $(init-y)

# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;

So building head_64.o requires a visit of all directories listed
in vmlinux-dirs before it can build head_64.o.

I do not see any clean way to fix this :-(

	Sam

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

* Re: rebuilding object files from asm files
  2008-02-20 19:16 ` Sam Ravnborg
@ 2008-02-20 19:51   ` Andi Kleen
  2008-02-20 20:01     ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2008-02-20 19:51 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild


> So building head_64.o requires a visit of all directories listed
> in vmlinux-dirs before it can build head_64.o.
> 
> I do not see any clean way to fix this :-(

I see. Thanks for the investigation. If it only affects head_64.S
I guess it is not so bad.

-Andi

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

* Re: rebuilding object files from asm files
  2008-02-20 19:51   ` Andi Kleen
@ 2008-02-20 20:01     ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2008-02-20 20:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kbuild

On Wed, Feb 20, 2008 at 08:51:24PM +0100, Andi Kleen wrote:
> 
> > So building head_64.o requires a visit of all directories listed
> > in vmlinux-dirs before it can build head_64.o.
> > 
> > I do not see any clean way to fix this :-(
> 
> I see. Thanks for the investigation. If it only affects head_64.S
> I guess it is not so bad.

All of:
head-y                := arch/x86/kernel/head_$(BITS).o
head-$(CONFIG_X86_64) += arch/x86/kernel/head64.o
head-y                += arch/x86/kernel/init_task.o

But thats limited anyway.

	Sam

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

end of thread, other threads:[~2008-02-20 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 18:12 rebuilding object files from asm files Andi Kleen
2008-02-20 19:16 ` Sam Ravnborg
2008-02-20 19:51   ` Andi Kleen
2008-02-20 20:01     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).