Explorar el Código

Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild

* master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild: (46 commits)
  kbuild: remove obsoleted scripts/reference_* files
  kbuild: fix make help & make *pkg
  kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
  Kconfig: remove the CONFIG_CC_ALIGN_* options
  kbuild: add -fverbose-asm to i386 Makefile
  kbuild: clean-up genksyms
  kbuild: Lindent genksyms.c
  kbuild: fix genksyms build error
  kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
  kbuild: replace PHONY with FORCE
  kbuild: Fix bug in crc symbol generating of kernel and modules
  kbuild: change kbuild to not rely on incorrect GNU make behavior
  kbuild: when warning symbols exported twice now tell user this is the problem
  kbuild: fix make dir/file.xx when asm symlink is missing
  kbuild: in the section mismatch check try harder to find symbols
  kbuild: fix section mismatch check for unwind on IA64
  kbuild: kill false positives from section mismatch warnings for powerpc
  kbuild: kill trailing whitespace in modpost & friends
  kbuild: small update of allnoconfig description
  kbuild: make namespace.pl CROSS_COMPILE happy
  ...

Trivial conflict in arch/ppc/boot/Makefile manually fixed up
Linus Torvalds hace 19 años
padre
commit
2e1ca21d46
Se han modificado 52 ficheros con 1500 adiciones y 1258 borrados
  1. 7 1
      Documentation/DocBook/Makefile
  2. 100 72
      Documentation/kbuild/makefiles.txt
  3. 91 7
      Documentation/kbuild/modules.txt
  4. 0 4
      Documentation/smart-config.txt
  5. 99 98
      Makefile
  6. 4 1
      arch/arm/Makefile
  7. 4 1
      arch/arm/boot/Makefile
  8. 4 1
      arch/arm/boot/bootp/Makefile
  9. 5 2
      arch/arm26/Makefile
  10. 4 1
      arch/arm26/boot/Makefile
  11. 2 2
      arch/i386/Makefile
  12. 2 1
      arch/i386/kernel/vmlinux.lds.S
  13. 4 1
      arch/ia64/Makefile
  14. 4 1
      arch/m32r/Makefile
  15. 1 1
      arch/powerpc/Makefile
  16. 1 1
      arch/ppc/Makefile
  17. 7 1
      arch/ppc/boot/Makefile
  18. 5 2
      arch/ppc/boot/openfirmware/Makefile
  19. 1 1
      arch/sh/Makefile
  20. 5 2
      arch/um/Makefile
  21. 2 2
      arch/x86_64/Makefile
  22. 5 0
      drivers/atm/.gitignore
  23. 0 1
      drivers/video/matrox/matroxfb_DAC1064.c
  24. 0 1
      drivers/video/matrox/matroxfb_DAC1064.h
  25. 0 1
      drivers/video/matrox/matroxfb_Ti3026.c
  26. 0 1
      drivers/video/matrox/matroxfb_Ti3026.h
  27. 0 1
      drivers/video/matrox/matroxfb_base.c
  28. 0 1
      drivers/video/matrox/matroxfb_misc.c
  29. 0 37
      init/Kconfig
  30. 52 13
      scripts/Kbuild.include
  31. 16 11
      scripts/Makefile.build
  32. 8 2
      scripts/Makefile.clean
  33. 8 2
      scripts/Makefile.modinst
  34. 14 5
      scripts/Makefile.modpost
  35. 2 12
      scripts/basic/fixdep.c
  36. 0 65
      scripts/checkconfig.pl
  37. 393 450
      scripts/genksyms/genksyms.c
  38. 17 40
      scripts/genksyms/genksyms.h
  39. 3 3
      scripts/kconfig/Makefile
  40. 1 1
      scripts/kconfig/confdata.c
  41. 3 3
      scripts/kconfig/lxdialog/Makefile
  42. 5 3
      scripts/mkmakefile
  43. 8 9
      scripts/mod/file2alias.c
  44. 2 2
      scripts/mod/mk_elfconfig.c
  45. 562 135
      scripts/mod/modpost.c
  46. 20 5
      scripts/mod/modpost.h
  47. 15 17
      scripts/mod/sumversion.c
  48. 2 2
      scripts/namespace.pl
  49. 8 12
      scripts/package/Makefile
  50. 0 112
      scripts/reference_discarded.pl
  51. 0 108
      scripts/reference_init.pl
  52. 4 0
      sound/oss/.gitignore

+ 7 - 1
Documentation/DocBook/Makefile

@@ -28,7 +28,7 @@ PS_METHOD	= $(prefer-db2x)
 
 
 ###
 ###
 # The targets that may be used.
 # The targets that may be used.
-.PHONY:	xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs
+PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs
 
 
 BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
 BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
 xmldocs: $(BOOKS)
 xmldocs: $(BOOKS)
@@ -211,3 +211,9 @@ clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS))
 
 
 #man put files in man subdir - traverse down
 #man put files in man subdir - traverse down
 subdir- := man/
 subdir- := man/
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)

+ 100 - 72
Documentation/kbuild/makefiles.txt

@@ -17,6 +17,7 @@ This document describes the Linux kernel Makefiles.
 	   --- 3.8 Command line dependency
 	   --- 3.8 Command line dependency
 	   --- 3.9 Dependency tracking
 	   --- 3.9 Dependency tracking
 	   --- 3.10 Special Rules
 	   --- 3.10 Special Rules
+	   --- 3.11 $(CC) support functions
 
 
 	=== 4 Host Program support
 	=== 4 Host Program support
 	   --- 4.1 Simple Host Program
 	   --- 4.1 Simple Host Program
@@ -38,7 +39,6 @@ This document describes the Linux kernel Makefiles.
 	   --- 6.6 Commands useful for building a boot image
 	   --- 6.6 Commands useful for building a boot image
 	   --- 6.7 Custom kbuild commands
 	   --- 6.7 Custom kbuild commands
 	   --- 6.8 Preprocessing linker scripts
 	   --- 6.8 Preprocessing linker scripts
-	   --- 6.9 $(CC) support functions
 
 
 	=== 7 Kbuild Variables
 	=== 7 Kbuild Variables
 	=== 8 Makefile language
 	=== 8 Makefile language
@@ -106,9 +106,9 @@ This document is aimed towards normal developers and arch developers.
 Most Makefiles within the kernel are kbuild Makefiles that use the
 Most Makefiles within the kernel are kbuild Makefiles that use the
 kbuild infrastructure. This chapter introduce the syntax used in the
 kbuild infrastructure. This chapter introduce the syntax used in the
 kbuild makefiles.
 kbuild makefiles.
-The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will
-continue to be supported. All new developmen is expected to use the
-Kbuild filename.
+The preferred name for the kbuild files are 'Makefile' but 'Kbuild' can
+be used and if both a 'Makefile' and a 'Kbuild' file exists then the 'Kbuild'
+file will be used.
 
 
 Section 3.1 "Goal definitions" is a quick intro, further chapters provide
 Section 3.1 "Goal definitions" is a quick intro, further chapters provide
 more details, with real examples.
 more details, with real examples.
@@ -385,6 +385,102 @@ more details, with real examples.
 	to prerequisites are referenced with $(src) (because they are not
 	to prerequisites are referenced with $(src) (because they are not
 	generated files).
 	generated files).
 
 
+--- 3.11 $(CC) support functions
+
+	The kernel may be build with several different versions of
+	$(CC), each supporting a unique set of features and options.
+	kbuild provide basic support to check for valid options for $(CC).
+	$(CC) is useally the gcc compiler, but other alternatives are
+	available.
+
+    as-option
+    	as-option is used to check if $(CC) when used to compile
+	assembler (*.S) files supports the given option. An optional
+	second option may be specified if first option are not supported.
+
+	Example:
+		#arch/sh/Makefile
+		cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),)
+
+	In the above example cflags-y will be assinged the the option
+	-Wa$(comma)-isa=$(isa-y) if it is supported by $(CC).
+	The second argument is optional, and if supplied will be used
+	if first argument is not supported.
+
+    cc-option
+	cc-option is used to check if $(CC) support a given option, and not
+	supported to use an optional second option.
+
+	Example:
+		#arch/i386/Makefile
+		cflags-y += $(call cc-option,-march=pentium-mmx,-march=i586)
+
+	In the above example cflags-y will be assigned the option
+	-march=pentium-mmx if supported by $(CC), otherwise -march-i586.
+	The second argument to cc-option is optional, and if omitted
+	cflags-y will be assigned no value if first option is not supported.
+
+   cc-option-yn
+   	cc-option-yn is used to check if gcc supports a given option
+	and return 'y' if supported, otherwise 'n'.
+
+	Example:
+		#arch/ppc/Makefile
+		biarch := $(call cc-option-yn, -m32)
+		aflags-$(biarch) += -a32
+		cflags-$(biarch) += -m32
+	
+	In the above example $(biarch) is set to y if $(CC) supports the -m32
+	option. When $(biarch) equals to y the expanded variables $(aflags-y)
+	and $(cflags-y) will be assigned the values -a32 and -m32.
+
+    cc-option-align
+	gcc version >= 3.0 shifted type of options used to speify
+	alignment of functions, loops etc. $(cc-option-align) whrn used
+	as prefix to the align options will select the right prefix:
+	gcc < 3.00
+		cc-option-align = -malign
+	gcc >= 3.00
+		cc-option-align = -falign
+	
+	Example:
+		CFLAGS += $(cc-option-align)-functions=4
+
+	In the above example the option -falign-functions=4 is used for
+	gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used.
+	
+    cc-version
+	cc-version return a numerical version of the $(CC) compiler version.
+	The format is <major><minor> where both are two digits. So for example
+	gcc 3.41 would return 0341.
+	cc-version is useful when a specific $(CC) version is faulty in one
+	area, for example the -mregparm=3 were broken in some gcc version
+	even though the option was accepted by gcc.
+
+	Example:
+		#arch/i386/Makefile
+		cflags-y += $(shell \
+		if [ $(call cc-version) -ge 0300 ] ; then \
+			echo "-mregparm=3"; fi ;)
+
+	In the above example -mregparm=3 is only used for gcc version greater
+	than or equal to gcc 3.0.
+
+    cc-ifversion
+	cc-ifversion test the version of $(CC) and equals last argument if
+	version expression is true.
+
+	Example:
+		#fs/reiserfs/Makefile
+		EXTRA_CFLAGS := $(call cc-ifversion, -lt, 0402, -O1)
+
+	In this example EXTRA_CFLAGS will be assigned the value -O1 if the
+	$(CC) version is less than 4.2.
+	cc-ifversion takes all the shell operators: 
+	-eq, -ne, -lt, -le, -gt, and -ge
+	The third parameter may be a text as in this example, but it may also
+	be an expanded variable or a macro.
+
 
 
 === 4 Host Program support
 === 4 Host Program support
 
 
@@ -973,74 +1069,6 @@ When kbuild executes the following steps are followed (roughly):
 	architecture specific files.
 	architecture specific files.
 
 
 
 
---- 6.9 $(CC) support functions
-
-	The kernel may be build with several different versions of
-	$(CC), each supporting a unique set of features and options.
-	kbuild provide basic support to check for valid options for $(CC).
-	$(CC) is useally the gcc compiler, but other alternatives are
-	available.
-
-    cc-option
-	cc-option is used to check if $(CC) support a given option, and not
-	supported to use an optional second option.
-
-	Example:
-		#arch/i386/Makefile
-		cflags-y += $(call cc-option,-march=pentium-mmx,-march=i586)
-
-	In the above example cflags-y will be assigned the option
-	-march=pentium-mmx if supported by $(CC), otherwise -march-i586.
-	The second argument to cc-option is optional, and if omitted
-	cflags-y will be assigned no value if first option is not supported.
-
-   cc-option-yn
-   	cc-option-yn is used to check if gcc supports a given option
-	and return 'y' if supported, otherwise 'n'.
-
-	Example:
-		#arch/ppc/Makefile
-		biarch := $(call cc-option-yn, -m32)
-		aflags-$(biarch) += -a32
-		cflags-$(biarch) += -m32
-	
-	In the above example $(biarch) is set to y if $(CC) supports the -m32
-	option. When $(biarch) equals to y the expanded variables $(aflags-y)
-	and $(cflags-y) will be assigned the values -a32 and -m32.
-
-    cc-option-align
-	gcc version >= 3.0 shifted type of options used to speify
-	alignment of functions, loops etc. $(cc-option-align) whrn used
-	as prefix to the align options will select the right prefix:
-	gcc < 3.00
-		cc-option-align = -malign
-	gcc >= 3.00
-		cc-option-align = -falign
-	
-	Example:
-		CFLAGS += $(cc-option-align)-functions=4
-
-	In the above example the option -falign-functions=4 is used for
-	gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used.
-	
-    cc-version
-	cc-version return a numerical version of the $(CC) compiler version.
-	The format is <major><minor> where both are two digits. So for example
-	gcc 3.41 would return 0341.
-	cc-version is useful when a specific $(CC) version is faulty in one
-	area, for example the -mregparm=3 were broken in some gcc version
-	even though the option was accepted by gcc.
-
-	Example:
-		#arch/i386/Makefile
-		cflags-y += $(shell \
-		if [ $(call cc-version) -ge 0300 ] ; then \
-			echo "-mregparm=3"; fi ;)
-
-	In the above example -mregparm=3 is only used for gcc version greater
-	than or equal to gcc 3.0.
-	
-
 === 7 Kbuild Variables
 === 7 Kbuild Variables
 
 
 The top Makefile exports the following variables:
 The top Makefile exports the following variables:

+ 91 - 7
Documentation/kbuild/modules.txt

@@ -13,6 +13,7 @@ In this document you will find information about:
 	   --- 2.2 Available targets
 	   --- 2.2 Available targets
 	   --- 2.3 Available options
 	   --- 2.3 Available options
 	   --- 2.4 Preparing the kernel tree for module build
 	   --- 2.4 Preparing the kernel tree for module build
+	   --- 2.5 Building separate files for a module
 	=== 3. Example commands
 	=== 3. Example commands
 	=== 4. Creating a kbuild file for an external module
 	=== 4. Creating a kbuild file for an external module
 	=== 5. Include files
 	=== 5. Include files
@@ -22,7 +23,10 @@ In this document you will find information about:
 	=== 6. Module installation
 	=== 6. Module installation
 	   --- 6.1 INSTALL_MOD_PATH
 	   --- 6.1 INSTALL_MOD_PATH
 	   --- 6.2 INSTALL_MOD_DIR
 	   --- 6.2 INSTALL_MOD_DIR
-	=== 7. Module versioning
+	=== 7. Module versioning & Module.symvers
+	   --- 7.1 Symbols fron the kernel (vmlinux + modules)
+	   --- 7.2 Symbols and external modules
+	   --- 7.3 Symbols from another external module
 	=== 8. Tips & Tricks
 	=== 8. Tips & Tricks
 	   --- 8.1 Testing for CONFIG_FOO_BAR
 	   --- 8.1 Testing for CONFIG_FOO_BAR
 
 
@@ -88,7 +92,8 @@ when building an external module.
 	make -C $KDIR M=$PWD modules_install
 	make -C $KDIR M=$PWD modules_install
 		Install the external module(s).
 		Install the external module(s).
 		Installation default is in /lib/modules/<kernel-version>/extra,
 		Installation default is in /lib/modules/<kernel-version>/extra,
-		but may be prefixed with INSTALL_MOD_PATH - see separate chapter.
+		but may be prefixed with INSTALL_MOD_PATH - see separate
+		chapter.
 
 
 	make -C $KDIR M=$PWD clean
 	make -C $KDIR M=$PWD clean
 		Remove all generated files for the module - the kernel
 		Remove all generated files for the module - the kernel
@@ -131,6 +136,16 @@ when building an external module.
 	      Therefore a full kernel build needs to be executed to make
 	      Therefore a full kernel build needs to be executed to make
 	      module versioning work.
 	      module versioning work.
 
 
+--- 2.5 Building separate files for a module
+	It is possible to build single files which is part of a module.
+	This works equal for the kernel, a module and even for external
+	modules.
+	Examples (module foo.ko, consist of bar.o, baz.o):
+		make -C $KDIR M=`pwd` bar.lst
+		make -C $KDIR M=`pwd` bar.o
+		make -C $KDIR M=`pwd` foo.ko
+		make -C $KDIR M=`pwd` /
+	
 
 
 === 3. Example commands
 === 3. Example commands
 
 
@@ -422,7 +437,7 @@ External modules are installed in the directory:
 		=> Install dir: /lib/modules/$(KERNELRELEASE)/gandalf
 		=> Install dir: /lib/modules/$(KERNELRELEASE)/gandalf
 
 
 
 
-=== 7. Module versioning
+=== 7. Module versioning & Module.symvers
 
 
 Module versioning is enabled by the CONFIG_MODVERSIONS tag.
 Module versioning is enabled by the CONFIG_MODVERSIONS tag.
 
 
@@ -432,11 +447,80 @@ when a module is loaded/used then the CRC values contained in the kernel are
 compared with similar values in the module. If they are not equal then the
 compared with similar values in the module. If they are not equal then the
 kernel refuses to load the module.
 kernel refuses to load the module.
 
 
-During a kernel build a file named Module.symvers will be generated. This
-file includes the symbol version of all symbols within the kernel. If the 
-Module.symvers file is saved from the last full kernel compile one does not
-have to do a full kernel compile to build a module version's compatible module.
+Module.symvers contains a list of all exported symbols from a kernel build.
+
+--- 7.1 Symbols fron the kernel (vmlinux + modules)
+
+	During a kernel build a file named Module.symvers will be generated.
+	Module.symvers contains all exported symbols from the kernel and
+	compiled modules. For each symbols the corresponding CRC value
+	is stored too.
+
+	The syntax of the Module.symvers file is:
+		<CRC>       <Symbol>           <module>
+	Sample:
+		0x2d036834  scsi_remove_host   drivers/scsi/scsi_mod
 
 
+	For a kernel build without CONFIG_MODVERSIONING enabled the crc
+	would read: 0x00000000
+
+	Module.symvers serve two purposes.
+	1) It list all exported symbols both from vmlinux and all modules
+	2) It list CRC if CONFIG_MODVERSION is enabled
+
+--- 7.2 Symbols and external modules
+
+	When building an external module the build system needs access to
+	the symbols from the kernel to check if all external symbols are
+	defined. This is done in the MODPOST step and to obtain all
+	symbols modpost reads Module.symvers from the kernel.
+	If a Module.symvers file is present in the directory where
+	the external module is being build this file will be read too.
+	During the MODPOST step a new Module.symvers file will be written
+	containing all exported symbols that was not defined in the kernel.
+	
+--- 7.3 Symbols from another external module
+
+	Sometimes one external module uses exported symbols from another
+	external module. Kbuild needs to have full knowledge on all symbols
+	to avoid spitting out warnings about undefined symbols.
+	Two solutions exist to let kbuild know all symbols of more than
+	one external module.
+	The method with a top-level kbuild file is recommended but may be
+	impractical in certain situations.
+
+	Use a top-level Kbuild file
+		If you have two modules: 'foo', 'bar' and 'foo' needs symbols
+		from 'bar' then one can use a common top-level kbuild file so
+		both modules are compiled in same build.
+
+		Consider following directory layout:
+		./foo/ <= contains the foo module
+		./bar/ <= contains the bar module
+		The top-level Kbuild file would then look like:
+		
+		#./Kbuild: (this file may also be named Makefile)
+			obj-y := foo/ bar/
+
+		Executing:
+			make -C $KDIR M=`pwd`
+
+		will then do the expected and compile both modules with full
+		knowledge on symbols from both modules.
+
+	Use an extra Module.symvers file
+		When an external module is build a Module.symvers file is
+		generated containing all exported symbols which are not
+		defined in the kernel.
+		To get access to symbols from module 'bar' one can copy the
+		Module.symvers file from the compilation of the 'bar' module
+		to the directory where the 'foo' module is build.
+		During the module build kbuild will read the Module.symvers
+		file in the directory of the external module and when the
+		build is finished a new Module.symvers file is created
+		containing the sum of all symbols defined and not part of the
+		kernel.
+		
 === 8. Tips & Tricks
 === 8. Tips & Tricks
 
 
 --- 8.1 Testing for CONFIG_FOO_BAR
 --- 8.1 Testing for CONFIG_FOO_BAR

+ 0 - 4
Documentation/smart-config.txt

@@ -56,10 +56,6 @@ Here is the solution:
     writing one file per option.  It updates only the files for options
     writing one file per option.  It updates only the files for options
     that have changed.
     that have changed.
 
 
-    mkdep.c no longer generates warning messages for missing or unneeded
-    <linux/config.h> lines.  The new top-level target 'make checkconfig'
-    checks for these problems.
-
 Flag Dependencies
 Flag Dependencies
 
 
     Martin Von Loewis contributed another feature to this patch:
     Martin Von Loewis contributed another feature to this patch:

+ 99 - 98
Makefile

@@ -95,7 +95,7 @@ ifdef O
 endif
 endif
 
 
 # That's our default target when none is given on the command line
 # That's our default target when none is given on the command line
-.PHONY: _all
+PHONY := _all
 _all:
 _all:
 
 
 ifneq ($(KBUILD_OUTPUT),)
 ifneq ($(KBUILD_OUTPUT),)
@@ -106,7 +106,7 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
 $(if $(KBUILD_OUTPUT),, \
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))
      $(error output directory "$(saved-output)" does not exist))
 
 
-.PHONY: $(MAKECMDGOALS)
+PHONY += $(MAKECMDGOALS)
 
 
 $(filter-out _all,$(MAKECMDGOALS)) _all:
 $(filter-out _all,$(MAKECMDGOALS)) _all:
 	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
 	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
@@ -123,7 +123,7 @@ ifeq ($(skip-makefile),)
 
 
 # If building an external module we do not care about the all: rule
 # If building an external module we do not care about the all: rule
 # but instead _all depend on modules
 # but instead _all depend on modules
-.PHONY: all
+PHONY += all
 ifeq ($(KBUILD_EXTMOD),)
 ifeq ($(KBUILD_EXTMOD),)
 _all: all
 _all: all
 else
 else
@@ -137,7 +137,7 @@ objtree		:= $(CURDIR)
 src		:= $(srctree)
 src		:= $(srctree)
 obj		:= $(objtree)
 obj		:= $(objtree)
 
 
-VPATH		:= $(srctree)
+VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
 
 export srctree objtree VPATH TOPDIR
 export srctree objtree VPATH TOPDIR
 
 
@@ -151,7 +151,7 @@ export srctree objtree VPATH TOPDIR
 SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 				  -e s/arm.*/arm/ -e s/sa110/arm/ \
 				  -e s/arm.*/arm/ -e s/sa110/arm/ \
 				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
 				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
-				  -e s/ppc.*/powerpc/ )
+				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
 
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
@@ -258,38 +258,6 @@ endif
 
 
 export quiet Q KBUILD_VERBOSE
 export quiet Q KBUILD_VERBOSE
 
 
-######
-# cc support functions to be used (only) in arch/$(ARCH)/Makefile
-# See documentation in Documentation/kbuild/makefiles.txt
-
-# as-option
-# Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,)
-
-as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
-	     -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
-	     else echo "$(2)"; fi ;)
-
-# cc-option
-# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
-
-cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
-             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
-
-# cc-option-yn
-# Usage: flag := $(call cc-option-yn, -march=winchip-c6)
-cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
-                > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
-
-# cc-option-align
-# Prefix align with either -falign or -malign
-cc-option-align = $(subst -functions=0,,\
-	$(call cc-option,-falign-functions=0,-malign-functions=0))
-
-# cc-version
-# Usage gcc-ver := $(call cc-version $(CC))
-cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
-              $(if $(1), $(1), $(CC)))
-
 
 
 # Look for make include files relative to root of kernel src
 # Look for make include files relative to root of kernel src
 MAKEFLAGS += --include-dir=$(srctree)
 MAKEFLAGS += --include-dir=$(srctree)
@@ -369,14 +337,14 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
 # Rules shared between *config targets and build targets
 # Rules shared between *config targets and build targets
 
 
 # Basic helpers built in scripts/
 # Basic helpers built in scripts/
-.PHONY: scripts_basic
+PHONY += scripts_basic
 scripts_basic:
 scripts_basic:
 	$(Q)$(MAKE) $(build)=scripts/basic
 	$(Q)$(MAKE) $(build)=scripts/basic
 
 
 # To avoid any implicit rule to kick in, define an empty command.
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 scripts/basic/%: scripts_basic ;
 
 
-.PHONY: outputmakefile
+PHONY += outputmakefile
 # outputmakefile generate a Makefile to be placed in output directory, if
 # outputmakefile generate a Makefile to be placed in output directory, if
 # using a seperate output directory. This allows convinient use
 # using a seperate output directory. This allows convinient use
 # of make in output directory
 # of make in output directory
@@ -452,7 +420,7 @@ ifeq ($(KBUILD_EXTMOD),)
 # Additional helpers built in scripts/
 # Additional helpers built in scripts/
 # Carefully list dependencies so we do not try to build scripts twice
 # Carefully list dependencies so we do not try to build scripts twice
 # in parrallel
 # in parrallel
-.PHONY: scripts
+PHONY += scripts
 scripts: scripts_basic include/config/MARKER
 scripts: scripts_basic include/config/MARKER
 	$(Q)$(MAKE) $(build)=$(@)
 	$(Q)$(MAKE) $(build)=$(@)
 
 
@@ -504,13 +472,6 @@ else
 CFLAGS		+= -O2
 CFLAGS		+= -O2
 endif
 endif
 
 
-#Add align options if CONFIG_CC_* is not equal to 0
-add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1)))
-CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions)
-CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels)
-CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops)
-CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
-
 ifdef CONFIG_FRAME_POINTER
 ifdef CONFIG_FRAME_POINTER
 CFLAGS		+= -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
 CFLAGS		+= -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
 else
 else
@@ -756,7 +717,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
 # make menuconfig etc.
 # make menuconfig etc.
 # Error messages still appears in the original language
 # Error messages still appears in the original language
 
 
-.PHONY: $(vmlinux-dirs)
+PHONY += $(vmlinux-dirs)
 $(vmlinux-dirs): prepare scripts
 $(vmlinux-dirs): prepare scripts
 	$(Q)$(MAKE) $(build)=$@
 	$(Q)$(MAKE) $(build)=$@
 
 
@@ -809,10 +770,10 @@ kernelrelease = $(KERNELVERSION)$(localver-full)
 # version.h and scripts_basic is processed / created.
 # version.h and scripts_basic is processed / created.
 
 
 # Listed in dependency order
 # Listed in dependency order
-.PHONY: prepare archprepare prepare0 prepare1 prepare2 prepare3
+PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
 
 
 # prepare-all is deprecated, use prepare as valid replacement
 # prepare-all is deprecated, use prepare as valid replacement
-.PHONY: prepare-all
+PHONY += prepare-all
 
 
 # prepare3 is used to check if we are building in a separate output directory,
 # prepare3 is used to check if we are building in a separate output directory,
 # and if so do:
 # and if so do:
@@ -853,27 +814,6 @@ prepare prepare-all: prepare0
 
 
 export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
 export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
 
 
-# Single targets
-# ---------------------------------------------------------------------------
-
-%.s: %.c scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-%.i: %.c scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-%.o: %.c scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-%.ko: scripts FORCE
-	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) $(@:.ko=.o)
-	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
-%/:      scripts prepare FORCE
-	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D)
-%.lst: %.c scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-%.s: %.S scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-%.o: %.S scripts FORCE
-	$(Q)$(MAKE) $(build)=$(@D) $@
-
 # 	FIXME: The asm symlink changes when $(ARCH) changes. That's
 # 	FIXME: The asm symlink changes when $(ARCH) changes. That's
 #	hard to detect, but I suppose "make mrproper" is a good idea
 #	hard to detect, but I suppose "make mrproper" is a good idea
 #	before switching between archs anyway.
 #	before switching between archs anyway.
@@ -914,7 +854,7 @@ include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE
 
 
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 
 
-.PHONY: depend dep
+PHONY += depend dep
 depend dep:
 depend dep:
 	@echo '*** Warning: make $@ is unnecessary now.'
 	@echo '*** Warning: make $@ is unnecessary now.'
 
 
@@ -929,21 +869,21 @@ all: modules
 
 
 #	Build modules
 #	Build modules
 
 
-.PHONY: modules
+PHONY += modules
 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
 	@echo '  Building modules, stage 2.';
 	@echo '  Building modules, stage 2.';
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 
 
 
 
 # Target to prepare building external modules
 # Target to prepare building external modules
-.PHONY: modules_prepare
+PHONY += modules_prepare
 modules_prepare: prepare scripts
 modules_prepare: prepare scripts
 
 
 # Target to install modules
 # Target to install modules
-.PHONY: modules_install
+PHONY += modules_install
 modules_install: _modinst_ _modinst_post
 modules_install: _modinst_ _modinst_post
 
 
-.PHONY: _modinst_
+PHONY += _modinst_
 _modinst_:
 _modinst_:
 	@if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
 	@if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \
 		echo "Warning: you may need to install module-init-tools"; \
 		echo "Warning: you may need to install module-init-tools"; \
@@ -970,7 +910,7 @@ depmod_opts	:=
 else
 else
 depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
 depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
 endif
 endif
-.PHONY: _modinst_post
+PHONY += _modinst_post
 _modinst_post: _modinst_
 _modinst_post: _modinst_
 	if [ -r System.map -a -x $(DEPMOD) ]; 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
 
 
@@ -1013,7 +953,7 @@ clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
 clean: rm-files := $(CLEAN_FILES)
 clean-dirs      := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
 clean-dirs      := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
 
 
-.PHONY: $(clean-dirs) clean archclean
+PHONY += $(clean-dirs) clean archclean
 $(clean-dirs):
 $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
 
@@ -1031,7 +971,7 @@ mrproper: rm-dirs  := $(wildcard $(MRPROPER_DIRS))
 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
 mrproper-dirs      := $(addprefix _mrproper_,Documentation/DocBook scripts)
 mrproper-dirs      := $(addprefix _mrproper_,Documentation/DocBook scripts)
 
 
-.PHONY: $(mrproper-dirs) mrproper archmrproper
+PHONY += $(mrproper-dirs) mrproper archmrproper
 $(mrproper-dirs):
 $(mrproper-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
 	$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
 
 
@@ -1041,7 +981,7 @@ mrproper: clean archmrproper $(mrproper-dirs)
 
 
 # distclean
 # distclean
 #
 #
-.PHONY: distclean
+PHONY += distclean
 
 
 distclean: mrproper
 distclean: mrproper
 	@find $(srctree) $(RCS_FIND_IGNORE) \
 	@find $(srctree) $(RCS_FIND_IGNORE) \
@@ -1057,12 +997,10 @@ distclean: mrproper
 # rpm target kept for backward compatibility
 # rpm target kept for backward compatibility
 package-dir	:= $(srctree)/scripts/package
 package-dir	:= $(srctree)/scripts/package
 
 
-.PHONY: %-pkg rpm
-
 %pkg: FORCE
 %pkg: FORCE
-	$(Q)$(MAKE) -f $(package-dir)/Makefile $@
+	$(Q)$(MAKE) $(build)=$(package-dir) $@
 rpm: FORCE
 rpm: FORCE
-	$(Q)$(MAKE) -f $(package-dir)/Makefile $@
+	$(Q)$(MAKE) $(build)=$(package-dir) $@
 
 
 
 
 # Brief documentation of the typical targets used
 # Brief documentation of the typical targets used
@@ -1094,13 +1032,11 @@ help:
 	@echo  '  kernelversion	  - Output the version stored in Makefile'
 	@echo  '  kernelversion	  - Output the version stored in Makefile'
 	@echo  ''
 	@echo  ''
 	@echo  'Static analysers'
 	@echo  'Static analysers'
-	@echo  '  buildcheck      - List dangling references to vmlinux discarded sections'
-	@echo  '                    and init sections from non-init sections'
 	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  '  checkstack      - Generate a list of stack hogs'
 	@echo  '  namespacecheck  - Name space analysis on compiled kernel'
 	@echo  '  namespacecheck  - Name space analysis on compiled kernel'
 	@echo  ''
 	@echo  ''
 	@echo  'Kernel packaging:'
 	@echo  'Kernel packaging:'
-	@$(MAKE) -f $(package-dir)/Makefile help
+	@$(MAKE) $(build)=$(package-dir) help
 	@echo  ''
 	@echo  ''
 	@echo  'Documentation targets:'
 	@echo  'Documentation targets:'
 	@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
 	@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
@@ -1149,11 +1085,12 @@ else # KBUILD_EXTMOD
 
 
 # We are always building modules
 # We are always building modules
 KBUILD_MODULES := 1
 KBUILD_MODULES := 1
-.PHONY: crmodverdir
+PHONY += crmodverdir
 crmodverdir:
 crmodverdir:
+	$(Q)rm -rf $(MODVERDIR)
 	$(Q)mkdir -p $(MODVERDIR)
 	$(Q)mkdir -p $(MODVERDIR)
 
 
-.PHONY: $(objtree)/Module.symvers
+PHONY += $(objtree)/Module.symvers
 $(objtree)/Module.symvers:
 $(objtree)/Module.symvers:
 	@test -e $(objtree)/Module.symvers || ( \
 	@test -e $(objtree)/Module.symvers || ( \
 	echo; \
 	echo; \
@@ -1162,7 +1099,7 @@ $(objtree)/Module.symvers:
 	echo )
 	echo )
 
 
 module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
 module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
-.PHONY: $(module-dirs) modules
+PHONY += $(module-dirs) modules
 $(module-dirs): crmodverdir $(objtree)/Module.symvers
 $(module-dirs): crmodverdir $(objtree)/Module.symvers
 	$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 	$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 
 
@@ -1170,13 +1107,32 @@ modules: $(module-dirs)
 	@echo '  Building modules, stage 2.';
 	@echo '  Building modules, stage 2.';
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 
 
-.PHONY: modules_install
-modules_install:
+PHONY += modules_install
+modules_install: _emodinst_ _emodinst_post
+
+install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
+PHONY += _emodinst_
+_emodinst_:
+	$(Q)rm -rf $(MODLIB)/$(install-dir)
+	$(Q)mkdir -p $(MODLIB)/$(install-dir)
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 
 
+# Run depmod only is we have System.map and depmod is executable
+quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
+      cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
+                      $(DEPMOD) -ae -F System.map             \
+                      $(if $(strip $(INSTALL_MOD_PATH)),      \
+		      -b $(INSTALL_MOD_PATH) -r)              \
+		      $(KERNELRELEASE);                       \
+                   fi
+
+PHONY += _emodinst_post
+_emodinst_post: _emodinst_
+	$(call cmd,depmod)
+
 clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
 clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
 
 
-.PHONY: $(clean-dirs) clean
+PHONY += $(clean-dirs) clean
 $(clean-dirs):
 $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
 
@@ -1196,6 +1152,11 @@ help:
 	@echo  '  modules_install - install the module'
 	@echo  '  modules_install - install the module'
 	@echo  '  clean           - remove generated files in module directory only'
 	@echo  '  clean           - remove generated files in module directory only'
 	@echo  ''
 	@echo  ''
+
+# Dummies...
+PHONY += prepare scripts
+prepare: ;
+scripts: ;
 endif # KBUILD_EXTMOD
 endif # KBUILD_EXTMOD
 
 
 # Generate tags for editors
 # Generate tags for editors
@@ -1296,17 +1257,13 @@ versioncheck:
 		-name '*.[hcS]' -type f -print | sort \
 		-name '*.[hcS]' -type f -print | sort \
 		| xargs $(PERL) -w scripts/checkversion.pl
 		| xargs $(PERL) -w scripts/checkversion.pl
 
 
-buildcheck:
-	$(PERL) $(srctree)/scripts/reference_discarded.pl
-	$(PERL) $(srctree)/scripts/reference_init.pl
-
 namespacecheck:
 namespacecheck:
 	$(PERL) $(srctree)/scripts/namespace.pl
 	$(PERL) $(srctree)/scripts/namespace.pl
 
 
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
 endif #ifeq ($(mixed-targets),1)
 
 
-.PHONY: checkstack
+PHONY += checkstack
 checkstack:
 checkstack:
 	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
 	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
 	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
@@ -1317,6 +1274,44 @@ kernelrelease:
 kernelversion:
 kernelversion:
 	@echo $(KERNELVERSION)
 	@echo $(KERNELVERSION)
 
 
+# Single targets
+# ---------------------------------------------------------------------------
+# The directory part is taken from first prerequisite, so this
+# works even with external modules
+%.s: %.c prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+%.i: %.c prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+%.o: %.c prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+%.lst: %.c prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+%.s: %.S prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+%.o: %.S prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
+
+# For external modules we shall include any directory of the target,
+# but usual case there is no directory part.
+# make M=`pwd` module.o     => $(dir $@)=./
+# make M=`pwd` foo/module.o => $(dir $@)=foo/
+# make M=`pwd` /            => $(dir $@)=/
+ 
+ifeq ($(KBUILD_EXTMOD),)
+        target-dir = $(@D)
+else
+        zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
+        target-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
+endif
+
+/ %/:      scripts prepare FORCE
+	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+	$(build)=$(target-dir)
+%.ko: scripts FORCE
+	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
+	$(build)=$(target-dir) $(@:.ko=.o)
+	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
+
 # FIXME Should go into a make.lib or something 
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
 # ===========================================================================
 
 
@@ -1351,4 +1346,10 @@ clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
 
 
 endif	# skip-makefile
 endif	# skip-makefile
 
 
+PHONY += FORCE
 FORCE:
 FORCE:
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+.PHONY: $(PHONY)

+ 4 - 1
arch/arm/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # arch/arm/Makefile
 # arch/arm/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -177,7 +180,7 @@ endif
 
 
 archprepare: maketools
 archprepare: maketools
 
 
-.PHONY: maketools FORCE
+PHONY += maketools FORCE
 maketools: include/linux/version.h include/asm-arm/.arch FORCE
 maketools: include/linux/version.h include/asm-arm/.arch FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
 	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
 
 

+ 4 - 1
arch/arm/boot/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # arch/arm/boot/Makefile
 # arch/arm/boot/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -73,7 +76,7 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
 	$(call if_changed,objcopy)
 	$(call if_changed,objcopy)
 	@echo '  Kernel: $@ is ready'
 	@echo '  Kernel: $@ is ready'
 
 
-.PHONY: initrd FORCE
+PHONY += initrd FORCE
 initrd:
 initrd:
 	@test "$(INITRD_PHYS)" != "" || \
 	@test "$(INITRD_PHYS)" != "" || \
 	(echo This machine does not support INITRD; exit -1)
 	(echo This machine does not support INITRD; exit -1)

+ 4 - 1
arch/arm/boot/bootp/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # linux/arch/arm/boot/bootp/Makefile
 # linux/arch/arm/boot/bootp/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 
 
 LDFLAGS_bootp	:=-p --no-undefined -X \
 LDFLAGS_bootp	:=-p --no-undefined -X \
 		 --defsym initrd_phys=$(INITRD_PHYS) \
 		 --defsym initrd_phys=$(INITRD_PHYS) \
@@ -21,4 +24,4 @@ $(obj)/kernel.o: arch/arm/boot/zImage FORCE
 
 
 $(obj)/initrd.o: $(INITRD) FORCE
 $(obj)/initrd.o: $(INITRD) FORCE
 
 
-.PHONY:	$(INITRD) FORCE
+PHONY += $(INITRD) FORCE

+ 5 - 2
arch/arm26/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # arch/arm26/Makefile
 # arch/arm26/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -49,9 +52,9 @@ all: zImage
 
 
 boot := arch/arm26/boot
 boot := arch/arm26/boot
 
 
-.PHONY: maketools FORCE
+PHONY += maketools FORCE
 maketools: FORCE
 maketools: FORCE
-	
+
 
 
 # Convert bzImage to zImage
 # Convert bzImage to zImage
 bzImage: vmlinux
 bzImage: vmlinux

+ 4 - 1
arch/arm26/boot/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # arch/arm26/boot/Makefile
 # arch/arm26/boot/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -60,7 +63,7 @@ $(obj)/xipImage: vmlinux FORCE
 	@echo '  Kernel: $@ is ready'
 	@echo '  Kernel: $@ is ready'
 endif
 endif
 
 
-.PHONY: initrd
+PHONY += initrd
 initrd:
 initrd:
 	@test "$(INITRD_PHYS)" != "" || \
 	@test "$(INITRD_PHYS)" != "" || \
 	(echo This machine does not support INITRD; exit -1)
 	(echo This machine does not support INITRD; exit -1)

+ 2 - 2
arch/i386/Makefile

@@ -99,8 +99,8 @@ AFLAGS += $(mflags-y)
 
 
 boot := arch/i386/boot
 boot := arch/i386/boot
 
 
-.PHONY: zImage bzImage compressed zlilo bzlilo \
-	zdisk bzdisk fdimage fdimage144 fdimage288 install
+PHONY += zImage bzImage compressed zlilo bzlilo \
+         zdisk bzdisk fdimage fdimage144 fdimage288 install
 
 
 all: bzImage
 all: bzImage
 
 

+ 2 - 1
arch/i386/kernel/vmlinux.lds.S

@@ -7,6 +7,7 @@
 #include <asm-generic/vmlinux.lds.h>
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/thread_info.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
 #include <asm/page.h>
+#include <asm/cache.h>
 
 
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
 OUTPUT_ARCH(i386)
@@ -135,7 +136,7 @@ SECTIONS
   __initramfs_start = .;
   __initramfs_start = .;
   .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
   .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
   __initramfs_end = .;
   __initramfs_end = .;
-  . = ALIGN(32);
+  . = ALIGN(L1_CACHE_BYTES);
   __per_cpu_start = .;
   __per_cpu_start = .;
   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
   __per_cpu_end = .;
   __per_cpu_end = .;

+ 4 - 1
arch/ia64/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # ia64/Makefile
 # ia64/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -62,7 +65,7 @@ drivers-$(CONFIG_OPROFILE)	+= arch/ia64/oprofile/
 
 
 boot := arch/ia64/hp/sim/boot
 boot := arch/ia64/hp/sim/boot
 
 
-.PHONY: boot compressed check
+PHONY += boot compressed check
 
 
 all: compressed unwcheck
 all: compressed unwcheck
 
 

+ 4 - 1
arch/m32r/Makefile

@@ -1,6 +1,9 @@
 #
 #
 # m32r/Makefile
 # m32r/Makefile
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 
 
 LDFLAGS		:=
 LDFLAGS		:=
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
@@ -39,7 +42,7 @@ drivers-$(CONFIG_OPROFILE)	+= arch/m32r/oprofile/
 
 
 boot := arch/m32r/boot
 boot := arch/m32r/boot
 
 
-.PHONY: zImage
+PHONY += zImage
 
 
 all: zImage
 all: zImage
 
 

+ 1 - 1
arch/powerpc/Makefile

@@ -150,7 +150,7 @@ CPPFLAGS_vmlinux.lds	:= -Upowerpc
 
 
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage vmlinux.bin
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage vmlinux.bin
 
 
-.PHONY: $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS)
 
 
 boot := arch/$(ARCH)/boot
 boot := arch/$(ARCH)/boot
 
 

+ 1 - 1
arch/ppc/Makefile

@@ -82,7 +82,7 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
 
 
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
 
 
-.PHONY: $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS)
 
 
 all: uImage zImage
 all: uImage zImage
 
 

+ 7 - 1
arch/ppc/boot/Makefile

@@ -1,3 +1,9 @@
+#
+# arch/ppc/boot/Makefile
+#
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # This file is subject to the terms and conditions of the GNU General Public
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 # for more details.
@@ -22,7 +28,7 @@ subdir-				+= simple openfirmware
 
 
 hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree)
 hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree)
 
 
-.PHONY: $(BOOT_TARGETS) $(bootdir-y)
+PHONY += $(BOOT_TARGETS) $(bootdir-y)
 
 
 $(BOOT_TARGETS): $(bootdir-y)
 $(BOOT_TARGETS): $(bootdir-y)
 
 

+ 5 - 2
arch/ppc/boot/openfirmware/Makefile

@@ -1,5 +1,8 @@
 # Makefile for making bootable images on various OpenFirmware machines.
 # Makefile for making bootable images on various OpenFirmware machines.
 #
 #
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # Paul Mackerras	January 1997
 # Paul Mackerras	January 1997
 #	XCOFF bootable images for PowerMacs
 #	XCOFF bootable images for PowerMacs
 # Geert Uytterhoeven	September 1997
 # Geert Uytterhoeven	September 1997
@@ -86,7 +89,7 @@ $(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
 
 
 # The targets used on the make command-line
 # The targets used on the make command-line
 
 
-.PHONY: zImage zImage.initrd
+PHONY += zImage zImage.initrd
 zImage:		 $(images)/zImage.chrp		\
 zImage:		 $(images)/zImage.chrp		\
 		 $(images)/zImage.chrp-rs6k
 		 $(images)/zImage.chrp-rs6k
 	@echo '  kernel: $@ is ready ($<)'
 	@echo '  kernel: $@ is ready ($<)'
@@ -96,7 +99,7 @@ zImage.initrd:	 $(images)/zImage.initrd.chrp		\
 
 
 TFTPIMAGE	:= /tftpboot/zImage
 TFTPIMAGE	:= /tftpboot/zImage
 
 
-.PHONY: znetboot znetboot.initrd
+PHONY += znetboot znetboot.initrd
 znetboot:	$(images)/zImage.chrp
 znetboot:	$(images)/zImage.chrp
 	cp $(images)/zImage.chrp      $(TFTPIMAGE).chrp$(END)
 	cp $(images)/zImage.chrp      $(TFTPIMAGE).chrp$(END)
 	@echo '  kernel: $@ is ready ($<)'
 	@echo '  kernel: $@ is ready ($<)'

+ 1 - 1
arch/sh/Makefile

@@ -172,7 +172,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER
 
 
 archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
 archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
 
 
-.PHONY: maketools FORCE
+PHONY += maketools FORCE
 maketools:  include/linux/version.h FORCE
 maketools:  include/linux/version.h FORCE
 	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 

+ 5 - 2
arch/um/Makefile

@@ -1,4 +1,7 @@
-# 
+#
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
 # Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
 # Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
 # Licensed under the GPL
 # Licensed under the GPL
 #
 #
@@ -88,7 +91,7 @@ CONFIG_KERNEL_HALF_GIGS ?= 0
 
 
 SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
 SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
 
 
-.PHONY: linux
+PHONY += linux
 
 
 all: linux
 all: linux
 
 

+ 2 - 2
arch/x86_64/Makefile

@@ -67,8 +67,8 @@ drivers-$(CONFIG_OPROFILE)		+= arch/x86_64/oprofile/
 
 
 boot := arch/x86_64/boot
 boot := arch/x86_64/boot
 
 
-.PHONY: bzImage bzlilo install archmrproper \
-	fdimage fdimage144 fdimage288 archclean
+PHONY += bzImage bzlilo install archmrproper \
+	 fdimage fdimage144 fdimage288 archclean
 
 
 #Default target when executing "make"
 #Default target when executing "make"
 all: bzImage
 all: bzImage

+ 5 - 0
drivers/atm/.gitignore

@@ -0,0 +1,5 @@
+# Ignore generated files
+fore200e_mkfirm
+fore200e_pca_fw.c
+pca200e.bin
+

+ 0 - 1
drivers/video/matrox/matroxfb_DAC1064.c

@@ -12,7 +12,6 @@
  *
  *
  */
  */
 
 
-/* make checkconfig does not walk through include tree :-( */
 #include <linux/config.h>
 #include <linux/config.h>
 
 
 #include "matroxfb_DAC1064.h"
 #include "matroxfb_DAC1064.h"

+ 0 - 1
drivers/video/matrox/matroxfb_DAC1064.h

@@ -1,7 +1,6 @@
 #ifndef __MATROXFB_DAC1064_H__
 #ifndef __MATROXFB_DAC1064_H__
 #define __MATROXFB_DAC1064_H__
 #define __MATROXFB_DAC1064_H__
 
 
-/* make checkconfig does not walk through include tree */
 #include <linux/config.h>
 #include <linux/config.h>
 
 
 #include "matroxfb_base.h"
 #include "matroxfb_base.h"

+ 0 - 1
drivers/video/matrox/matroxfb_Ti3026.c

@@ -78,7 +78,6 @@
  *
  *
  */
  */
 
 
-/* make checkconfig does not verify included files... */
 #include <linux/config.h>
 #include <linux/config.h>
 
 
 #include "matroxfb_Ti3026.h"
 #include "matroxfb_Ti3026.h"

+ 0 - 1
drivers/video/matrox/matroxfb_Ti3026.h

@@ -1,7 +1,6 @@
 #ifndef __MATROXFB_TI3026_H__
 #ifndef __MATROXFB_TI3026_H__
 #define __MATROXFB_TI3026_H__
 #define __MATROXFB_TI3026_H__
 
 
-/* make checkconfig does not walk through whole include tree */
 #include <linux/config.h>
 #include <linux/config.h>
 
 
 #include "matroxfb_base.h"
 #include "matroxfb_base.h"

+ 0 - 1
drivers/video/matrox/matroxfb_base.c

@@ -99,7 +99,6 @@
  *
  *
  */
  */
 
 
-/* make checkconfig does not check included files... */
 #include <linux/config.h>
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/version.h>
 
 

+ 0 - 1
drivers/video/matrox/matroxfb_misc.c

@@ -84,7 +84,6 @@
  *
  *
  */
  */
 
 
-/* make checkconfig does not check includes for this... */
 #include <linux/config.h>
 #include <linux/config.h>
 
 
 #include "matroxfb_misc.h"
 #include "matroxfb_misc.h"

+ 0 - 37
init/Kconfig

@@ -365,43 +365,6 @@ config SHMEM
 	  option replaces shmem and tmpfs with the much simpler ramfs code,
 	  option replaces shmem and tmpfs with the much simpler ramfs code,
 	  which may be appropriate on small systems without swap.
 	  which may be appropriate on small systems without swap.
 
 
-config CC_ALIGN_FUNCTIONS
-	int "Function alignment" if EMBEDDED
-	default 0
-	help
-	  Align the start of functions to the next power-of-two greater than n,
-	  skipping up to n bytes.  For instance, 32 aligns functions
-	  to the next 32-byte boundary, but 24 would align to the next
-	  32-byte boundary only if this can be done by skipping 23 bytes or less.
-	  Zero means use compiler's default.
-
-config CC_ALIGN_LABELS
-	int "Label alignment" if EMBEDDED
-	default 0
-	help
-	  Align all branch targets to a power-of-two boundary, skipping
-	  up to n bytes like ALIGN_FUNCTIONS.  This option can easily
-	  make code slower, because it must insert dummy operations for
-	  when the branch target is reached in the usual flow of the code.
-	  Zero means use compiler's default.
-
-config CC_ALIGN_LOOPS
-	int "Loop alignment" if EMBEDDED
-	default 0
-	help
-	  Align loops to a power-of-two boundary, skipping up to n bytes.
-	  Zero means use compiler's default.
-
-config CC_ALIGN_JUMPS
-	int "Jump alignment" if EMBEDDED
-	default 0
-	help
-	  Align branch targets to a power-of-two boundary, for branch
-	  targets where the targets can only be reached by jumping,
-	  skipping up to n bytes like ALIGN_FUNCTIONS.  In this case,
-	  no dummy operations need be executed.
-	  Zero means use compiler's default.
-
 config SLAB
 config SLAB
 	default y
 	default y
 	bool "Use full SLAB allocator" if EMBEDDED
 	bool "Use full SLAB allocator" if EMBEDDED

+ 52 - 13
scripts/Kbuild.include

@@ -44,6 +44,43 @@ define filechk
 	fi
 	fi
 endef
 endef
 
 
+######
+# gcc support functions
+# See documentation in Documentation/kbuild/makefiles.txt
+
+# as-option
+# Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,)
+
+as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
+	     -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
+	     else echo "$(2)"; fi ;)
+
+# cc-option
+# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
+
+cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+
+# cc-option-yn
+# Usage: flag := $(call cc-option-yn, -march=winchip-c6)
+cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+                > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
+
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+	$(call cc-option,-falign-functions=0,-malign-functions=0))
+
+# cc-version
+# Usage gcc-ver := $(call cc-version, $(CC))
+cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
+              $(if $(1), $(1), $(CC)))
+
+# cc-ifversion
+# Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
+cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
+                       echo $(3); fi;)
+
 ###
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # Usage:
@@ -51,8 +88,7 @@ endef
 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
 
 
 # If quiet is set, only print short version of command
 # If quiet is set, only print short version of command
-cmd = @$(if $($(quiet)cmd_$(1)),\
-      echo '  $(call escsq,$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))
+cmd = @$(echo-cmd) $(cmd_$(1))
 
 
 # Add $(obj)/ for paths that is not absolute
 # Add $(obj)/ for paths that is not absolute
 objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
 objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
@@ -75,30 +111,33 @@ endif
 echo-cmd = $(if $($(quiet)cmd_$(1)), \
 echo-cmd = $(if $($(quiet)cmd_$(1)), \
 	echo '  $(call escsq,$($(quiet)cmd_$(1)))';)
 	echo '  $(call escsq,$($(quiet)cmd_$(1)))';)
 
 
+make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))
+
 # function to only execute the passed command if necessary
 # function to only execute the passed command if necessary
 # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
 # >'< 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
 # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
-# 
-if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
+#
+if_changed = $(if $(strip $(filter-out $(PHONY),$?)          \
+		$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
 	@set -e; \
 	@set -e; \
-	$(echo-cmd) \
-	$(cmd_$(1)); \
-	echo 'cmd_$@ := $(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).cmd)
+	$(echo-cmd) $(cmd_$(1)); \
+	echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
 
 
 # execute the command and also postprocess generated .d dependencies
 # execute the command and also postprocess generated .d dependencies
 # file
 # file
-if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
-	$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),                  \
+if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?)  \
+		$(filter-out FORCE $(wildcard $^),$^)    \
+	$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),     \
 	@set -e; \
 	@set -e; \
-	$(echo-cmd) \
-	$(cmd_$(1)); \
-	scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \
+	$(echo-cmd) $(cmd_$(1)); \
+	scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
 	rm -f $(depfile); \
 	rm -f $(depfile); \
 	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
 	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
 
 
 # Usage: $(call if_changed_rule,foo)
 # Usage: $(call if_changed_rule,foo)
 # will check if $(cmd_foo) changed, or any of the prequisites changed,
 # will check if $(cmd_foo) changed, or any of the prequisites changed,
 # and if so will execute $(rule_foo)
 # and if so will execute $(rule_foo)
-if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
+if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?)            \
+			$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
 			@set -e; \
 			@set -e; \
 			$(rule_$(1)))
 			$(rule_$(1)))

+ 16 - 11
scripts/Makefile.build

@@ -4,17 +4,18 @@
 
 
 src := $(obj)
 src := $(obj)
 
 
-.PHONY: __build
+PHONY := __build
 __build:
 __build:
 
 
 # Read .config if it exist, otherwise ignore
 # Read .config if it exist, otherwise ignore
 -include .config
 -include .config
 
 
+include scripts/Kbuild.include
+
 # The filename Kbuild has precedence over Makefile
 # The filename Kbuild has precedence over Makefile
 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
 include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
 include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
 
 
-include scripts/Kbuild.include
 include scripts/Makefile.lib
 include scripts/Makefile.lib
 
 
 ifdef host-progs
 ifdef host-progs
@@ -128,7 +129,7 @@ $(multi-objs-y:.o=.s)   : modname = $(modname-multi)
 $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
 $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
 
 
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
-cmd_cc_s_c       = $(CC) $(c_flags) -S -o $@ $< 
+cmd_cc_s_c       = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
 
 
 %.s: %.c FORCE
 %.s: %.c FORCE
 	$(call if_changed_dep,cc_s_c)
 	$(call if_changed_dep,cc_s_c)
@@ -165,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
 cmd_modversions =							\
 cmd_modversions =							\
 	if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
 	if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
 		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
 		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
-		| $(GENKSYMS)						\
+		| $(GENKSYMS) -a $(ARCH)				\
 		> $(@D)/.tmp_$(@F:.o=.ver);				\
 		> $(@D)/.tmp_$(@F:.o=.ver);				\
 									\
 									\
 		$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) 		\
 		$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) 		\
@@ -177,12 +178,10 @@ cmd_modversions =							\
 endif
 endif
 
 
 define rule_cc_o_c
 define rule_cc_o_c
-	$(if $($(quiet)cmd_checksrc),echo '  $($(quiet)cmd_checksrc)';)   \
-	$(cmd_checksrc)							  \
-	$(if $($(quiet)cmd_cc_o_c),echo '  $(call escsq,$($(quiet)cmd_cc_o_c))';)  \
-	$(cmd_cc_o_c);							  \
+	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
+	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
 	$(cmd_modversions)						  \
 	$(cmd_modversions)						  \
-	scripts/basic/fixdep $(depfile) $@ '$(call escsq,$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp;  \
+	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp;  \
 	rm -f $(depfile);						  \
 	rm -f $(depfile);						  \
 	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
 	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
 endef
 endef
@@ -309,14 +308,14 @@ targets += $(multi-used-y) $(multi-used-m)
 # Descending
 # Descending
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 
 
-.PHONY: $(subdir-ym)
+PHONY += $(subdir-ym)
 $(subdir-ym):
 $(subdir-ym):
 	$(Q)$(MAKE) $(build)=$@
 	$(Q)$(MAKE) $(build)=$@
 
 
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 
 
-.PHONY: FORCE
+PHONY += FORCE
 
 
 FORCE:
 FORCE:
 
 
@@ -331,3 +330,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
 ifneq ($(cmd_files),)
 ifneq ($(cmd_files),)
   include $(cmd_files)
   include $(cmd_files)
 endif
 endif
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)

+ 8 - 2
scripts/Makefile.clean

@@ -4,7 +4,7 @@
 
 
 src := $(obj)
 src := $(obj)
 
 
-.PHONY: __clean
+PHONY := __clean
 __clean:
 __clean:
 
 
 # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
 # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
@@ -87,10 +87,16 @@ endif
 # Descending
 # Descending
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 
 
-.PHONY: $(subdir-ymn)
+PHONY += $(subdir-ymn)
 $(subdir-ymn):
 $(subdir-ymn):
 	$(Q)$(MAKE) $(clean)=$@
 	$(Q)$(MAKE) $(clean)=$@
 
 
 # If quiet is set, only print short version of command
 # If quiet is set, only print short version of command
 
 
 cmd = @$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
 cmd = @$(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)

+ 8 - 2
scripts/Makefile.modinst

@@ -2,7 +2,7 @@
 # Installing modules
 # Installing modules
 # ==========================================================================
 # ==========================================================================
 
 
-.PHONY: __modinst
+PHONY := __modinst
 __modinst:
 __modinst:
 
 
 include scripts/Kbuild.include
 include scripts/Kbuild.include
@@ -12,7 +12,7 @@ include scripts/Kbuild.include
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
 
 
-.PHONY: $(modules)
+PHONY += $(modules)
 __modinst: $(modules)
 __modinst: $(modules)
 	@:
 	@:
 
 
@@ -27,3 +27,9 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
 
 
 $(modules):
 $(modules):
 	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
 	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)

+ 14 - 5
scripts/Makefile.modpost

@@ -32,14 +32,15 @@
 # Step 4 is solely used to allow module versioning in external modules,
 # 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.
 # where the CRC of each module is retrieved from the Module.symers file.
 
 
-.PHONY: _modpost
+PHONY := _modpost
 _modpost: __modpost
 _modpost: __modpost
 
 
 include .config
 include .config
 include scripts/Kbuild.include
 include scripts/Kbuild.include
 include scripts/Makefile.lib
 include scripts/Makefile.lib
 
 
-symverfile := $(objtree)/Module.symvers
+kernelsymfile := $(objtree)/Module.symvers
+modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers
 
 
 # Step 1), find all modules listed in $(MODVERDIR)/
 # Step 1), find all modules listed in $(MODVERDIR)/
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
@@ -54,10 +55,12 @@ quiet_cmd_modpost = MODPOST
       cmd_modpost = scripts/mod/modpost            \
       cmd_modpost = scripts/mod/modpost            \
         $(if $(CONFIG_MODVERSIONS),-m)             \
         $(if $(CONFIG_MODVERSIONS),-m)             \
 	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)  \
 	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)  \
-	$(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \
+	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
+	$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
+	$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
 	$(filter-out FORCE,$^)
 	$(filter-out FORCE,$^)
 
 
-.PHONY: __modpost
+PHONY += __modpost
 __modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
 __modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
 	$(call cmd,modpost)
 	$(call cmd,modpost)
 
 
@@ -94,7 +97,7 @@ targets += $(modules)
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # Add FORCE to the prequisites of a target to force it to be always rebuilt.
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 
 
-.PHONY: FORCE
+PHONY += FORCE
 
 
 FORCE:
 FORCE:
 
 
@@ -109,3 +112,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
 ifneq ($(cmd_files),)
 ifneq ($(cmd_files),)
   include $(cmd_files)
   include $(cmd_files)
 endif
 endif
+
+
+# Declare the contents of the .PHONY variable as phony.  We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)

+ 2 - 12
scripts/basic/fixdep.c

@@ -132,20 +132,10 @@ void usage(void)
 
 
 /*
 /*
  * Print out the commandline prefixed with cmd_<target filename> :=
  * Print out the commandline prefixed with cmd_<target filename> :=
- * If commandline contains '#' escape with '\' so make to not see
- * the '#' as a start-of-comment symbol
- **/
+ */
 void print_cmdline(void)
 void print_cmdline(void)
 {
 {
-	char *p = cmdline;
-
-	printf("cmd_%s := ", target);
-	for (; *p; p++) {
-		if (*p == '#')
-			printf("\\");
-		printf("%c", *p);
-	}
-	printf("\n\n");
+	printf("cmd_%s := %s\n\n", target, cmdline);
 }
 }
 
 
 char * str_config  = NULL;
 char * str_config  = NULL;

+ 0 - 65
scripts/checkconfig.pl

@@ -1,65 +0,0 @@
-#! /usr/bin/perl
-#
-# checkconfig: find uses of CONFIG_* names without matching definitions.
-# Copyright abandoned, 1998, Michael Elizabeth Chastain <mailto:mec@shout.net>.
-
-use integer;
-
-$| = 1;
-
-foreach $file (@ARGV)
-{
-    # Open this file.
-    open(FILE, $file) || die "Can't open $file: $!\n";
-
-    # Initialize variables.
-    my $fInComment   = 0;
-    my $fInString    = 0;
-    my $fUseConfig   = 0;
-    my $iLinuxConfig = 0;
-    my %configList   = ();
-
-    LINE: while ( <FILE> )
-    {
-	# Strip comments.
-	$fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next);
-	m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1)));
-
-	# Pick up definitions.
-	if ( m/^\s*#/o )
-	{
-	    $iLinuxConfig      = $. if m/^\s*#\s*include\s*"linux\/config\.h"/o;
-	    $configList{uc $1} = 1  if m/^\s*#\s*include\s*"config\/(\S*)\.h"/o;
-	}
-
-	# Strip strings.
-	$fInString && (s+^.*?"+ +o ? ($fInString = 0) : next);
-	m+"+o && (s+".*?"+ +go, (s+".*$+ +o && ($fInString = 1)));
-
-	# Pick up definitions.
-	if ( m/^\s*#/o )
-	{
-	    $iLinuxConfig      = $. if m/^\s*#\s*include\s*<linux\/config\.h>/o;
-	    $configList{uc $1} = 1  if m/^\s*#\s*include\s*<config\/(\S*)\.h>/o;
-	    $configList{$1}    = 1  if m/^\s*#\s*define\s+CONFIG_(\w*)/o;
-	    $configList{$1}    = 1  if m/^\s*#\s*undef\s+CONFIG_(\w*)/o;
-	}
-
-	# Look for usages.
-	next unless m/CONFIG_/o;
-	WORD: while ( m/\bCONFIG_(\w+)/og )
-	{
-	    $fUseConfig = 1;
-	    last LINE if $iLinuxConfig;
-	    next WORD if exists $configList{$1};
-	    print "$file: $.: need CONFIG_$1.\n";
-	    $configList{$1} = 0;
-	}
-    }
-
-    # Report superfluous includes.
-    if ( $iLinuxConfig && ! $fUseConfig )
-	{ print "$file: $iLinuxConfig: linux/config.h not needed.\n"; }
-
-    close(FILE);
-}

+ 393 - 450
scripts/genksyms/genksyms.c

@@ -29,481 +29,421 @@
 #include <stdarg.h>
 #include <stdarg.h>
 #ifdef __GNU_LIBRARY__
 #ifdef __GNU_LIBRARY__
 #include <getopt.h>
 #include <getopt.h>
-#endif /* __GNU_LIBRARY__ */
+#endif				/* __GNU_LIBRARY__ */
 
 
 #include "genksyms.h"
 #include "genksyms.h"
-
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
 
 
 #define HASH_BUCKETS  4096
 #define HASH_BUCKETS  4096
 
 
 static struct symbol *symtab[HASH_BUCKETS];
 static struct symbol *symtab[HASH_BUCKETS];
-FILE *debugfile;
+static FILE *debugfile;
 
 
 int cur_line = 1;
 int cur_line = 1;
-char *cur_filename, *output_directory;
+char *cur_filename;
 
 
-int flag_debug, flag_dump_defs, flag_warnings;
+static int flag_debug, flag_dump_defs, flag_warnings;
+static const char *arch = "";
+static const char *mod_prefix = "";
 
 
 static int errors;
 static int errors;
 static int nsyms;
 static int nsyms;
 
 
 static struct symbol *expansion_trail;
 static struct symbol *expansion_trail;
 
 
-static const char * const symbol_type_name[] = {
-  "normal", "typedef", "enum", "struct", "union"
+static const char *const symbol_type_name[] = {
+	"normal", "typedef", "enum", "struct", "union"
 };
 };
 
 
+static int equal_list(struct string_list *a, struct string_list *b);
+static void print_list(FILE * f, struct string_list *list);
+
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
 
 
-static const unsigned int crctab32[] =
-{
-  0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,
-  0x706af48fU, 0xe963a535U, 0x9e6495a3U, 0x0edb8832U, 0x79dcb8a4U,
-  0xe0d5e91eU, 0x97d2d988U, 0x09b64c2bU, 0x7eb17cbdU, 0xe7b82d07U,
-  0x90bf1d91U, 0x1db71064U, 0x6ab020f2U, 0xf3b97148U, 0x84be41deU,
-  0x1adad47dU, 0x6ddde4ebU, 0xf4d4b551U, 0x83d385c7U, 0x136c9856U,
-  0x646ba8c0U, 0xfd62f97aU, 0x8a65c9ecU, 0x14015c4fU, 0x63066cd9U,
-  0xfa0f3d63U, 0x8d080df5U, 0x3b6e20c8U, 0x4c69105eU, 0xd56041e4U,
-  0xa2677172U, 0x3c03e4d1U, 0x4b04d447U, 0xd20d85fdU, 0xa50ab56bU,
-  0x35b5a8faU, 0x42b2986cU, 0xdbbbc9d6U, 0xacbcf940U, 0x32d86ce3U,
-  0x45df5c75U, 0xdcd60dcfU, 0xabd13d59U, 0x26d930acU, 0x51de003aU,
-  0xc8d75180U, 0xbfd06116U, 0x21b4f4b5U, 0x56b3c423U, 0xcfba9599U,
-  0xb8bda50fU, 0x2802b89eU, 0x5f058808U, 0xc60cd9b2U, 0xb10be924U,
-  0x2f6f7c87U, 0x58684c11U, 0xc1611dabU, 0xb6662d3dU, 0x76dc4190U,
-  0x01db7106U, 0x98d220bcU, 0xefd5102aU, 0x71b18589U, 0x06b6b51fU,
-  0x9fbfe4a5U, 0xe8b8d433U, 0x7807c9a2U, 0x0f00f934U, 0x9609a88eU,
-  0xe10e9818U, 0x7f6a0dbbU, 0x086d3d2dU, 0x91646c97U, 0xe6635c01U,
-  0x6b6b51f4U, 0x1c6c6162U, 0x856530d8U, 0xf262004eU, 0x6c0695edU,
-  0x1b01a57bU, 0x8208f4c1U, 0xf50fc457U, 0x65b0d9c6U, 0x12b7e950U,
-  0x8bbeb8eaU, 0xfcb9887cU, 0x62dd1ddfU, 0x15da2d49U, 0x8cd37cf3U,
-  0xfbd44c65U, 0x4db26158U, 0x3ab551ceU, 0xa3bc0074U, 0xd4bb30e2U,
-  0x4adfa541U, 0x3dd895d7U, 0xa4d1c46dU, 0xd3d6f4fbU, 0x4369e96aU,
-  0x346ed9fcU, 0xad678846U, 0xda60b8d0U, 0x44042d73U, 0x33031de5U,
-  0xaa0a4c5fU, 0xdd0d7cc9U, 0x5005713cU, 0x270241aaU, 0xbe0b1010U,
-  0xc90c2086U, 0x5768b525U, 0x206f85b3U, 0xb966d409U, 0xce61e49fU,
-  0x5edef90eU, 0x29d9c998U, 0xb0d09822U, 0xc7d7a8b4U, 0x59b33d17U,
-  0x2eb40d81U, 0xb7bd5c3bU, 0xc0ba6cadU, 0xedb88320U, 0x9abfb3b6U,
-  0x03b6e20cU, 0x74b1d29aU, 0xead54739U, 0x9dd277afU, 0x04db2615U,
-  0x73dc1683U, 0xe3630b12U, 0x94643b84U, 0x0d6d6a3eU, 0x7a6a5aa8U,
-  0xe40ecf0bU, 0x9309ff9dU, 0x0a00ae27U, 0x7d079eb1U, 0xf00f9344U,
-  0x8708a3d2U, 0x1e01f268U, 0x6906c2feU, 0xf762575dU, 0x806567cbU,
-  0x196c3671U, 0x6e6b06e7U, 0xfed41b76U, 0x89d32be0U, 0x10da7a5aU,
-  0x67dd4accU, 0xf9b9df6fU, 0x8ebeeff9U, 0x17b7be43U, 0x60b08ed5U,
-  0xd6d6a3e8U, 0xa1d1937eU, 0x38d8c2c4U, 0x4fdff252U, 0xd1bb67f1U,
-  0xa6bc5767U, 0x3fb506ddU, 0x48b2364bU, 0xd80d2bdaU, 0xaf0a1b4cU,
-  0x36034af6U, 0x41047a60U, 0xdf60efc3U, 0xa867df55U, 0x316e8eefU,
-  0x4669be79U, 0xcb61b38cU, 0xbc66831aU, 0x256fd2a0U, 0x5268e236U,
-  0xcc0c7795U, 0xbb0b4703U, 0x220216b9U, 0x5505262fU, 0xc5ba3bbeU,
-  0xb2bd0b28U, 0x2bb45a92U, 0x5cb36a04U, 0xc2d7ffa7U, 0xb5d0cf31U,
-  0x2cd99e8bU, 0x5bdeae1dU, 0x9b64c2b0U, 0xec63f226U, 0x756aa39cU,
-  0x026d930aU, 0x9c0906a9U, 0xeb0e363fU, 0x72076785U, 0x05005713U,
-  0x95bf4a82U, 0xe2b87a14U, 0x7bb12baeU, 0x0cb61b38U, 0x92d28e9bU,
-  0xe5d5be0dU, 0x7cdcefb7U, 0x0bdbdf21U, 0x86d3d2d4U, 0xf1d4e242U,
-  0x68ddb3f8U, 0x1fda836eU, 0x81be16cdU, 0xf6b9265bU, 0x6fb077e1U,
-  0x18b74777U, 0x88085ae6U, 0xff0f6a70U, 0x66063bcaU, 0x11010b5cU,
-  0x8f659effU, 0xf862ae69U, 0x616bffd3U, 0x166ccf45U, 0xa00ae278U,
-  0xd70dd2eeU, 0x4e048354U, 0x3903b3c2U, 0xa7672661U, 0xd06016f7U,
-  0x4969474dU, 0x3e6e77dbU, 0xaed16a4aU, 0xd9d65adcU, 0x40df0b66U,
-  0x37d83bf0U, 0xa9bcae53U, 0xdebb9ec5U, 0x47b2cf7fU, 0x30b5ffe9U,
-  0xbdbdf21cU, 0xcabac28aU, 0x53b39330U, 0x24b4a3a6U, 0xbad03605U,
-  0xcdd70693U, 0x54de5729U, 0x23d967bfU, 0xb3667a2eU, 0xc4614ab8U,
-  0x5d681b02U, 0x2a6f2b94U, 0xb40bbe37U, 0xc30c8ea1U, 0x5a05df1bU,
-  0x2d02ef8dU
+static const unsigned int crctab32[] = {
+	0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,
+	0x706af48fU, 0xe963a535U, 0x9e6495a3U, 0x0edb8832U, 0x79dcb8a4U,
+	0xe0d5e91eU, 0x97d2d988U, 0x09b64c2bU, 0x7eb17cbdU, 0xe7b82d07U,
+	0x90bf1d91U, 0x1db71064U, 0x6ab020f2U, 0xf3b97148U, 0x84be41deU,
+	0x1adad47dU, 0x6ddde4ebU, 0xf4d4b551U, 0x83d385c7U, 0x136c9856U,
+	0x646ba8c0U, 0xfd62f97aU, 0x8a65c9ecU, 0x14015c4fU, 0x63066cd9U,
+	0xfa0f3d63U, 0x8d080df5U, 0x3b6e20c8U, 0x4c69105eU, 0xd56041e4U,
+	0xa2677172U, 0x3c03e4d1U, 0x4b04d447U, 0xd20d85fdU, 0xa50ab56bU,
+	0x35b5a8faU, 0x42b2986cU, 0xdbbbc9d6U, 0xacbcf940U, 0x32d86ce3U,
+	0x45df5c75U, 0xdcd60dcfU, 0xabd13d59U, 0x26d930acU, 0x51de003aU,
+	0xc8d75180U, 0xbfd06116U, 0x21b4f4b5U, 0x56b3c423U, 0xcfba9599U,
+	0xb8bda50fU, 0x2802b89eU, 0x5f058808U, 0xc60cd9b2U, 0xb10be924U,
+	0x2f6f7c87U, 0x58684c11U, 0xc1611dabU, 0xb6662d3dU, 0x76dc4190U,
+	0x01db7106U, 0x98d220bcU, 0xefd5102aU, 0x71b18589U, 0x06b6b51fU,
+	0x9fbfe4a5U, 0xe8b8d433U, 0x7807c9a2U, 0x0f00f934U, 0x9609a88eU,
+	0xe10e9818U, 0x7f6a0dbbU, 0x086d3d2dU, 0x91646c97U, 0xe6635c01U,
+	0x6b6b51f4U, 0x1c6c6162U, 0x856530d8U, 0xf262004eU, 0x6c0695edU,
+	0x1b01a57bU, 0x8208f4c1U, 0xf50fc457U, 0x65b0d9c6U, 0x12b7e950U,
+	0x8bbeb8eaU, 0xfcb9887cU, 0x62dd1ddfU, 0x15da2d49U, 0x8cd37cf3U,
+	0xfbd44c65U, 0x4db26158U, 0x3ab551ceU, 0xa3bc0074U, 0xd4bb30e2U,
+	0x4adfa541U, 0x3dd895d7U, 0xa4d1c46dU, 0xd3d6f4fbU, 0x4369e96aU,
+	0x346ed9fcU, 0xad678846U, 0xda60b8d0U, 0x44042d73U, 0x33031de5U,
+	0xaa0a4c5fU, 0xdd0d7cc9U, 0x5005713cU, 0x270241aaU, 0xbe0b1010U,
+	0xc90c2086U, 0x5768b525U, 0x206f85b3U, 0xb966d409U, 0xce61e49fU,
+	0x5edef90eU, 0x29d9c998U, 0xb0d09822U, 0xc7d7a8b4U, 0x59b33d17U,
+	0x2eb40d81U, 0xb7bd5c3bU, 0xc0ba6cadU, 0xedb88320U, 0x9abfb3b6U,
+	0x03b6e20cU, 0x74b1d29aU, 0xead54739U, 0x9dd277afU, 0x04db2615U,
+	0x73dc1683U, 0xe3630b12U, 0x94643b84U, 0x0d6d6a3eU, 0x7a6a5aa8U,
+	0xe40ecf0bU, 0x9309ff9dU, 0x0a00ae27U, 0x7d079eb1U, 0xf00f9344U,
+	0x8708a3d2U, 0x1e01f268U, 0x6906c2feU, 0xf762575dU, 0x806567cbU,
+	0x196c3671U, 0x6e6b06e7U, 0xfed41b76U, 0x89d32be0U, 0x10da7a5aU,
+	0x67dd4accU, 0xf9b9df6fU, 0x8ebeeff9U, 0x17b7be43U, 0x60b08ed5U,
+	0xd6d6a3e8U, 0xa1d1937eU, 0x38d8c2c4U, 0x4fdff252U, 0xd1bb67f1U,
+	0xa6bc5767U, 0x3fb506ddU, 0x48b2364bU, 0xd80d2bdaU, 0xaf0a1b4cU,
+	0x36034af6U, 0x41047a60U, 0xdf60efc3U, 0xa867df55U, 0x316e8eefU,
+	0x4669be79U, 0xcb61b38cU, 0xbc66831aU, 0x256fd2a0U, 0x5268e236U,
+	0xcc0c7795U, 0xbb0b4703U, 0x220216b9U, 0x5505262fU, 0xc5ba3bbeU,
+	0xb2bd0b28U, 0x2bb45a92U, 0x5cb36a04U, 0xc2d7ffa7U, 0xb5d0cf31U,
+	0x2cd99e8bU, 0x5bdeae1dU, 0x9b64c2b0U, 0xec63f226U, 0x756aa39cU,
+	0x026d930aU, 0x9c0906a9U, 0xeb0e363fU, 0x72076785U, 0x05005713U,
+	0x95bf4a82U, 0xe2b87a14U, 0x7bb12baeU, 0x0cb61b38U, 0x92d28e9bU,
+	0xe5d5be0dU, 0x7cdcefb7U, 0x0bdbdf21U, 0x86d3d2d4U, 0xf1d4e242U,
+	0x68ddb3f8U, 0x1fda836eU, 0x81be16cdU, 0xf6b9265bU, 0x6fb077e1U,
+	0x18b74777U, 0x88085ae6U, 0xff0f6a70U, 0x66063bcaU, 0x11010b5cU,
+	0x8f659effU, 0xf862ae69U, 0x616bffd3U, 0x166ccf45U, 0xa00ae278U,
+	0xd70dd2eeU, 0x4e048354U, 0x3903b3c2U, 0xa7672661U, 0xd06016f7U,
+	0x4969474dU, 0x3e6e77dbU, 0xaed16a4aU, 0xd9d65adcU, 0x40df0b66U,
+	0x37d83bf0U, 0xa9bcae53U, 0xdebb9ec5U, 0x47b2cf7fU, 0x30b5ffe9U,
+	0xbdbdf21cU, 0xcabac28aU, 0x53b39330U, 0x24b4a3a6U, 0xbad03605U,
+	0xcdd70693U, 0x54de5729U, 0x23d967bfU, 0xb3667a2eU, 0xc4614ab8U,
+	0x5d681b02U, 0x2a6f2b94U, 0xb40bbe37U, 0xc30c8ea1U, 0x5a05df1bU,
+	0x2d02ef8dU
 };
 };
 
 
-static inline unsigned long
-partial_crc32_one(unsigned char c, unsigned long crc)
+static unsigned long partial_crc32_one(unsigned char c, unsigned long crc)
 {
 {
-  return crctab32[(crc ^ c) & 0xff] ^ (crc >> 8);
+	return crctab32[(crc ^ c) & 0xff] ^ (crc >> 8);
 }
 }
 
 
-static inline unsigned long
-partial_crc32(const char *s, unsigned long crc)
+static unsigned long partial_crc32(const char *s, unsigned long crc)
 {
 {
-  while (*s)
-    crc = partial_crc32_one(*s++, crc);
-  return crc;
+	while (*s)
+		crc = partial_crc32_one(*s++, crc);
+	return crc;
 }
 }
 
 
-static inline unsigned long
-crc32(const char *s)
+static unsigned long crc32(const char *s)
 {
 {
-  return partial_crc32(s, 0xffffffff) ^ 0xffffffff;
+	return partial_crc32(s, 0xffffffff) ^ 0xffffffff;
 }
 }
 
 
-
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
 
 
-static inline enum symbol_type
-map_to_ns(enum symbol_type t)
+static enum symbol_type map_to_ns(enum symbol_type t)
 {
 {
-  if (t == SYM_TYPEDEF)
-    t = SYM_NORMAL;
-  else if (t == SYM_UNION)
-    t = SYM_STRUCT;
-  return t;
+	if (t == SYM_TYPEDEF)
+		t = SYM_NORMAL;
+	else if (t == SYM_UNION)
+		t = SYM_STRUCT;
+	return t;
 }
 }
 
 
-struct symbol *
-find_symbol(const char *name, enum symbol_type ns)
+struct symbol *find_symbol(const char *name, enum symbol_type ns)
 {
 {
-  unsigned long h = crc32(name) % HASH_BUCKETS;
-  struct symbol *sym;
+	unsigned long h = crc32(name) % HASH_BUCKETS;
+	struct symbol *sym;
 
 
-  for (sym = symtab[h]; sym ; sym = sym->hash_next)
-    if (map_to_ns(sym->type) == map_to_ns(ns) && strcmp(name, sym->name) == 0)
-      break;
+	for (sym = symtab[h]; sym; sym = sym->hash_next)
+		if (map_to_ns(sym->type) == map_to_ns(ns) &&
+		    strcmp(name, sym->name) == 0)
+			break;
 
 
-  return sym;
+	return sym;
 }
 }
 
 
-struct symbol *
-add_symbol(const char *name, enum symbol_type type, struct string_list *defn, int is_extern)
+struct symbol *add_symbol(const char *name, enum symbol_type type,
+			  struct string_list *defn, int is_extern)
 {
 {
-  unsigned long h = crc32(name) % HASH_BUCKETS;
-  struct symbol *sym;
-
-  for (sym = symtab[h]; sym ; sym = sym->hash_next)
-    if (map_to_ns(sym->type) == map_to_ns(type)
-	&& strcmp(name, sym->name) == 0)
-      {
-	if (!equal_list(sym->defn, defn))
-	  error_with_pos("redefinition of %s", name);
+	unsigned long h = crc32(name) % HASH_BUCKETS;
+	struct symbol *sym;
+
+	for (sym = symtab[h]; sym; sym = sym->hash_next) {
+		if (map_to_ns(sym->type) == map_to_ns(type)
+		    && strcmp(name, sym->name) == 0) {
+			if (!equal_list(sym->defn, defn))
+				error_with_pos("redefinition of %s", name);
+			return sym;
+		}
+	}
+
+	sym = xmalloc(sizeof(*sym));
+	sym->name = name;
+	sym->type = type;
+	sym->defn = defn;
+	sym->expansion_trail = NULL;
+	sym->is_extern = is_extern;
+
+	sym->hash_next = symtab[h];
+	symtab[h] = sym;
+
+	if (flag_debug) {
+		fprintf(debugfile, "Defn for %s %s == <",
+			symbol_type_name[type], name);
+		if (is_extern)
+			fputs("extern ", debugfile);
+		print_list(debugfile, defn);
+		fputs(">\n", debugfile);
+	}
+
+	++nsyms;
 	return sym;
 	return sym;
-      }
-
-  sym = xmalloc(sizeof(*sym));
-  sym->name = name;
-  sym->type = type;
-  sym->defn = defn;
-  sym->expansion_trail = NULL;
-  sym->is_extern = is_extern;
-
-  sym->hash_next = symtab[h];
-  symtab[h] = sym;
-
-  if (flag_debug)
-    {
-      fprintf(debugfile, "Defn for %s %s == <", symbol_type_name[type],  name);
-      if (is_extern)
-        fputs("extern ", debugfile);
-      print_list(debugfile, defn);
-      fputs(">\n", debugfile);
-    }
-
-  ++nsyms;
-  return sym;
 }
 }
 
 
-
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
 
 
-inline void
-free_node(struct string_list *node)
+void free_node(struct string_list *node)
 {
 {
-  free(node->string);
-  free(node);
+	free(node->string);
+	free(node);
 }
 }
 
 
-void
-free_list(struct string_list *s, struct string_list *e)
+void free_list(struct string_list *s, struct string_list *e)
 {
 {
-  while (s != e)
-    {
-      struct string_list *next = s->next;
-      free_node(s);
-      s = next;
-    }
+	while (s != e) {
+		struct string_list *next = s->next;
+		free_node(s);
+		s = next;
+	}
 }
 }
 
 
-inline struct string_list *
-copy_node(struct string_list *node)
+struct string_list *copy_node(struct string_list *node)
 {
 {
-  struct string_list *newnode;
+	struct string_list *newnode;
 
 
-  newnode = xmalloc(sizeof(*newnode));
-  newnode->string = xstrdup(node->string);
-  newnode->tag = node->tag;
+	newnode = xmalloc(sizeof(*newnode));
+	newnode->string = xstrdup(node->string);
+	newnode->tag = node->tag;
 
 
-  return newnode;
+	return newnode;
 }
 }
 
 
-struct string_list *
-copy_list(struct string_list *s, struct string_list *e)
+static int equal_list(struct string_list *a, struct string_list *b)
 {
 {
-  struct string_list *h, *p;
-
-  if (s == e)
-    return NULL;
-
-  p = h = copy_node(s);
-  while ((s = s->next) != e)
-    p = p->next = copy_node(s);
-  p->next = NULL;
-
-  return h;
-}
+	while (a && b) {
+		if (a->tag != b->tag || strcmp(a->string, b->string))
+			return 0;
+		a = a->next;
+		b = b->next;
+	}
 
 
-int
-equal_list(struct string_list *a, struct string_list *b)
-{
-  while (a && b)
-    {
-      if (a->tag != b->tag || strcmp(a->string, b->string))
-	return 0;
-      a = a->next;
-      b = b->next;
-    }
-
-  return !a && !b;
+	return !a && !b;
 }
 }
 
 
-static inline void
-print_node(FILE *f, struct string_list *list)
+static void print_node(FILE * f, struct string_list *list)
 {
 {
-  switch (list->tag)
-    {
-    case SYM_STRUCT:
-      putc('s', f);
-      goto printit;
-    case SYM_UNION:
-      putc('u', f);
-      goto printit;
-    case SYM_ENUM:
-      putc('e', f);
-      goto printit;
-    case SYM_TYPEDEF:
-      putc('t', f);
-      goto printit;
-
-    printit:
-      putc('#', f);
-    case SYM_NORMAL:
-      fputs(list->string, f);
-      break;
-    }
-}
+	switch (list->tag) {
+	case SYM_STRUCT:
+		putc('s', f);
+		goto printit;
+	case SYM_UNION:
+		putc('u', f);
+		goto printit;
+	case SYM_ENUM:
+		putc('e', f);
+		goto printit;
+	case SYM_TYPEDEF:
+		putc('t', f);
+		goto printit;
 
 
-void
-print_list(FILE *f, struct string_list *list)
-{
-  struct string_list **e, **b;
-  struct string_list *tmp, **tmp2;
-  int elem = 1;
-
-  if (list == NULL)
-    {
-      fputs("(nil)", f);
-      return;
-    }
-
-  tmp = list;
-  while((tmp = tmp->next) != NULL)
-	  elem++;
-
-  b = alloca(elem * sizeof(*e));
-  e = b + elem;
-  tmp2 = e - 1;
-
-  (*tmp2--) = list;
-  while((list = list->next) != NULL)
-	  *(tmp2--) = list;
-
-  while (b != e)
-    {
-      print_node(f, *b++);
-      putc(' ', f);
-    }
+	      printit:
+		putc('#', f);
+	case SYM_NORMAL:
+		fputs(list->string, f);
+		break;
+	}
 }
 }
 
 
-static unsigned long
-expand_and_crc_list(struct string_list *list, unsigned long crc)
+static void print_list(FILE * f, struct string_list *list)
 {
 {
-  struct string_list **e, **b;
-  struct string_list *tmp, **tmp2;
-  int elem = 1;
-
-  if (!list)
-    return crc;
+	struct string_list **e, **b;
+	struct string_list *tmp, **tmp2;
+	int elem = 1;
 
 
-  tmp = list;
-  while((tmp = tmp->next) != NULL)
-	  elem++;
-
-  b = alloca(elem * sizeof(*e));
-  e = b + elem;
-  tmp2 = e - 1;
+	if (list == NULL) {
+		fputs("(nil)", f);
+		return;
+	}
 
 
-  *(tmp2--) = list;
-  while ((list = list->next) != NULL)
-    *(tmp2--) = list;
+	tmp = list;
+	while ((tmp = tmp->next) != NULL)
+		elem++;
 
 
-  while (b != e)
-    {
-      struct string_list *cur;
-      struct symbol *subsym;
+	b = alloca(elem * sizeof(*e));
+	e = b + elem;
+	tmp2 = e - 1;
 
 
-      cur = *(b++);
-      switch (cur->tag)
-	{
-	case SYM_NORMAL:
-	  if (flag_dump_defs)
-	    fprintf(debugfile, "%s ", cur->string);
-	  crc = partial_crc32(cur->string, crc);
-	  crc = partial_crc32_one(' ', crc);
-	  break;
+	(*tmp2--) = list;
+	while ((list = list->next) != NULL)
+		*(tmp2--) = list;
 
 
-	case SYM_TYPEDEF:
-	  subsym = find_symbol(cur->string, cur->tag);
-	  if (subsym->expansion_trail)
-	    {
-	      if (flag_dump_defs)
-		fprintf(debugfile, "%s ", cur->string);
-	      crc = partial_crc32(cur->string, crc);
-	      crc = partial_crc32_one(' ', crc);
-	    }
-	  else
-	    {
-	      subsym->expansion_trail = expansion_trail;
-	      expansion_trail = subsym;
-	      crc = expand_and_crc_list(subsym->defn, crc);
-	    }
-	  break;
+	while (b != e) {
+		print_node(f, *b++);
+		putc(' ', f);
+	}
+}
 
 
-	case SYM_STRUCT:
-	case SYM_UNION:
-	case SYM_ENUM:
-	  subsym = find_symbol(cur->string, cur->tag);
-	  if (!subsym)
-	    {
-	      struct string_list *n, *t = NULL;
-
-	      error_with_pos("expand undefined %s %s",
-			     symbol_type_name[cur->tag], cur->string);
-
-	      n = xmalloc(sizeof(*n));
-	      n->string = xstrdup(symbol_type_name[cur->tag]);
-	      n->tag = SYM_NORMAL;
-	      n->next = t;
-	      t = n;
-
-	      n = xmalloc(sizeof(*n));
-	      n->string = xstrdup(cur->string);
-	      n->tag = SYM_NORMAL;
-	      n->next = t;
-	      t = n;
-
-	      n = xmalloc(sizeof(*n));
-	      n->string = xstrdup("{ UNKNOWN }");
-	      n->tag = SYM_NORMAL;
-	      n->next = t;
-
-	      subsym = add_symbol(cur->string, cur->tag, n, 0);
-	    }
-	  if (subsym->expansion_trail)
-	    {
-	      if (flag_dump_defs)
-		{
-		  fprintf(debugfile, "%s %s ", symbol_type_name[cur->tag],
-			  cur->string);
+static unsigned long expand_and_crc_list(struct string_list *list,
+					 unsigned long crc)
+{
+	struct string_list **e, **b;
+	struct string_list *tmp, **tmp2;
+	int elem = 1;
+
+	if (!list)
+		return crc;
+
+	tmp = list;
+	while ((tmp = tmp->next) != NULL)
+		elem++;
+
+	b = alloca(elem * sizeof(*e));
+	e = b + elem;
+	tmp2 = e - 1;
+
+	*(tmp2--) = list;
+	while ((list = list->next) != NULL)
+		*(tmp2--) = list;
+
+	while (b != e) {
+		struct string_list *cur;
+		struct symbol *subsym;
+
+		cur = *(b++);
+		switch (cur->tag) {
+		case SYM_NORMAL:
+			if (flag_dump_defs)
+				fprintf(debugfile, "%s ", cur->string);
+			crc = partial_crc32(cur->string, crc);
+			crc = partial_crc32_one(' ', crc);
+			break;
+
+		case SYM_TYPEDEF:
+			subsym = find_symbol(cur->string, cur->tag);
+			if (subsym->expansion_trail) {
+				if (flag_dump_defs)
+					fprintf(debugfile, "%s ", cur->string);
+				crc = partial_crc32(cur->string, crc);
+				crc = partial_crc32_one(' ', crc);
+			} else {
+				subsym->expansion_trail = expansion_trail;
+				expansion_trail = subsym;
+				crc = expand_and_crc_list(subsym->defn, crc);
+			}
+			break;
+
+		case SYM_STRUCT:
+		case SYM_UNION:
+		case SYM_ENUM:
+			subsym = find_symbol(cur->string, cur->tag);
+			if (!subsym) {
+				struct string_list *n, *t = NULL;
+
+				error_with_pos("expand undefined %s %s",
+					       symbol_type_name[cur->tag],
+					       cur->string);
+
+				n = xmalloc(sizeof(*n));
+				n->string = xstrdup(symbol_type_name[cur->tag]);
+				n->tag = SYM_NORMAL;
+				n->next = t;
+				t = n;
+
+				n = xmalloc(sizeof(*n));
+				n->string = xstrdup(cur->string);
+				n->tag = SYM_NORMAL;
+				n->next = t;
+				t = n;
+
+				n = xmalloc(sizeof(*n));
+				n->string = xstrdup("{ UNKNOWN }");
+				n->tag = SYM_NORMAL;
+				n->next = t;
+
+				subsym =
+				    add_symbol(cur->string, cur->tag, n, 0);
+			}
+			if (subsym->expansion_trail) {
+				if (flag_dump_defs) {
+					fprintf(debugfile, "%s %s ",
+						symbol_type_name[cur->tag],
+						cur->string);
+				}
+
+				crc = partial_crc32(symbol_type_name[cur->tag],
+						    crc);
+				crc = partial_crc32_one(' ', crc);
+				crc = partial_crc32(cur->string, crc);
+				crc = partial_crc32_one(' ', crc);
+			} else {
+				subsym->expansion_trail = expansion_trail;
+				expansion_trail = subsym;
+				crc = expand_and_crc_list(subsym->defn, crc);
+			}
+			break;
 		}
 		}
-
-	      crc = partial_crc32(symbol_type_name[cur->tag], crc);
-	      crc = partial_crc32_one(' ', crc);
-	      crc = partial_crc32(cur->string, crc);
-	      crc = partial_crc32_one(' ', crc);
-	    }
-	  else
-	    {
-	      subsym->expansion_trail = expansion_trail;
-	      expansion_trail = subsym;
-	      crc = expand_and_crc_list(subsym->defn, crc);
-	    }
-	  break;
 	}
 	}
-    }
 
 
-  return crc;
+	return crc;
 }
 }
 
 
-void
-export_symbol(const char *name)
+void export_symbol(const char *name)
 {
 {
-  struct symbol *sym;
+	struct symbol *sym;
 
 
-  sym = find_symbol(name, SYM_NORMAL);
-  if (!sym)
-    error_with_pos("export undefined symbol %s", name);
-  else
-    {
-      unsigned long crc;
+	sym = find_symbol(name, SYM_NORMAL);
+	if (!sym)
+		error_with_pos("export undefined symbol %s", name);
+	else {
+		unsigned long crc;
 
 
-      if (flag_dump_defs)
-	fprintf(debugfile, "Export %s == <", name);
+		if (flag_dump_defs)
+			fprintf(debugfile, "Export %s == <", name);
 
 
-      expansion_trail = (struct symbol *)-1L;
+		expansion_trail = (struct symbol *)-1L;
 
 
-      crc = expand_and_crc_list(sym->defn, 0xffffffff) ^ 0xffffffff;
+		crc = expand_and_crc_list(sym->defn, 0xffffffff) ^ 0xffffffff;
 
 
-      sym = expansion_trail;
-      while (sym != (struct symbol *)-1L)
-	{
-	  struct symbol *n = sym->expansion_trail;
-	  sym->expansion_trail = 0;
-	  sym = n;
-	}
+		sym = expansion_trail;
+		while (sym != (struct symbol *)-1L) {
+			struct symbol *n = sym->expansion_trail;
+			sym->expansion_trail = 0;
+			sym = n;
+		}
 
 
-      if (flag_dump_defs)
-	fputs(">\n", debugfile);
+		if (flag_dump_defs)
+			fputs(">\n", debugfile);
 
 
-      /* Used as a linker script. */
-      printf("__crc_%s = 0x%08lx ;\n", name, crc);
-    }
+		/* Used as a linker script. */
+		printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc);
+	}
 }
 }
 
 
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
-
-void
-error(const char *fmt, ...)
-{
-  va_list args;
-
-  if (flag_warnings)
-    {
-      va_start(args, fmt);
-      vfprintf(stderr, fmt, args);
-      va_end(args);
-      putc('\n', stderr);
-
-      errors++;
-    }
-}
-
-void
-error_with_pos(const char *fmt, ...)
+void error_with_pos(const char *fmt, ...)
 {
 {
-  va_list args;
+	va_list args;
 
 
-  if (flag_warnings)
-    {
-      fprintf(stderr, "%s:%d: ", cur_filename ? : "<stdin>", cur_line);
+	if (flag_warnings) {
+		fprintf(stderr, "%s:%d: ", cur_filename ? : "<stdin>",
+			cur_line);
 
 
-      va_start(args, fmt);
-      vfprintf(stderr, fmt, args);
-      va_end(args);
-      putc('\n', stderr);
+		va_start(args, fmt);
+		vfprintf(stderr, fmt, args);
+		va_end(args);
+		putc('\n', stderr);
 
 
-      errors++;
-    }
+		errors++;
+	}
 }
 }
 
 
-
-void genksyms_usage(void)
+static void genksyms_usage(void)
 {
 {
-	fputs("Usage:\n"
-	      "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n"
-	      "\n"
+	fputs("Usage:\n" "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n" "\n"
 #ifdef __GNU_LIBRARY__
 #ifdef __GNU_LIBRARY__
 	      "  -d, --debug           Increment the debug level (repeatable)\n"
 	      "  -d, --debug           Increment the debug level (repeatable)\n"
 	      "  -D, --dump            Dump expanded symbol defs (for debugging only)\n"
 	      "  -D, --dump            Dump expanded symbol defs (for debugging only)\n"
@@ -511,81 +451,84 @@ void genksyms_usage(void)
 	      "  -q, --quiet           Disable warnings (default)\n"
 	      "  -q, --quiet           Disable warnings (default)\n"
 	      "  -h, --help            Print this message\n"
 	      "  -h, --help            Print this message\n"
 	      "  -V, --version         Print the release version\n"
 	      "  -V, --version         Print the release version\n"
-#else  /* __GNU_LIBRARY__ */
-             "  -d                    Increment the debug level (repeatable)\n"
-             "  -D                    Dump expanded symbol defs (for debugging only)\n"
-             "  -w                    Enable warnings\n"
-             "  -q                    Disable warnings (default)\n"
-             "  -h                    Print this message\n"
-             "  -V                    Print the release version\n"
-#endif /* __GNU_LIBRARY__ */
+#else				/* __GNU_LIBRARY__ */
+	      "  -d                    Increment the debug level (repeatable)\n"
+	      "  -D                    Dump expanded symbol defs (for debugging only)\n"
+	      "  -w                    Enable warnings\n"
+	      "  -q                    Disable warnings (default)\n"
+	      "  -h                    Print this message\n"
+	      "  -V                    Print the release version\n"
+#endif				/* __GNU_LIBRARY__ */
 	      , stderr);
 	      , stderr);
 }
 }
 
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 {
-  int o;
+	int o;
 
 
 #ifdef __GNU_LIBRARY__
 #ifdef __GNU_LIBRARY__
-  struct option long_opts[] = {
-    {"debug", 0, 0, 'd'},
-    {"warnings", 0, 0, 'w'},
-    {"quiet", 0, 0, 'q'},
-    {"dump", 0, 0, 'D'},
-    {"version", 0, 0, 'V'},
-    {"help", 0, 0, 'h'},
-    {0, 0, 0, 0}
-  };
-
-  while ((o = getopt_long(argc, argv, "dwqVDk:p:",
-			  &long_opts[0], NULL)) != EOF)
-#else  /* __GNU_LIBRARY__ */
-  while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF)
-#endif /* __GNU_LIBRARY__ */
-    switch (o)
-      {
-      case 'd':
-	flag_debug++;
-	break;
-      case 'w':
-	flag_warnings = 1;
-	break;
-      case 'q':
-	flag_warnings = 0;
-	break;
-      case 'V':
-	fputs("genksyms version 2.5.60\n", stderr);
-	break;
-      case 'D':
-	flag_dump_defs = 1;
-	break;
-      case 'h':
-	genksyms_usage();
-	return 0;
-      default:
-	genksyms_usage();
-	return 1;
-      }
-
-    {
-      extern int yydebug;
-      extern int yy_flex_debug;
-
-      yydebug = (flag_debug > 1);
-      yy_flex_debug = (flag_debug > 2);
-
-      debugfile = stderr;
-      /* setlinebuf(debugfile); */
-    }
-
-  yyparse();
-
-  if (flag_debug)
-    {
-      fprintf(debugfile, "Hash table occupancy %d/%d = %g\n",
-	      nsyms, HASH_BUCKETS, (double)nsyms / (double)HASH_BUCKETS);
-    }
-
-  return errors != 0;
+	struct option long_opts[] = {
+		{"arch", 1, 0, 'a'},
+		{"debug", 0, 0, 'd'},
+		{"warnings", 0, 0, 'w'},
+		{"quiet", 0, 0, 'q'},
+		{"dump", 0, 0, 'D'},
+		{"version", 0, 0, 'V'},
+		{"help", 0, 0, 'h'},
+		{0, 0, 0, 0}
+	};
+
+	while ((o = getopt_long(argc, argv, "a:dwqVDk:p:",
+				&long_opts[0], NULL)) != EOF)
+#else				/* __GNU_LIBRARY__ */
+	while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF)
+#endif				/* __GNU_LIBRARY__ */
+		switch (o) {
+		case 'a':
+			arch = optarg;
+			break;
+		case 'd':
+			flag_debug++;
+			break;
+		case 'w':
+			flag_warnings = 1;
+			break;
+		case 'q':
+			flag_warnings = 0;
+			break;
+		case 'V':
+			fputs("genksyms version 2.5.60\n", stderr);
+			break;
+		case 'D':
+			flag_dump_defs = 1;
+			break;
+		case 'h':
+			genksyms_usage();
+			return 0;
+		default:
+			genksyms_usage();
+			return 1;
+		}
+	if ((strcmp(arch, "v850") == 0) || (strcmp(arch, "h8300") == 0))
+		mod_prefix = "_";
+	{
+		extern int yydebug;
+		extern int yy_flex_debug;
+
+		yydebug = (flag_debug > 1);
+		yy_flex_debug = (flag_debug > 2);
+
+		debugfile = stderr;
+		/* setlinebuf(debugfile); */
+	}
+
+	yyparse();
+
+	if (flag_debug) {
+		fprintf(debugfile, "Hash table occupancy %d/%d = %g\n",
+			nsyms, HASH_BUCKETS,
+			(double)nsyms / (double)HASH_BUCKETS);
+	}
+
+	return errors != 0;
 }
 }

+ 17 - 40
scripts/genksyms/genksyms.h

@@ -20,74 +20,51 @@
    along with this program; if not, write to the Free Software Foundation,
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
-
 #ifndef MODUTILS_GENKSYMS_H
 #ifndef MODUTILS_GENKSYMS_H
 #define MODUTILS_GENKSYMS_H 1
 #define MODUTILS_GENKSYMS_H 1
 
 
 #include <stdio.h>
 #include <stdio.h>
 
 
-
-enum symbol_type
-{
-  SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION
+enum symbol_type {
+	SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION
 };
 };
 
 
-struct string_list
-{
-  struct string_list *next;
-  enum symbol_type tag;
-  char *string;
+struct string_list {
+	struct string_list *next;
+	enum symbol_type tag;
+	char *string;
 };
 };
 
 
-struct symbol
-{
-  struct symbol *hash_next;
-  const char *name;
-  enum symbol_type type;
-  struct string_list *defn;
-  struct symbol *expansion_trail;
-  int is_extern;
+struct symbol {
+	struct symbol *hash_next;
+	const char *name;
+	enum symbol_type type;
+	struct string_list *defn;
+	struct symbol *expansion_trail;
+	int is_extern;
 };
 };
 
 
 typedef struct string_list **yystype;
 typedef struct string_list **yystype;
 #define YYSTYPE yystype
 #define YYSTYPE yystype
 
 
-extern FILE *outfile, *debugfile;
-
 extern int cur_line;
 extern int cur_line;
-extern char *cur_filename, *output_directory;
-
-extern int flag_debug, flag_dump_defs, flag_warnings;
-extern int checksum_version, kernel_version;
-
-extern int want_brace_phrase, want_exp_phrase, discard_phrase_contents;
-extern struct string_list *current_list, *next_list;
-
+extern char *cur_filename;
 
 
 struct symbol *find_symbol(const char *name, enum symbol_type ns);
 struct symbol *find_symbol(const char *name, enum symbol_type ns);
 struct symbol *add_symbol(const char *name, enum symbol_type type,
 struct symbol *add_symbol(const char *name, enum symbol_type type,
-			   struct string_list *defn, int is_extern);
+			  struct string_list *defn, int is_extern);
 void export_symbol(const char *);
 void export_symbol(const char *);
 
 
-struct string_list *reset_list(void);
-void free_list(struct string_list *s, struct string_list *e);
 void free_node(struct string_list *list);
 void free_node(struct string_list *list);
+void free_list(struct string_list *s, struct string_list *e);
 struct string_list *copy_node(struct string_list *);
 struct string_list *copy_node(struct string_list *);
-struct string_list *copy_list(struct string_list *s, struct string_list *e);
-int equal_list(struct string_list *a, struct string_list *b);
-void print_list(FILE *, struct string_list *list);
 
 
 int yylex(void);
 int yylex(void);
 int yyparse(void);
 int yyparse(void);
 
 
 void error_with_pos(const char *, ...);
 void error_with_pos(const char *, ...);
 
 
-#define version(a,b,c)  ((a << 16) | (b << 8) | (c))
-
 /*----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------*/
-
-#define MODUTILS_VERSION "<in-kernel>"
-
 #define xmalloc(size) ({ void *__ptr = malloc(size);		\
 #define xmalloc(size) ({ void *__ptr = malloc(size);		\
 	if(!__ptr && size != 0) {				\
 	if(!__ptr && size != 0) {				\
 		fprintf(stderr, "out of memory\n");		\
 		fprintf(stderr, "out of memory\n");		\
@@ -101,4 +78,4 @@ void error_with_pos(const char *, ...);
 	}							\
 	}							\
 	__str; })
 	__str; })
 
 
-#endif /* genksyms.h */
+#endif				/* genksyms.h */

+ 3 - 3
scripts/kconfig/Makefile

@@ -2,7 +2,7 @@
 # Kernel configuration targets
 # Kernel configuration targets
 # These targets are used from top-level makefile
 # These targets are used from top-level makefile
 
 
-.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
+PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
 
 
 xconfig: $(obj)/qconf
 xconfig: $(obj)/qconf
 	$< arch/$(ARCH)/Kconfig
 	$< arch/$(ARCH)/Kconfig
@@ -42,7 +42,7 @@ update-po-config: $(obj)/kxgettext
 	$(Q)rm -f arch/um/Kconfig_arch
 	$(Q)rm -f arch/um/Kconfig_arch
 	$(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
 	$(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
 
 
-.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
+PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
 
 
 randconfig: $(obj)/conf
 randconfig: $(obj)/conf
 	$< -r arch/$(ARCH)/Kconfig
 	$< -r arch/$(ARCH)/Kconfig
@@ -78,7 +78,7 @@ help:
 	@echo  '  defconfig	  - New config with default answer to all options'
 	@echo  '  defconfig	  - New config with default answer to all options'
 	@echo  '  allmodconfig	  - New config selecting modules when possible'
 	@echo  '  allmodconfig	  - New config selecting modules when possible'
 	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
 	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
-	@echo  '  allnoconfig	  - New minimal config'
+	@echo  '  allnoconfig	  - New config where all options are answered with no'
 
 
 # ===========================================================================
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
 # Shared Makefile for the various kconfig executables:

+ 1 - 1
scripts/kconfig/confdata.c

@@ -374,6 +374,7 @@ int conf_write(const char *name)
 		out_h = fopen(".tmpconfig.h", "w");
 		out_h = fopen(".tmpconfig.h", "w");
 		if (!out_h)
 		if (!out_h)
 			return 1;
 			return 1;
+		file_write_dep(NULL);
 	}
 	}
 	sym = sym_lookup("KERNELVERSION", 0);
 	sym = sym_lookup("KERNELVERSION", 0);
 	sym_calc_value(sym);
 	sym_calc_value(sym);
@@ -512,7 +513,6 @@ int conf_write(const char *name)
 	if (out_h) {
 	if (out_h) {
 		fclose(out_h);
 		fclose(out_h);
 		rename(".tmpconfig.h", "include/linux/autoconf.h");
 		rename(".tmpconfig.h", "include/linux/autoconf.h");
-		file_write_dep(NULL);
 	}
 	}
 	if (!name || basename != conf_def_filename) {
 	if (!name || basename != conf_def_filename) {
 		if (!name)
 		if (!name)

+ 3 - 3
scripts/kconfig/lxdialog/Makefile

@@ -7,10 +7,10 @@ check-lxdialog  := $(srctree)/$(src)/check-lxdialog.sh
 # we really need to do so. (Do not call gcc as part of make mrproper)
 # we really need to do so. (Do not call gcc as part of make mrproper)
 HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
 HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
 HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
 HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
- 
-HOST_EXTRACFLAGS += -DLOCALE 
 
 
-.PHONY: dochecklxdialog
+HOST_EXTRACFLAGS += -DLOCALE
+
+PHONY += dochecklxdialog
 $(obj)/dochecklxdialog:
 $(obj)/dochecklxdialog:
 	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
 	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
 
 

+ 5 - 3
scripts/mkmakefile

@@ -21,11 +21,13 @@ KERNELOUTPUT := $2
 
 
 MAKEFLAGS += --no-print-directory
 MAKEFLAGS += --no-print-directory
 
 
+.PHONY: all \$(MAKECMDGOALS)
+
 all:
 all:
 	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
 	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
 
 
-%::
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
+Makefile:;
 
 
+\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
+	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
 EOF
 EOF
-

+ 8 - 9
scripts/mod/file2alias.c

@@ -34,7 +34,7 @@ typedef uint16_t	__u16;
 typedef unsigned char	__u8;
 typedef unsigned char	__u8;
 
 
 /* Big exception to the "don't include kernel headers into userspace, which
 /* Big exception to the "don't include kernel headers into userspace, which
- * even potentially has different endianness and word sizes, since 
+ * even potentially has different endianness and word sizes, since
  * we handle those differences explicitly below */
  * we handle those differences explicitly below */
 #include "../../include/linux/mod_devicetable.h"
 #include "../../include/linux/mod_devicetable.h"
 #include "../../include/linux/input.h"
 #include "../../include/linux/input.h"
@@ -153,8 +153,8 @@ static void do_usb_table(void *symval, unsigned long size,
 	const unsigned long id_size = sizeof(struct usb_device_id);
 	const unsigned long id_size = sizeof(struct usb_device_id);
 
 
 	if (size % id_size || size < id_size) {
 	if (size % id_size || size < id_size) {
-		fprintf(stderr, "*** Warning: %s ids %lu bad size "
-			"(each on %lu)\n", mod->name, size, id_size);
+		warn("%s ids %lu bad size "
+		     "(each on %lu)\n", mod->name, size, id_size);
 	}
 	}
 	/* Leave last one: it's the terminator. */
 	/* Leave last one: it's the terminator. */
 	size -= id_size;
 	size -= id_size;
@@ -217,9 +217,8 @@ static int do_pci_entry(const char *filename,
 	if ((baseclass_mask != 0 && baseclass_mask != 0xFF)
 	if ((baseclass_mask != 0 && baseclass_mask != 0xFF)
 	    || (subclass_mask != 0 && subclass_mask != 0xFF)
 	    || (subclass_mask != 0 && subclass_mask != 0xFF)
 	    || (interface_mask != 0 && interface_mask != 0xFF)) {
 	    || (interface_mask != 0 && interface_mask != 0xFF)) {
-		fprintf(stderr,
-			"*** Warning: Can't handle masks in %s:%04X\n",
-			filename, id->class_mask);
+		warn("Can't handle masks in %s:%04X\n",
+		     filename, id->class_mask);
 		return 0;
 		return 0;
 	}
 	}
 
 
@@ -229,7 +228,7 @@ static int do_pci_entry(const char *filename,
 	return 1;
 	return 1;
 }
 }
 
 
-/* looks like: "ccw:tNmNdtNdmN" */ 
+/* looks like: "ccw:tNmNdtNdmN" */
 static int do_ccw_entry(const char *filename,
 static int do_ccw_entry(const char *filename,
 			struct ccw_device_id *id, char *alias)
 			struct ccw_device_id *id, char *alias)
 {
 {
@@ -445,8 +444,8 @@ static void do_table(void *symval, unsigned long size,
 	int (*do_entry)(const char *, void *entry, char *alias) = function;
 	int (*do_entry)(const char *, void *entry, char *alias) = function;
 
 
 	if (size % id_size || size < id_size) {
 	if (size % id_size || size < id_size) {
-		fprintf(stderr, "*** Warning: %s ids %lu bad size "
-			"(each on %lu)\n", mod->name, size, id_size);
+		warn("%s ids %lu bad size "
+		     "(each on %lu)\n", mod->name, size, id_size);
 	}
 	}
 	/* Leave last one: it's the terminator. */
 	/* Leave last one: it's the terminator. */
 	size -= id_size;
 	size -= id_size;

+ 2 - 2
scripts/mod/mk_elfconfig.c

@@ -6,7 +6,7 @@
 int
 int
 main(int argc, char **argv)
 main(int argc, char **argv)
 {
 {
-	unsigned char ei[EI_NIDENT];	
+	unsigned char ei[EI_NIDENT];
 	union { short s; char c[2]; } endian_test;
 	union { short s; char c[2]; } endian_test;
 
 
 	if (argc != 2) {
 	if (argc != 2) {
@@ -57,7 +57,7 @@ main(int argc, char **argv)
 
 
 	if ((strcmp(argv[1], "v850") == 0) || (strcmp(argv[1], "h8300") == 0))
 	if ((strcmp(argv[1], "v850") == 0) || (strcmp(argv[1], "h8300") == 0))
 		printf("#define MODULE_SYMBOL_PREFIX \"_\"\n");
 		printf("#define MODULE_SYMBOL_PREFIX \"_\"\n");
-	else 
+	else
 		printf("#define MODULE_SYMBOL_PREFIX \"\"\n");
 		printf("#define MODULE_SYMBOL_PREFIX \"\"\n");
 
 
 	return 0;
 	return 0;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 562 - 135
scripts/mod/modpost.c


+ 20 - 5
scripts/mod/modpost.h

@@ -13,20 +13,30 @@
 
 
 #if KERNEL_ELFCLASS == ELFCLASS32
 #if KERNEL_ELFCLASS == ELFCLASS32
 
 
-#define Elf_Ehdr    Elf32_Ehdr 
-#define Elf_Shdr    Elf32_Shdr 
+#define Elf_Ehdr    Elf32_Ehdr
+#define Elf_Shdr    Elf32_Shdr
 #define Elf_Sym     Elf32_Sym
 #define Elf_Sym     Elf32_Sym
+#define Elf_Addr    Elf32_Addr
+#define Elf_Section Elf32_Section
 #define ELF_ST_BIND ELF32_ST_BIND
 #define ELF_ST_BIND ELF32_ST_BIND
 #define ELF_ST_TYPE ELF32_ST_TYPE
 #define ELF_ST_TYPE ELF32_ST_TYPE
 
 
+#define Elf_Rela    Elf32_Rela
+#define ELF_R_SYM   ELF32_R_SYM
+#define ELF_R_TYPE  ELF32_R_TYPE
 #else
 #else
 
 
-#define Elf_Ehdr    Elf64_Ehdr 
-#define Elf_Shdr    Elf64_Shdr 
+#define Elf_Ehdr    Elf64_Ehdr
+#define Elf_Shdr    Elf64_Shdr
 #define Elf_Sym     Elf64_Sym
 #define Elf_Sym     Elf64_Sym
+#define Elf_Addr    Elf64_Addr
+#define Elf_Section Elf64_Section
 #define ELF_ST_BIND ELF64_ST_BIND
 #define ELF_ST_BIND ELF64_ST_BIND
 #define ELF_ST_TYPE ELF64_ST_TYPE
 #define ELF_ST_TYPE ELF64_ST_TYPE
 
 
+#define Elf_Rela    Elf64_Rela
+#define ELF_R_SYM   ELF64_R_SYM
+#define ELF_R_TYPE  ELF64_R_TYPE
 #endif
 #endif
 
 
 #if KERNEL_ELFDATA != HOST_ELFDATA
 #if KERNEL_ELFDATA != HOST_ELFDATA
@@ -91,17 +101,22 @@ struct elf_info {
 	unsigned int modinfo_len;
 	unsigned int modinfo_len;
 };
 };
 
 
+/* file2alias.c */
 void handle_moddevtable(struct module *mod, struct elf_info *info,
 void handle_moddevtable(struct module *mod, struct elf_info *info,
 			Elf_Sym *sym, const char *symname);
 			Elf_Sym *sym, const char *symname);
-
 void add_moddevtable(struct buffer *buf, struct module *mod);
 void add_moddevtable(struct buffer *buf, struct module *mod);
 
 
+/* sumversion.c */
 void maybe_frob_rcs_version(const char *modfilename,
 void maybe_frob_rcs_version(const char *modfilename,
 			    char *version,
 			    char *version,
 			    void *modinfo,
 			    void *modinfo,
 			    unsigned long modinfo_offset);
 			    unsigned long modinfo_offset);
 void get_src_version(const char *modname, char sum[], unsigned sumlen);
 void get_src_version(const char *modname, char sum[], unsigned sumlen);
 
 
+/* from modpost.c */
 void *grab_file(const char *filename, unsigned long *size);
 void *grab_file(const char *filename, unsigned long *size);
 char* get_next_line(unsigned long *pos, void *file, unsigned long size);
 char* get_next_line(unsigned long *pos, void *file, unsigned long size);
 void release_file(void *file, unsigned long size);
 void release_file(void *file, unsigned long size);
+
+void fatal(const char *fmt, ...);
+void warn(const char *fmt, ...);

+ 15 - 17
scripts/mod/sumversion.c

@@ -316,8 +316,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
 
 
 	file = grab_file(cmd, &flen);
 	file = grab_file(cmd, &flen);
 	if (!file) {
 	if (!file) {
-		fprintf(stderr, "Warning: could not find %s for %s\n",
-			cmd, objfile);
+		warn("could not find %s for %s\n", cmd, objfile);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -355,9 +354,8 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
 		/* Check if this file is in same dir as objfile */
 		/* Check if this file is in same dir as objfile */
 		if ((strstr(line, dir)+strlen(dir)-1) == strrchr(line, '/')) {
 		if ((strstr(line, dir)+strlen(dir)-1) == strrchr(line, '/')) {
 			if (!parse_file(line, md)) {
 			if (!parse_file(line, md)) {
-				fprintf(stderr,
-					"Warning: could not open %s: %s\n",
-					line, strerror(errno));
+				warn("could not open %s: %s\n",
+				     line, strerror(errno));
 				goto out_file;
 				goto out_file;
 			}
 			}
 
 
@@ -383,8 +381,11 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
 	struct md4_ctx md;
 	struct md4_ctx md;
 	char *sources, *end, *fname;
 	char *sources, *end, *fname;
 	const char *basename;
 	const char *basename;
-	char filelist[strlen(getenv("MODVERDIR")) + strlen("/") +
-		      strlen(modname) - strlen(".o") + strlen(".mod") + 1 ];
+	char filelist[PATH_MAX + 1];
+	char *modverdir = getenv("MODVERDIR");
+
+	if (!modverdir)
+		modverdir = ".";
 
 
 	/* Source files for module are in .tmp_versions/modname.mod,
 	/* Source files for module are in .tmp_versions/modname.mod,
 	   after the first line. */
 	   after the first line. */
@@ -392,28 +393,25 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
 		basename = strrchr(modname, '/') + 1;
 		basename = strrchr(modname, '/') + 1;
 	else
 	else
 		basename = modname;
 		basename = modname;
-	sprintf(filelist, "%s/%.*s.mod", getenv("MODVERDIR"),
+	sprintf(filelist, "%s/%.*s.mod", modverdir,
 		(int) strlen(basename) - 2, basename);
 		(int) strlen(basename) - 2, basename);
 
 
 	file = grab_file(filelist, &len);
 	file = grab_file(filelist, &len);
 	if (!file) {
 	if (!file) {
-		fprintf(stderr, "Warning: could not find versions for %s\n",
-			filelist);
+		warn("could not find versions for %s\n", filelist);
 		return;
 		return;
 	}
 	}
 
 
 	sources = strchr(file, '\n');
 	sources = strchr(file, '\n');
 	if (!sources) {
 	if (!sources) {
-		fprintf(stderr, "Warning: malformed versions file for %s\n",
-			modname);
+		warn("malformed versions file for %s\n", modname);
 		goto release;
 		goto release;
 	}
 	}
 
 
 	sources++;
 	sources++;
 	end = strchr(sources, '\n');
 	end = strchr(sources, '\n');
 	if (!end) {
 	if (!end) {
-		fprintf(stderr, "Warning: bad ending versions file for %s\n",
-			modname);
+		warn("bad ending versions file for %s\n", modname);
 		goto release;
 		goto release;
 	}
 	}
 	*end = '\0';
 	*end = '\0';
@@ -438,19 +436,19 @@ static void write_version(const char *filename, const char *sum,
 
 
 	fd = open(filename, O_RDWR);
 	fd = open(filename, O_RDWR);
 	if (fd < 0) {
 	if (fd < 0) {
-		fprintf(stderr, "Warning: changing sum in %s failed: %s\n",
+		warn("changing sum in %s failed: %s\n",
 			filename, strerror(errno));
 			filename, strerror(errno));
 		return;
 		return;
 	}
 	}
 
 
 	if (lseek(fd, offset, SEEK_SET) == (off_t)-1) {
 	if (lseek(fd, offset, SEEK_SET) == (off_t)-1) {
-		fprintf(stderr, "Warning: changing sum in %s:%lu failed: %s\n",
+		warn("changing sum in %s:%lu failed: %s\n",
 			filename, offset, strerror(errno));
 			filename, offset, strerror(errno));
 		goto out;
 		goto out;
 	}
 	}
 
 
 	if (write(fd, sum, strlen(sum)+1) != strlen(sum)+1) {
 	if (write(fd, sum, strlen(sum)+1) != strlen(sum)+1) {
-		fprintf(stderr, "Warning: writing sum in %s failed: %s\n",
+		warn("writing sum in %s failed: %s\n",
 			filename, strerror(errno));
 			filename, strerror(errno));
 		goto out;
 		goto out;
 	}
 	}

+ 2 - 2
scripts/namespace.pl

@@ -66,8 +66,8 @@ require 5;	# at least perl 5
 use strict;
 use strict;
 use File::Find;
 use File::Find;
 
 
-my $nm = "/usr/bin/nm -p";
-my $objdump = "/usr/bin/objdump -s -j .comment";
+my $nm = ($ENV{'NM'} || "nm") . " -p";
+my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment";
 my $srctree = "";
 my $srctree = "";
 my $objtree = "";
 my $objtree = "";
 $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'}));
 $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'}));

+ 8 - 12
scripts/package/Makefile

@@ -32,12 +32,11 @@ MKSPEC     := $(srctree)/scripts/package/mkspec
 PREV       := set -e; cd ..;
 PREV       := set -e; cd ..;
 
 
 # rpm-pkg
 # rpm-pkg
-.PHONY: rpm-pkg rpm
-
+# ---------------------------------------------------------------------------
 $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
 $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
 	$(CONFIG_SHELL) $(MKSPEC) > $@
 	$(CONFIG_SHELL) $(MKSPEC) > $@
 
 
-rpm-pkg rpm: $(objtree)/kernel.spec
+rpm-pkg rpm: $(objtree)/kernel.spec FORCE
 	$(MAKE) clean
 	$(MAKE) clean
 	$(PREV) ln -sf $(srctree) $(KERNELPATH)
 	$(PREV) ln -sf $(srctree) $(KERNELPATH)
 	$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
 	$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
@@ -54,11 +53,11 @@ rpm-pkg rpm: $(objtree)/kernel.spec
 clean-files := $(objtree)/kernel.spec
 clean-files := $(objtree)/kernel.spec
 
 
 # binrpm-pkg
 # binrpm-pkg
-.PHONY: binrpm-pkg
+# ---------------------------------------------------------------------------
 $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
 $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
 	$(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
 	$(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
-	
-binrpm-pkg: $(objtree)/binkernel.spec
+
+binrpm-pkg: $(objtree)/binkernel.spec FORCE
 	$(MAKE) KBUILD_SRC=
 	$(MAKE) KBUILD_SRC=
 	set -e; \
 	set -e; \
 	$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
 	$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
@@ -71,9 +70,7 @@ clean-files += $(objtree)/binkernel.spec
 
 
 # Deb target
 # Deb target
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
-#
-.PHONY: deb-pkg
-deb-pkg:
+deb-pkg: FORCE
 	$(MAKE) KBUILD_SRC=
 	$(MAKE) KBUILD_SRC=
 	$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
 	$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
 
 
@@ -82,8 +79,7 @@ clean-dirs += $(objtree)/debian/
 
 
 # tarball targets
 # tarball targets
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
-.PHONY: tar%pkg
-tar%pkg:
+tar%pkg: FORCE
 	$(MAKE) KBUILD_SRC=
 	$(MAKE) KBUILD_SRC=
 	$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
 	$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
 
 
@@ -92,7 +88,7 @@ clean-dirs += $(objtree)/tar-install/
 
 
 # Help text displayed when executing 'make help'
 # Help text displayed when executing 'make help'
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
-help:
+help: FORCE
 	@echo '  rpm-pkg         - Build the kernel as an RPM package'
 	@echo '  rpm-pkg         - Build the kernel as an RPM package'
 	@echo '  binrpm-pkg      - Build an rpm package containing the compiled kernel'
 	@echo '  binrpm-pkg      - Build an rpm package containing the compiled kernel'
 	@echo '                    and modules'
 	@echo '                    and modules'

+ 0 - 112
scripts/reference_discarded.pl

@@ -1,112 +0,0 @@
-#!/usr/bin/perl -w
-#
-# reference_discarded.pl (C) Keith Owens 2001 <kaos@ocs.com.au>
-#
-# Released under GPL V2.
-#
-# List dangling references to vmlinux discarded sections.
-
-use strict;
-die($0 . " takes no arguments\n") if($#ARGV >= 0);
-
-my %object;
-my $object;
-my $line;
-my $ignore;
-my $errorcount;
-
-$| = 1;
-
-# printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
-while (defined($line = <OBJDUMP_LIST>)) {
-	chomp($line);
-	if ($line =~ /:\s+file format/) {
-		($object = $line) =~ s/:.*//;
-		$object{$object}->{'module'} = 0;
-		$object{$object}->{'size'} = 0;
-		$object{$object}->{'off'} = 0;
-	}
-	if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
-		$object{$object}->{'module'} = 1;
-	}
-	if ($line =~ /^\s*\d+\s+\.comment\s+/) {
-		($object{$object}->{'size'}, $object{$object}->{'off'}) = (split(' ', $line))[2,5];
-	}
-}
-close(OBJDUMP_LIST);
-# printf("%d objects, ", scalar keys(%object));
-$ignore = 0;
-foreach $object (keys(%object)) {
-	if ($object{$object}->{'module'}) {
-		++$ignore;
-		delete($object{$object});
-	}
-}
-# printf("ignoring %d module(s)\n", $ignore);
-
-# Ignore conglomerate objects, they have been built from multiple objects and we
-# only care about the individual objects.  If an object has more than one GCC:
-# string in the comment section then it is conglomerate.  This does not filter
-# out conglomerates that consist of exactly one object, can't be helped.
-
-# printf("Finding conglomerates, ");
-$ignore = 0;
-foreach $object (keys(%object)) {
-	if (exists($object{$object}->{'off'})) {
-		my ($off, $size, $comment, $l);
-		$off = hex($object{$object}->{'off'});
-		$size = hex($object{$object}->{'size'});
-		open(OBJECT, "<$object") || die "cannot read $object";
-		seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
-		$l = read(OBJECT, $comment, $size);
-		die "read $size bytes from $object .comment failed" if ($l != $size);
-		close(OBJECT);
-		if ($comment =~ /GCC\:.*GCC\:/m || $object =~ /built-in\.o/) {
-			++$ignore;
-			delete($object{$object});
-		}
-	}
-}
-# printf("ignoring %d conglomerate(s)\n", $ignore);
-
-# printf("Scanning objects\n");
-
-# Keith Ownes <kaos@sgi.com> commented:
-# For our future {in}sanity, add a comment that this is the ppc .opd
-# section, not the ia64 .opd section.
-# ia64 .opd should not point to discarded sections.
-$errorcount = 0;
-foreach $object (keys(%object)) {
-	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
-	while (defined($line = <OBJDUMP>)) {
-		chomp($line);
-		if ($line =~ /RELOCATION RECORDS FOR /) {
-			($from = $line) =~ s/.*\[([^]]*).*/$1/;
-		}
-		if (($line =~ /\.text\.exit$/ ||
-		     $line =~ /\.exit\.text$/ ||
-		     $line =~ /\.data\.exit$/ ||
-		     $line =~ /\.exit\.data$/ ||
-		     $line =~ /\.exitcall\.exit$/) &&
-		    ($from !~ /\.text\.exit$/ &&
-		     $from !~ /\.exit\.text$/ &&
-		     $from !~ /\.data\.exit$/ &&
-		     $from !~ /\.opd$/ &&
-		     $from !~ /\.exit\.data$/ &&
-		     $from !~ /\.altinstructions$/ &&
-		     $from !~ /\.pdr$/ &&
-		     $from !~ /\.debug_.*$/ &&
-		     $from !~ /\.exitcall\.exit$/ &&
-		     $from !~ /\.eh_frame$/ &&
-		     $from !~ /\.stab$/)) {
-			printf("Error: %s %s refers to %s\n", $object, $from, $line);
-			$errorcount = $errorcount + 1;
-		}
-	}
-	close(OBJDUMP);
-}
-# printf("Done\n");
-
-exit(0);

+ 0 - 108
scripts/reference_init.pl

@@ -1,108 +0,0 @@
-#!/usr/bin/perl -w
-#
-# reference_init.pl (C) Keith Owens 2002 <kaos@ocs.com.au>
-#
-# List references to vmlinux init sections from non-init sections.
-
-# Unfortunately I had to exclude references from read only data to .init
-# sections, almost all of these are false positives, they are created by
-# gcc.  The downside of excluding rodata is that there really are some
-# user references from rodata to init code, e.g. drivers/video/vgacon.c
-#
-# const struct consw vga_con = {
-#        con_startup:            vgacon_startup,
-#
-# where vgacon_startup is __init.  If you want to wade through the false
-# positives, take out the check for rodata.
-
-use strict;
-die($0 . " takes no arguments\n") if($#ARGV >= 0);
-
-my %object;
-my $object;
-my $line;
-my $ignore;
-
-$| = 1;
-
-printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
-while (defined($line = <OBJDUMP_LIST>)) {
-	chomp($line);
-	if ($line =~ /:\s+file format/) {
-		($object = $line) =~ s/:.*//;
-		$object{$object}->{'module'} = 0;
-		$object{$object}->{'size'} = 0;
-		$object{$object}->{'off'} = 0;
-	}
-	if ($line =~ /^\s*\d+\s+\.modinfo\s+/) {
-		$object{$object}->{'module'} = 1;
-	}
-	if ($line =~ /^\s*\d+\s+\.comment\s+/) {
-		($object{$object}->{'size'}, $object{$object}->{'off'}) = (split(' ', $line))[2,5];
-	}
-}
-close(OBJDUMP_LIST);
-printf("%d objects, ", scalar keys(%object));
-$ignore = 0;
-foreach $object (keys(%object)) {
-	if ($object{$object}->{'module'}) {
-		++$ignore;
-		delete($object{$object});
-	}
-}
-printf("ignoring %d module(s)\n", $ignore);
-
-# Ignore conglomerate objects, they have been built from multiple objects and we
-# only care about the individual objects.  If an object has more than one GCC:
-# string in the comment section then it is conglomerate.  This does not filter
-# out conglomerates that consist of exactly one object, can't be helped.
-
-printf("Finding conglomerates, ");
-$ignore = 0;
-foreach $object (keys(%object)) {
-	if (exists($object{$object}->{'off'})) {
-		my ($off, $size, $comment, $l);
-		$off = hex($object{$object}->{'off'});
-		$size = hex($object{$object}->{'size'});
-		open(OBJECT, "<$object") || die "cannot read $object";
-		seek(OBJECT, $off, 0) || die "seek to $off in $object failed";
-		$l = read(OBJECT, $comment, $size);
-		die "read $size bytes from $object .comment failed" if ($l != $size);
-		close(OBJECT);
-		if ($comment =~ /GCC\:.*GCC\:/m || $object =~ /built-in\.o/) {
-			++$ignore;
-			delete($object{$object});
-		}
-	}
-}
-printf("ignoring %d conglomerate(s)\n", $ignore);
-
-printf("Scanning objects\n");
-foreach $object (sort(keys(%object))) {
-	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
-	while (defined($line = <OBJDUMP>)) {
-		chomp($line);
-		if ($line =~ /RELOCATION RECORDS FOR /) {
-			($from = $line) =~ s/.*\[([^]]*).*/$1/;
-		}
-		if (($line =~ /\.init$/ || $line =~ /\.init\./) &&
-		    ($from !~ /\.init$/ &&
-		     $from !~ /\.init\./ &&
-		     $from !~ /\.stab$/ &&
-		     $from !~ /\.rodata$/ &&
-		     $from !~ /\.text\.lock$/ &&
-		     $from !~ /\.pci_fixup_header$/ &&
-		     $from !~ /\.pci_fixup_final$/ &&
-		     $from !~ /\.pdr$/ &&
-		     $from !~ /\__param$/ &&
-		     $from !~ /\.altinstructions/ &&
-		     $from !~ /\.eh_frame/ &&
-		     $from !~ /\.debug_/)) {
-			printf("Error: %s %s refers to %s\n", $object, $from, $line);
-		}
-	}
-	close(OBJDUMP);
-}
-printf("Done\n");

+ 4 - 0
sound/oss/.gitignore

@@ -0,0 +1,4 @@
+#Ignore generated files
+maui_boot.h
+pss_boot.h
+trix_boot.h

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio