public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: sam@ravnborg.org
To: linux-kernel@vger.kernel.org
Cc: Sam Ravnborg <sam@neptun.ravnborg.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 11/13] kbuild: make modpost processing configurable
Date: Sun, 01 Oct 2006 12:52:44 +0200	[thread overview]
Message-ID: <11596999683256-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <115969996811-git-send-email-sam@ravnborg.org>

From: Sam Ravnborg <sam@neptun.ravnborg.org>

On request from Al Viro make modpost processing configurable.

KBUILD_MODPOST_WARN can be set to make modpost warn instead of
error out in case on unresolved symbols in final module link.

KBUILD_MODPOST_NOFINAL can be set to avoid the final and timeconsuming
.c file generation and link of .ko files. This is solely useful for
speeding up when doing compile checks with for example allmodconfig

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/Makefile.modpost |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 4b2721c..6c5469b 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -32,6 +32,10 @@ #     - See include/linux/module.h for m
 # Step 4 is solely used to allow module versioning in external modules,
 # where the CRC of each module is retrieved from the Module.symers file.
 
+# KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
+# symbols in the final module linking stage
+# KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
+# This is solely usefull to speed up test compiles
 PHONY := _modpost
 _modpost: __modpost
 
@@ -46,7 +50,8 @@ # Step 1), find all modules listed in $(
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules   := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
 
-_modpost: $(modules)
+# Stop after building .o files if NOFINAL is set. Makes compile tests quicker
+_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
 
 
 # Step 2), invoke modpost
@@ -58,7 +63,7 @@ quiet_cmd_modpost = MODPOST $(words $(fi
 	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
 	$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
 	$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
-	$(if $(KBUILD_EXTMOD),-w) \
+	$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
 	$(wildcard vmlinux) $(filter-out FORCE,$^)
 
 PHONY += __modpost
@@ -92,7 +97,7 @@ targets += $(modules:.ko=.mod.o)
 
 # Step 6), final link of the modules
 quiet_cmd_ld_ko_o = LD [M]  $@
-      cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ 		\
+      cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@		\
 			  $(filter-out FORCE,$^)
 
 $(modules): %.ko :%.o %.mod.o FORCE
-- 
1.4.1


  reply	other threads:[~2006-10-01 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-01 10:52 [PATCH 1/13] kconfig/lxdialog: refactor color support sam
2006-10-01 10:52 ` [PATCH 2/13] kconfig/lxdialog: add support for color themes and add blackbg theme sam
2006-10-01 10:52   ` [PATCH 3/13] kconfig/lxdialog: add a new theme bluetitle which is now default sam
2006-10-01 10:52     ` [PATCH 4/13] kconfig/menuconfig: lxdialog is now built-in sam
2006-10-01 10:52       ` [PATCH 5/13] kconfig/lxdialog: let <ESC><ESC> behave as expected sam
2006-10-01 10:52         ` [PATCH 6/13] kconfig/lxdialog: support resize sam
2006-10-01 10:52           ` [PATCH 7/13] kconfig/lxdialog: fix make mrproper sam
2006-10-01 10:52             ` [PATCH 8/13] kbuild: do not build mconf & lxdialog unless needed sam
2006-10-01 10:52               ` [PATCH 9/13] kconfig/lxdialog: clear long menu lines sam
2006-10-01 10:52                 ` [PATCH 10/13] kconfig/menuconfig: do not let ncurses clutter screen on exit sam
2006-10-01 10:52                   ` sam [this message]
2006-10-01 10:52                     ` [PATCH 12/13] kconfig: fix saving alternate kconfig file in parent dir sam

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=11596999683256-git-send-email-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@neptun.ravnborg.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