All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: rebuilding object files from asm files
Date: Wed, 20 Feb 2008 20:16:02 +0100	[thread overview]
Message-ID: <20080220191602.GA21139@uranus.ravnborg.org> (raw)
In-Reply-To: <200802201912.00091.ak@suse.de>

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

  reply	other threads:[~2008-02-20 19:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 18:12 rebuilding object files from asm files Andi Kleen
2008-02-20 19:16 ` Sam Ravnborg [this message]
2008-02-20 19:51   ` Andi Kleen
2008-02-20 20:01     ` Sam Ravnborg

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=20080220191602.GA21139@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=ak@suse.de \
    --cc=linux-kbuild@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.