All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Horst von Brand <vonbrand@inf.utfsm.cl>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: kbuild: Simplify vmlinux generation
Date: Mon, 6 Sep 2004 21:12:35 +0200	[thread overview]
Message-ID: <20040906191235.GC8230@mars.ravnborg.org> (raw)
In-Reply-To: <200409061841.i86Ifdnj008952@laptop11.inf.utfsm.cl>

On Mon, Sep 06, 2004 at 02:41:39PM -0400, Horst von Brand wrote:
> Sam Ravnborg <sam@ravnborg.org> said:
> 
> [...]
> 
> Some comments interspersed.


To address the lock-up issue Andrew hit I dropped the built-in.o intermidiate
step.
Will be pushed out if I receive a success report.

	Sam
	
Following patch apply on top of the last posted:

===== Makefile 1.531 vs edited =====
--- 1.531/Makefile	2004-09-06 20:22:01 +02:00
+++ edited/Makefile	2004-09-06 21:04:01 +02:00
@@ -545,7 +545,7 @@
 
 # Build vmlinux
 # ---------------------------------------------------------------------------
-# vmlinux is build from the objects seleted by $(vmlinux-init) and
+# vmlinux is build from the objects selected by $(vmlinux-init) and
 # $(vmlinux-main). Most are built-in.o files from top-level directories
 # in the kernel tree, others are specified in arch/$(ARCH)Makefile.
 # Ordering when linking is important, and $(vmlinux-init) must be first.
@@ -556,30 +556,33 @@
 #   +-< $(vmlinux-init)
 #   |   +--< init/version.o + more
 #   |
-#   +-< built-in.o
-#   |   +--< $(vmlinux-main)
-#   |        +--< driver/built-in.o mm/built-in.o + more
+#   +--< $(vmlinux-main)
+#   |    +--< driver/built-in.o mm/built-in.o + more
 #   |
 #   +-< kallsyms.o (see description in CONFIG_KALLSYMS section)
 #
-# vmlinux version cannot be updated during normal descending-into-subdirs
-# phase since we do not yet know if we need to update vmlinux.
+# vmlinux version (uname -v) cannot be updated during normal
+# descending-into-subdirs phase since we do not yet know if we need to
+# update vmlinux.
 # Therefore this step is delayed until just before final link of vmlinux -
-# except in kallsyms case where it is done just before adding the
+# except in the kallsyms case where it is done just before adding the
 # symbols to the kernel.
 #
 # System.map is generated to document addresses of all kernel symbols
 
 vmlinux-init := $(head-y) $(init-y)
 vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
-vmlinux-all  := $(vmlinux-init) built-in.o
+vmlinux-all  := $(vmlinux-init) $(vmlinux-main)
 vmlinux-lds  := arch/$(ARCH)/kernel/vmlinux.lds
 
 # Rule to link vmlinux - also used during CONFIG_KALLSYMS
 # May be overridden by arch/$(ARCH)/Makefile
+# Require first prerequisite to be the lds file
 quiet_cmd_vmlinux__  = LD      $@
-      cmd_vmlinux__  = $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-                           -T $(filter-out FORCE, $^) -o $@
+      cmd_vmlinux__  = $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
+      -T $(vmlinux-lds) $(vmlinux-init)                          \
+      --start-group $(vmlinux-main) --end-group                  \
+      $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
 
 # Generate new vmlinux version
 quiet_cmd_vmlinux_version = GEN     .version
@@ -619,7 +622,7 @@
 # o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is
 #   empty
 #   Running kallsyms on that gives us .tmp_kallsyms1.o with
-#   the right size - vmlinux version updated during this step
+#   the right size - vmlinux version (uname -v) is updated during this step
 # o .tmp_vmlinux2 now has a __kallsyms section of the right size,
 #   but due to the added section, some addresses have shifted.
 #   From here, we generate a correct .tmp_kallsyms2.o
@@ -684,19 +687,8 @@
 endif # ifdef CONFIG_KALLSYMS
 
 # vmlinux image - including updated kernel symbols
-vmlinux: $(vmlinux-lds) $(vmlinux-init) built-in.o $(kallsyms.o) FORCE
+vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
 	$(call if_changed_rule,vmlinux__)
-
-# Link $(vmlinux-main) to speed up rest of build phase. No need to
-# relink this part too many times.
-# Use start/end-group to make sure to resolve all possible symbols
-quiet_rule_vmlinux_partial = LD      $@
-       cmd_vmlinux_partial = $(LD) $(LDFLAGS) $(LDFLAGS_$(*F)) -r \
-                                   --start-group $(filter-out FORCE, $^) \
-				   --end-group -o $@
-				   
-built-in.o: $(vmlinux-main) FORCE
-	$(call if_changed,vmlinux_partial)
 
 # The actual objects are generated when descending, 
 # make sure no implicit rule kicks in

  parent reply	other threads:[~2004-09-06 19:09 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sam@ravnborg.org>
2004-09-05 20:12 ` kbuild: Simplify vmlinux generation Sam Ravnborg
2004-09-05 20:19   ` Sam Ravnborg
2004-09-06 18:41   ` Horst von Brand
2004-09-06 19:00     ` Sam Ravnborg
2004-09-06 19:12     ` Sam Ravnborg [this message]
2014-06-11 19:25 ` [PATCH v2] x86,vdso: Fix vdso_install Andy Lutomirski
2014-06-11 19:45   ` Sam Ravnborg
2014-06-12 13:19   ` Josh Boyer
2014-06-12 15:28     ` [PATCH v3] " Andy Lutomirski
2014-06-12 15:28       ` Andy Lutomirski
2014-06-12 17:01       ` Josh Boyer
2014-06-13 17:24         ` H. Peter Anvin
2014-06-13 17:28           ` Andy Lutomirski
2014-06-13 18:19       ` [tip:x86/vdso] x86/vdso: " tip-bot for Andy Lutomirski
2004-06-14 20:40 [PATCH 0/5] kbuild Sam Ravnborg
2004-06-14 20:44 ` [PATCH 1/5] kbuild: default kernel image Sam Ravnborg
2004-06-14 21:05   ` Russell King
2004-06-15  4:40     ` Sam Ravnborg
2004-06-15  8:38       ` Russell King
2004-06-15  8:59         ` Christoph Hellwig
2004-06-15 21:07           ` Sam Ravnborg
2004-06-15 21:17             ` Russell King
2004-06-16 15:34             ` Tom Rini
2004-06-15 15:38         ` Tom Rini
2004-06-15 15:53           ` Russell King
2004-06-14 20:45 ` [PATCH 2/5] kbuild: move rpm to scripts/package Sam Ravnborg
2004-06-14 20:46 ` [PATCH 3/5] kbuild: add deb-pkg target Sam Ravnborg
2004-06-14 20:58   ` Wichert Akkerman
2004-06-14 21:22     ` Sam Ravnborg
2004-06-14 20:46 ` [PATCH 4/5] kbuild: make clean improved Sam Ravnborg
2004-06-14 20:50   ` Russell King
2004-06-14 21:19     ` Sam Ravnborg
2004-06-14 21:38       ` Tom Rini
2004-06-15  4:36         ` Sam Ravnborg
2004-06-15 18:50     ` V13
2004-06-14 20:48 ` [PATCH 5/5] kbuild: external module build doc Sam Ravnborg
2004-06-15 12:13   ` Horst von Brand
2004-06-15 20:09     ` Sam Ravnborg
2004-06-15 19:21   ` Jari Ruusu
2004-06-15 19:55     ` Sam Ravnborg
2004-06-15 23:00       ` Martin Schlemmer
2004-06-16 17:32       ` Jari Ruusu
2004-06-14 20:59 ` [PATCH 0/5] kbuild Sam Ravnborg
2004-06-14 23:56 ` Jeff Garzik
2004-06-15 15:41 ` Tom Rini
2004-06-15 17:49   ` Sam Ravnborg
2004-06-15 17:54     ` Tom Rini
2004-06-15 19:01       ` Sam Ravnborg
2004-06-15 19:27         ` Tom Rini
2004-06-15 21:02           ` Sam Ravnborg
2004-06-15 21:24             ` Tom Rini
2004-06-15 18:09     ` Russell King
2004-06-15 19:14       ` Sam Ravnborg
2004-06-15 19:46         ` Russell King
2004-06-15 20:12           ` Sam Ravnborg
2004-06-15 20:55           ` Sam Ravnborg
2004-06-15 20:59             ` Tom Rini
2004-06-15 21:24               ` Sam Ravnborg
2004-06-15 21:06             ` Russell King
2004-06-16 19:49               ` Sam Ravnborg
2004-06-16 20:08                 ` Tom Rini
2004-06-16 20:54                   ` Sam Ravnborg
2004-06-16 20:49                     ` Tom Rini
2004-06-17  6:56                     ` Jan-Benedict Glaw
2004-06-18 20:58                       ` 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=20040906191235.GC8230@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vonbrand@inf.utfsm.cl \
    /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.