From ab19f8794a66910ef9b33041ccfa05b6b12ab6c9 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 22 Oct 2007 11:23:07 +0200 Subject: [PATCH 1/3] kbuild: fix modules_install after a 'make vmlinux' make vmlinux would delete the content of $(MODVERDIR) equals .tmp_versions. This caused a subsequent make modules_install to fail. Fix it so we clean the directory only for the modules build - but we still unconditionally create it so we can do: make dir/file.ko without a preceeding make modules. Reported by David Miller Signed-off-by: Sam Ravnborg Cc: David Miller --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 50bb50defe18..f4238b2739e8 100644 --- a/Makefile +++ b/Makefile @@ -1512,8 +1512,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) fi # Create temporary dir for module support files -cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/* - +# clean it up only when building all modules +cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ + $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ From d8d2e78a061e1ace98544b100b7837c620fbb950 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 22 Oct 2007 11:30:45 +0200 Subject: [PATCH 2/3] kbuild: allow depmod in cross builds again depmod from module-init-tools 3.3-pre2 are reported to work fine in cross build. depmod from module-init-tools 3.1-pre5 are known to SEGV Do not workaround older module-init-tools bugs here. The right fix is for users to upgrade module-init-tools. Signed-off-by: Sam Ravnborg Cc: Geert Uytterhoeven --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f4238b2739e8..264f37b8b263 100644 --- a/Makefile +++ b/Makefile @@ -1505,7 +1505,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) # and we build for the host arch quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) cmd_depmod = \ - if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" = "$(ARCH)" ]; then \ + if [ -r System.map -a -x $(DEPMOD) ]; then \ $(DEPMOD) -ae -F System.map \ $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \ $(KERNELRELEASE); \ From 631bcfbbc5be0d778a2513988a56e5bd53bfb495 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sun, 21 Oct 2007 19:55:00 +0200 Subject: [PATCH 3/3] kbuild: cc-cross-prefix spelling Spelling fixes for cc-cross-prefix documentation Signed-off-by: Geert Uytterhoeven Signed-off-by: Sam Ravnborg --- Documentation/kbuild/makefiles.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 6166e2d7da76..7a7753321a26 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -519,17 +519,17 @@ more details, with real examples. to the user why it stops. cc-cross-prefix - cc-cross-prefix is used to check if there exist a $(CC) in path with + cc-cross-prefix is used to check if there exists a $(CC) in path with one of the listed prefixes. The first prefix where there exist a prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found then nothing is returned. Additional prefixes are separated by a single space in the call of cc-cross-prefix. - This functionality is usefull for architecture Makefile that try - to set CROSS_COMPILE to well know values but may have several + This functionality is useful for architecture Makefiles that try + to set CROSS_COMPILE to well-known values but may have several values to select between. - It is recommended only to try to set CROSS_COMPILE is it is a cross - build (host arch is different from target arch). And is CROSS_COMPILE + It is recommended only to try to set CROSS_COMPILE if it is a cross + build (host arch is different from target arch). And if CROSS_COMPILE is already set then leave it with the old value. Example: