bk://linux-sam.bkbits.net/kbuild sam@mars.ravnborg.org|ChangeSet|20050202195041|35505 sam # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/02 02:31:03-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild # # Makefile # 2005/03/02 02:30:59-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/01 23:47:55-08:00 akpm@bix.(none) # Merge bk://linux-sam.bkbits.net/kbuild # into bix.(none):/usr/src/bk-kbuild # # Makefile # 2005/03/01 23:47:50-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/02/02 20:50:41+01:00 sam@mars.ravnborg.org # prismtech: Avoid recompile when changing compile dir # # -I$(PWD) is superflous - and caused absolute path to be stored in build command - this # casuses recompile when using symlink to kernel. # Also deleted commented out -DCONFIG_PRISM_WDS. CONFIG_PRISM_WDS are not present in # any of the source files. # # Signed-off-by: Sam Ravnborg # # drivers/net/wireless/prism54/Makefile # 2005/02/02 20:50:18+01:00 sam@mars.ravnborg.org +0 -2 # -I$(PWD) is superflous - and caused absolute path to be stored in build command - this casuses # recompile when using symlink to kernel. # Also deleted commented out -DCONFIG_PRISM_WDS. CONFIG_PRISM_WDS are not present in any # of the source files. # # ChangeSet # 2005/02/02 20:30:19+01:00 sam@mars.ravnborg.org # kbuild: Fix debugging leftover # # So now check for commandline options actually works again. # # Signed-off-by: Sam Ravnborg # # scripts/Makefile.lib # 2005/02/02 20:30:00+01:00 sam@mars.ravnborg.org +1 -1 # Remove debug left-over # # ChangeSet # 2005/01/31 20:44:43+01:00 tero_niemela@yahoo.com # [PATCH] kbuild: skip depmod if not executable # # I've cross-compiled Linux on i386-netbsdelf2.0 for # arm-linux for quite some time now and everything seems # to be working perfectly except for one minor glitch in # the build process that halts module installation # (needlessly, IMHO). Specifically, if System.map exists # $(DEPMOD) is run ("for convenience" as the comment # says in the Makefile). However, on NetBSD I don't have # $(DEPMOD) available so the command fails and make # exits with non-zero exit status. Please consider the # attached patch to add a check for $(DEPMOD) so that # missing $(DEPMOD) won't halt the whole build process. # # From: Tero Niemela # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/06 19:00:00+01:00 tero_niemela@yahoo.com +1 -1 # kbuild: skip depmod if not executable # # ChangeSet # 2005/01/31 20:37:03+01:00 tony@atomide.com # [PATCH] kbuild: fix for i386 cross compile # # I used to be be able to cross compile for i386 on my x86_64 machine, # but recently something (gcc/binutils?) changed, and it stopped working. # # Following patch makes cross compile work with: # # make ARCH=i386 CFLAGS_KERNEL="-m32" AFLAGS_KERNEL="-m32" bzImage # # Without the patch I'm getting the following error: # # SYSCALL arch/i386/kernel/vsyscall-syms.o # /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: # Relocatable linking with relocations from format elf32-i386 # (arch/i386/kernel/vsyscall-sysenter.o) to format elf64-x86-64 # (arch/i386/kernel/vsyscall-syms.o) is not supported # collect2: ld returned 1 exit status # # Signed-off-by: Andrew Morton # Signed-off-by: Sam Ravnborg # # arch/i386/kernel/Makefile # 2005/01/26 06:21:13+01:00 tony@atomide.com +1 -1 # kbuild: fix for i386 cross compile # # ChangeSet # 2005/01/31 20:34:06+01:00 blaisorblade@yahoo.it # [PATCH] kbuild: no redundant srctree in tags file # # Avoid cluttering the tags/TAGS generated file with $(srctree) in the paths # if this is not needed. # # This has two advantages: # # - Saving about 20M on the size of the resulting tags file (which are used # currently to store the absolute path of the file names rather than the # relative one) when KBUILD_OUTPUT is not set. # # - Keeping the tags file valid when the directory is renamed. # # No change is done for who does make tags O=..., if this is wanted (I would # find that incommodous and non-typical for a developer, but anyway I've not # ruined functionality in that case). # # Signed-off-by: Paolo 'Blaisorblade' Giarrusso # Signed-off-by: Andrew Morton # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/23 03:46:02+01:00 blaisorblade@yahoo.it +16 -6 # kbuild: no redundant srctree in tags file # # ChangeSet # 2005/01/31 20:31:59+01:00 ak@muc.de # [PATCH] kbuild: Use -Wno-pointer-sign for gcc 4.0 # # Compiling an allyesconfig kernel straight with a gcc 4.0 snapshot # gives nearly 10k new warnings like: # # warning: pointer targets in passing argument 5 of `cpuid' differ in signedness # # Since the sheer number of these warnings was too much even for the # most determined kernel janitors (I actually asked ;-) and I don't # think it's a very serious issue to have these mismatches I submitted # an new option to gcc to disable it. It was incorporated in gcc mainline # now. # # This patch makes the kernel compilation use it. There are still # quite a lot of new warnings with 4.0 (mostly about uninitialized variables), # but the compile log looks much nicer nnow. # # Signed-off-by: Andi Kleen # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/19 05:43:29+01:00 ak@muc.de +3 -0 # kbuild: Use -Wno-pointer-sign for gcc 4.0 # # ChangeSet # 2005/01/30 23:56:02+01:00 agruen@suse.de # The wrong version of the parmtype patch was merged, incompletely, and # the part that got merged got broken on the way. Here are the fixes: # # Move __MODULE_INFO to modparam.h: This macro is used in modparam.h; # there are users who include this header but not module.h. The latter # includes modparam.h already. # # __MODULE_INFO(parmtype, name##type, #name ":" #type) does not evaluate # to __MODULE_INFO(parmtype, footype, "foo:int") as was the idea, but to # __MODULE_INFO(parmtype, fooint, "foo:int") when type is bound to int. # In more complicated cases, we get syntax erros. Re-introduce the # __MODULE_PARM_TYPE macro; this is cleaner than renaming the type parameter. # # Add the parmtype definition which was dropped during the merge to to the # obsolete but still heavily used MODULE_PARM macro. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Sam Ravnborf # # include/linux/moduleparam.h # 2005/01/30 23:55:43+01:00 agruen@suse.de +16 -3 # The wrong version of the parmtype patch was merged, incompletely, and # the part that got merged got broken on the way. Here are the fixes: # # Move __MODULE_INFO to modparam.h: This macro is used in modparam.h; # there are users who include this header but not module.h. The latter # includes modparam.h already. # # __MODULE_INFO(parmtype, name##type, #name ":" #type) does not evaluate # to __MODULE_INFO(parmtype, footype, "foo:int") as was the idea, but to # __MODULE_INFO(parmtype, fooint, "foo:int") when type is bound to int. # In more complicated cases, we get syntax erros. Re-introduce the # __MODULE_PARM_TYPE macro; this is cleaner than renaming the type parameter. # # Add the parmtype definition which was dropped during the merge to to the # obsolete but still heavily used MODULE_PARM macro. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Sam Ravnborf # # include/linux/module.h # 2005/01/30 23:55:43+01:00 agruen@suse.de +2 -11 # The wrong version of the parmtype patch was merged, incompletely, and # the part that got merged got broken on the way. Here are the fixes: # # Move __MODULE_INFO to modparam.h: This macro is used in modparam.h; # there are users who include this header but not module.h. The latter # includes modparam.h already. # # __MODULE_INFO(parmtype, name##type, #name ":" #type) does not evaluate # to __MODULE_INFO(parmtype, footype, "foo:int") as was the idea, but to # __MODULE_INFO(parmtype, fooint, "foo:int") when type is bound to int. # In more complicated cases, we get syntax erros. Re-introduce the # __MODULE_PARM_TYPE macro; this is cleaner than renaming the type parameter. # # Add the parmtype definition which was dropped during the merge to to the # obsolete but still heavily used MODULE_PARM macro. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Sam Ravnborf # # ChangeSet # 2005/01/30 23:32:26+01:00 juhl-lkml@dif.dk # kbuild: make 'make help' show all *config targets and update descriptions slightly. # # "make help" doesn't show "make randconfig" nor "make config" as options # and the description of oldconfig could be better (IMHO). Patch below adds # the missing targets to the help and updates the description of oldconfig. # # Signed-off-by: Jesper Juhl # Signed-off-by: Sam Ravnborg # # scripts/kconfig/Makefile # 2005/01/24 21:42:21+01:00 juhl-lkml@dif.dk +3 -1 # kbuild: make 'make help' show all *config targets and update descriptions slightly. # # ChangeSet # 2005/01/30 23:30:19+01:00 bunk@stusta.de # kbuild: update scripts/namespace.pl # # The patch below removes some false positives I've observed. # # Signed-off-by: Adrian Bunk # Signed-off-by: Sam Ravnborg # # scripts/namespace.pl # 2005/01/24 20:20:58+01:00 bunk@stusta.de +5 -0 # kbuild: update scripts/namespace.pl # # ChangeSet # 2005/01/30 23:27:49+01:00 bunk@stusta.de # kallsyms: kallsyms.c - make some code static # # This patch makes some needlessly global code static. # # Signed-off-by: Adrian Bunk # Signed-off-by: Sam Ravnborg # # kernel/kallsyms.c # 2004/12/12 02:56:45+01:00 bunk@stusta.de +2 -2 # kallsyms: kallsyms.c - make some code static # # ChangeSet # 2005/01/30 23:25:13+01:00 bunk@stusta.de # kernel/configs.c: make a variable static # # This patch makes a needlessly global variable static. # # Signed-off-by: Adrian Bunk # Acked-by: Randy Dunlap # Signed-off-by: Sam Ravnborg # # kernel/Makefile # 2004/12/12 02:45:18+01:00 bunk@stusta.de +1 -1 # kernel/configs.c: make a variable static # # ChangeSet # 2005/01/30 10:19:16+01:00 agruen@suse.de # kbuild: Dont include absolute filenames in binaries # # The kbuild utilities are compiled with absolute patch names, so paths # starting with $RPM_BUILD_ROOT would end up in the binaries. To avoid # this, remove all references to __FILE__ (directly and indirectly via # assert()). # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Sam Ravnborg # # scripts/mod/modpost.h # 2005/01/30 01:00:00+01:00 agruen@suse.de +2 -2 # kbuild: Dont include absolute filenames in binaries # # scripts/mod/modpost.c # 2005/01/30 01:00:00+01:00 agruen@suse.de +2 -3 # kbuild: Dont include absolute filenames in binaries # # scripts/genksyms/genksyms.h # 2005/01/30 01:00:00+01:00 agruen@suse.de +12 -4 # kbuild: Dont include absolute filenames in binaries # # ChangeSet # 2005/01/30 10:16:19+01:00 sam@mars.ravnborg.org # kbuild: Nicer printout when Module.symvers is missing # # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/30 10:15:58+01:00 sam@mars.ravnborg.org +2 -2 # kbuild: Nicer printout when Module.symvers is missing # # ChangeSet # 2005/01/30 10:11:31+01:00 agruen@suse.de # kbuild: Warn when building external modules without modversions # # This adds a warning when building external modules (M= or SUBDIRS= # syntax) and there is no Module.symvers in the object tree. A missing # Module.symvers is a clear sign that the kernel tree itself was never # compiled. The resulting modules will work, but no symbol version # information will be attached to kernel symbols the module uses (because # that information comes from Module.symvers), and so the module will be # more unsafe. # Futhermore the external module will not record what other modules it is # depended on. # # The test works with CONFIG_MODVERSIONS enabled or disabled. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/30 01:00:00+01:00 agruen@suse.de +9 -1 # kbuild: Warn when building external modules without modversions # # ChangeSet # 2005/01/30 10:05:47+01:00 sam@mars.ravnborg.org # kbuild: add '--extra=+f' to ctags in Makefile in order to search for file names # # From: John Kacur # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/30 10:05:27+01:00 sam@mars.ravnborg.org +1 -1 # kbuild: add '--extra=+f' to ctags in Makefile in order to search for file names # # ChangeSet # 2005/01/30 09:59:05+01:00 jkacur@rogers.com # kbuild: (trivial) spelling fix in comment in Makefile # # From: John Kacur # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/12 04:58:56+01:00 jkacur@rogers.com +1 -1 # kbuild: (trivial) spelling fix in comment in Makefile # # ChangeSet # 2005/01/29 23:10:48+01:00 sam@mars.ravnborg.org # Merge bk://linux-sam.bkbits.net/kbuild # into mars.ravnborg.org:/home/sam/bk/kbuild # # kernel/kallsyms.c # 2005/01/29 23:10:38+01:00 sam@mars.ravnborg.org +0 -9 # Auto merged # # ChangeSet # 2005/01/29 23:04:53+01:00 sam@mars.ravnborg.org # kbuild: default value for INSTALL_PATH set to /boot # # Most architectures uses /boot for there kernel image, so let this be reflected # by the kernel. # If INSTALL_PATH shell variable is set then this will have effect. # If INSTALL_PATH is set one the commanline to make like this: # make INSTALL_PATH=/nfs/boot install # then this will override both kbuild and shell variable. # # If an arch prefer another default this must be set in the arch Makefile # # Signed-off-by: Sam Ravnborg # # Makefile # 2005/01/29 23:04:31+01:00 sam@mars.ravnborg.org +2 -4 # INSTALL_PATH default set to /boot # # ChangeSet # 2005/01/29 22:43:35+01:00 sam@mars.ravnborg.org # kbuild arch/i386: make install no longer check vmlinux # # make install is often executed as root or on a different mechine via NFS # To avoid updating vmlinux due to directory changes or similar the install target # for i386 no longer has vmlinux as a prerequisite. # Now modules_install and install are aligned in this respect. # # Signed-off-by: Sam Ravnborg # # arch/i386/Makefile # 2005/01/29 22:43:09+01:00 sam@mars.ravnborg.org +4 -1 # install is no longer dependent on vmlinux # # ChangeSet # 2005/01/29 22:34:30+01:00 sam@mars.ravnborg.org # kbuild: Introdude KBUILD_NOCMDDEP # # When tossing around with different gcc compilers there is no way to tell kbuild # to ignore the new name of the compiler. The new option KBUILD_NOCMDDEP tell # kbuild not to check the commandline for changes. # This should be used with care because the resulting kernel may become inconsistent # if one part is build with 2.96, and another part build with 3.3.4. # So use only when you know what you are doing. # # Syntax: # make KBUILD_NOCMDDEP=1 # # Original request for this feature came from hpa. # # Signed-off-by: Sam Ravnborg # # scripts/Makefile.lib # 2005/01/29 22:34:11+01:00 sam@mars.ravnborg.org +5 -1 # KBUILD_NOCMDDEP=1 support # Ignore commandline changes # # ChangeSet # 2005/01/29 21:28:37+01:00 sam@mars.ravnborg.org # kbuild: Makefile.lib - small cleanup # # Combine duplicate code in two smaller 'functions' # # Signed-off-by: Sam Ravnborg # # scripts/Makefile.lib # 2005/01/29 21:28:14+01:00 sam@mars.ravnborg.org +13 -11 # Move common functionality to a 'function' # # ChangeSet # 2005/01/10 17:32:45+01:00 kaos@ocs.com.au # kallsyms: gate page patch breaks module lookups # # >Your recent patch looks to break module kallsyms lookups.... # >It looks like if CONFIG_KALLSYMS_ALL is set then we never look up module # >addresses. # # Separate lookups for kernel and modules when CONFIG_KALLSYMS_ALL=y. # # Signed-off-by: Keith Owens # Signed-off-by: Sam Ravnborg # # kernel/kallsyms.c # 2005/01/10 14:42:42+01:00 kaos@ocs.com.au +9 -1 # kallsyms: gate page patch breaks module lookups # diff -Nru a/Makefile b/Makefile --- a/Makefile 2005-03-03 22:02:14 -08:00 +++ b/Makefile 2005-03-03 22:02:14 -08:00 @@ -18,7 +18,7 @@ # # Most importantly: sub-Makefiles should only ever modify files in # their own directory. If in some directory we have a dependency on -# a file in another dir (which doesn't happen often, but it's of +# a file in another dir (which doesn't happen often, but it's often # unavoidable when linking the built-in.o targets which finally # turn into vmlinux), we will call a sub make in that other dir, and # after that we are sure that everything which is in that other dir @@ -536,6 +536,9 @@ # disable pointer signedness warnings in gcc 4.0 CFLAGS += $(call cc-option,-Wno-pointer-sign,) +# disable pointer signedness warnings in gcc 4.0 +CFLAGS += $(call cc-option,-Wno-pointer-sign,) + # Default kernel image to build when no specific target is given. # KBUILD_IMAGE may be overruled on the commandline or # set in the environment @@ -545,10 +548,8 @@ # # INSTALL_PATH specifies where to place the updated kernel and system map -# images. Uncomment if you want to place them anywhere other than root. -# - -#export INSTALL_PATH=/boot +# images. Default is /boot, but you can set it to other values +export INSTALL_PATH ?= /boot # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory @@ -898,7 +899,7 @@ endif .PHONY: _modinst_post _modinst_post: _modinst_ - if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi + if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi else # CONFIG_MODULES @@ -1096,9 +1097,17 @@ crmodverdir: $(Q)mkdir -p $(MODVERDIR) +.PHONY: $(objtree)/Module.symvers +$(objtree)/Module.symvers: + @test -e $(objtree)/Module.symvers || ( \ + echo; \ + echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \ + echo " is missing; modules will have no dependencies and modversions."; \ + echo ) + module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) .PHONY: $(module-dirs) modules -$(module-dirs): crmodverdir +$(module-dirs): crmodverdir $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) modules: $(module-dirs) @@ -1136,20 +1145,30 @@ # Generate tags for editors # --------------------------------------------------------------------------- +#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set +#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file. +#Adding $(srctree) adds about 20M on i386 to the size of the output file! + +ifeq ($(KBUILD_OUTPUT),) +__srctree = +else +__srctree = $(srctree)/ +endif + define all-sources - ( find $(srctree) $(RCS_FIND_IGNORE) \ + ( find $(__srctree) $(RCS_FIND_IGNORE) \ \( -name include -o -name arch \) -prune -o \ -name '*.[chS]' -print; \ - find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \ + find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \ + find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/include $(RCS_FIND_IGNORE) \ + find $(__srctree)include $(RCS_FIND_IGNORE) \ \( -name config -o -name 'asm-*' \) -prune \ -o -name '*.[chS]' -print; \ - find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print ) endef @@ -1172,7 +1191,7 @@ define cmd_tags rm -f $@; \ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL"`; \ - $(all-sources) | xargs ctags $$CTAGSF -a + $(all-sources) | xargs ctags $$CTAGSF -a --extra=+f endef TAGS: FORCE diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile 2005-03-03 22:02:14 -08:00 +++ b/arch/i386/Makefile 2005-03-03 22:02:14 -08:00 @@ -137,7 +137,10 @@ zdisk bzdisk: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk -install fdimage fdimage144 fdimage288: vmlinux +fdimage fdimage144 fdimage288: vmlinux + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ + +install: $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ prepare: include/asm-$(ARCH)/asm_offsets.h diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile 2005-03-03 22:02:14 -08:00 +++ b/arch/i386/kernel/Makefile 2005-03-03 22:02:14 -08:00 @@ -46,7 +46,7 @@ # The DSO images are built using a special linker script. quiet_cmd_syscall = SYSCALL $@ - cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \ + cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ -Wl,-T,$(filter-out FORCE,$^) -o $@ export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH) diff -Nru a/drivers/net/wireless/prism54/Makefile b/drivers/net/wireless/prism54/Makefile --- a/drivers/net/wireless/prism54/Makefile 2005-03-03 22:02:14 -08:00 +++ b/drivers/net/wireless/prism54/Makefile 2005-03-03 22:02:14 -08:00 @@ -6,5 +6,3 @@ obj-$(CONFIG_PRISM54) += prism54.o -EXTRA_CFLAGS = -I$(PWD) #-DCONFIG_PRISM54_WDS - diff -Nru a/include/linux/module.h b/include/linux/module.h --- a/include/linux/module.h 2005-03-03 22:02:14 -08:00 +++ b/include/linux/module.h 2005-03-03 22:02:14 -08:00 @@ -77,24 +77,14 @@ extern struct subsystem module_subsys; #ifdef MODULE -#define ___module_cat(a,b) __mod_ ## a ## b -#define __module_cat(a,b) ___module_cat(a,b) -#define __MODULE_INFO(tag, name, info) \ -static const char __module_cat(name,__LINE__)[] \ - __attribute_used__ \ - __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info - #define MODULE_GENERIC_TABLE(gtype,name) \ extern const struct gtype##_id __mod_##gtype##_table \ __attribute__ ((unused, alias(__stringify(name)))) extern struct module __this_module; #define THIS_MODULE (&__this_module) - #else /* !MODULE */ - #define MODULE_GENERIC_TABLE(gtype,name) -#define __MODULE_INFO(tag, name, info) #define THIS_MODULE ((struct module *)0) #endif @@ -560,7 +550,8 @@ /* DEPRECATED: Do not use. */ #define MODULE_PARM(var,type) \ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ -{ __stringify(var), type, &MODULE_PARM_ }; +{ __stringify(var), type, &MODULE_PARM_ }; \ +__MODULE_PARM_TYPE(var, type); #else #define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_; #endif diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h 2005-03-03 22:02:14 -08:00 +++ b/include/linux/moduleparam.h 2005-03-03 22:02:14 -08:00 @@ -13,6 +13,19 @@ #define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "." #endif +#ifdef MODULE +#define ___module_cat(a,b) __mod_ ## a ## b +#define __module_cat(a,b) ___module_cat(a,b) +#define __MODULE_INFO(tag, name, info) \ +static const char __module_cat(name,__LINE__)[] \ + __attribute_used__ \ + __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info +#else /* !MODULE */ +#define __MODULE_INFO(tag, name, info) +#endif +#define __MODULE_PARM_TYPE(name, _type) \ + __MODULE_INFO(parmtype, name##type, #name ":" _type) + struct kernel_param; /* Returns 0, or -errno. arg is in kp->arg. */ @@ -65,7 +78,7 @@ #define module_param_named(name, value, type, perm) \ param_check_##type(name, &(value)); \ module_param_call(name, param_set_##type, param_get_##type, &value, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":" #type) + __MODULE_PARM_TYPE(name, #type) #define module_param(name, type, perm) \ module_param_named(name, name, type, perm) @@ -76,7 +89,7 @@ = { len, string }; \ module_param_call(name, param_set_copystring, param_get_string, \ &__param_string_##name, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":string") + __MODULE_PARM_TYPE(name, "string") /* Called on module insert or kernel boot */ extern int parse_args(const char *name, @@ -138,7 +151,7 @@ sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ &__param_arr_##name, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":array of " #type) + __MODULE_PARM_TYPE(name, "array of " #type) #define module_param_array(name, type, nump, perm) \ module_param_array_named(name, name, type, nump, perm) diff -Nru a/kernel/Makefile b/kernel/Makefile --- a/kernel/Makefile 2005-03-03 22:02:14 -08:00 +++ b/kernel/Makefile 2005-03-03 22:02:14 -08:00 @@ -45,7 +45,7 @@ $(call if_changed,gzip) quiet_cmd_ikconfiggz = IKCFG $@ - cmd_ikconfiggz = (echo "const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ + cmd_ikconfiggz = (echo "static const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ targets += config_data.h $(obj)/config_data.h: $(obj)/config_data.gz FORCE $(call if_changed,ikconfiggz) diff -Nru a/kernel/kallsyms.c b/kernel/kallsyms.c --- a/kernel/kallsyms.c 2005-03-03 22:02:14 -08:00 +++ b/kernel/kallsyms.c 2005-03-03 22:02:14 -08:00 @@ -342,7 +342,7 @@ return 0; } -struct seq_operations kallsyms_op = { +static struct seq_operations kallsyms_op = { .start = s_start, .next = s_next, .stop = s_stop, @@ -384,7 +384,7 @@ .release = kallsyms_release, }; -int __init kallsyms_init(void) +static int __init kallsyms_init(void) { struct proc_dir_entry *entry; diff -Nru a/scripts/Makefile.lib b/scripts/Makefile.lib --- a/scripts/Makefile.lib 2005-03-03 22:02:14 -08:00 +++ b/scripts/Makefile.lib 2005-03-03 22:02:14 -08:00 @@ -183,15 +183,24 @@ # Generic stuff # =========================================================================== +ifneq ($(KBUILD_NOCMDDEP),1) +# Check if both arguments has same arguments. Result in empty string if equal +# User may override this check using make KBUILD_NOCMDDEP=1 +arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) + +endif + +# echo command. Short version is $(quiet) equals quiet, otherwise full command +echo-cmd = $(if $($(quiet)cmd_$(1)), \ + echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) + # function to only execute the passed command if necessary # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars - -if_changed = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +# +if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) @@ -200,10 +209,9 @@ # file if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ @@ -213,9 +221,7 @@ # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) -if_changed_rule = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ @set -e; \ $(rule_$(1))) diff -Nru a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h --- a/scripts/genksyms/genksyms.h 2005-03-03 22:02:14 -08:00 +++ b/scripts/genksyms/genksyms.h 2005-03-03 22:02:14 -08:00 @@ -25,7 +25,6 @@ #define MODUTILS_GENKSYMS_H 1 #include -#include enum symbol_type @@ -89,8 +88,17 @@ #define MODUTILS_VERSION "" -#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; }) -#define xstrdup(str) ({ char *__str = strdup(str); assert(__str); __str; }) - +#define xmalloc(size) ({ void *__ptr = malloc(size); \ + if(!__ptr && size != 0) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __ptr; }) +#define xstrdup(str) ({ char *__str = strdup(str); \ + if (!__str) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __str; }) #endif /* genksyms.h */ diff -Nru a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile --- a/scripts/kconfig/Makefile 2005-03-03 22:02:14 -08:00 +++ b/scripts/kconfig/Makefile 2005-03-03 22:02:14 -08:00 @@ -50,10 +50,12 @@ # Help text used by make help help: - @echo ' oldconfig - Update current config utilising a line-oriented program' + @echo ' config - Update current config utilising a line-oriented program' @echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' + @echo ' oldconfig - Update current config utilising a provided .config as base' + @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible' @echo ' allyesconfig - New config where all options are accepted with yes' diff -Nru a/scripts/mod/modpost.c b/scripts/mod/modpost.c --- a/scripts/mod/modpost.c 2005-03-03 22:02:14 -08:00 +++ b/scripts/mod/modpost.c 2005-03-03 22:02:14 -08:00 @@ -47,11 +47,10 @@ va_end(arglist); } -void *do_nofail(void *ptr, const char *file, int line, const char *expr) +void *do_nofail(void *ptr, const char *expr) { if (!ptr) { - fatal("Memory allocation failure %s line %d: %s.\n", - file, line, expr); + fatal("modpost: Memory allocation failure: %s.\n", expr); } return ptr; } diff -Nru a/scripts/mod/modpost.h b/scripts/mod/modpost.h --- a/scripts/mod/modpost.h 2005-03-03 22:02:14 -08:00 +++ b/scripts/mod/modpost.h 2005-03-03 22:02:14 -08:00 @@ -53,8 +53,8 @@ #endif -#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr) -void *do_nofail(void *ptr, const char *file, int line, const char *expr); +#define NOFAIL(ptr) do_nofail((ptr), #ptr) +void *do_nofail(void *ptr, const char *expr); struct buffer { char *p; diff -Nru a/scripts/namespace.pl b/scripts/namespace.pl --- a/scripts/namespace.pl 2005-03-03 22:02:14 -08:00 +++ b/scripts/namespace.pl 2005-03-03 22:02:14 -08:00 @@ -406,6 +406,11 @@ && $name !~ /^__.*per_cpu_end/ && $name !~ /^__alt_instructions/ && $name !~ /^__setup_/ + && $name !~ /^jiffies/ + && $name !~ /^__mod_timer/ + && $name !~ /^__mod_page_state/ + && $name !~ /^init_module/ + && $name !~ /^cleanup_module/ ) { printf "Cannot resolve "; printf "weak " if ($type eq "w");