diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 23:48:16 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 23:48:16 -0700 |
| commit | a8c1914f6231dc62a4b1525e3a394b49e3675ebe (patch) | |
| tree | 9071ac3f8509b2e62835c35c5ce431ae912e1a6f | |
| parent | c3adda8107af12219941bc5de635ab121c72afd0 (diff) | |
| parent | a2c665b04fb8acd2de0216cf38215ef11904fbcd (diff) | |
Merge bk://linux-sam.bkbits.net/kbuild
into ppc970.osdl.org:/home/torvalds/v2.6/linux
122 files changed, 1986 insertions, 2323 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index bf212c0211c9..9a23eab001d4 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -185,9 +185,7 @@ clean-files := $(DOCBOOKS) \ $(patsubst %.sgml, %.9, $(DOCBOOKS)) \ $(C-procfs-example) -ifneq ($(wildcard $(patsubst %.html,%,$(HTML))),) -clean-rule := rm -rf $(wildcard $(patsubst %.html,%,$(HTML))) -endif +clean-dirs := $(patsubst %.sgml,%,$(DOCBOOKS)) #man put files in man subdir - traverse down subdir- := man/ diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index ec817761629d..8cb1f79f4316 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -25,6 +25,7 @@ This document describes the Linux kernel Makefiles. --- 4.4 Using C++ for host programs --- 4.5 Controlling compiler options for host programs --- 4.6 When host programs are actually built + --- 4.7 Using hostprogs-$(CONFIG_FOO) === 5 Kbuild clean infrastructure @@ -36,6 +37,8 @@ This document describes the Linux kernel Makefiles. --- 6.5 Building non-kbuild targets --- 6.6 Commands useful for building a boot image --- 6.7 Custom kbuild commands + --- 6.8 Preprocessing linker scripts + --- 6.9 $(CC) support functions === 7 Kbuild Variables === 8 Makefile language @@ -387,7 +390,7 @@ compilation stage. Two steps are required in order to use a host executable. The first step is to tell kbuild that a host program exists. This is -done utilising the variable host-prog. +done utilising the variable hostprogs-y. The second step is to add an explicit dependency to the executable. This can be done in two ways. Either add the dependency in a rule, @@ -402,7 +405,7 @@ Both possibilities are described in the following. built on the build host. Example: - host-progs := bin2hex + hostprogs-y := bin2hex Kbuild assumes in the above example that bin2hex is made from a single c-source file named bin2hex.c located in the same directory as @@ -418,7 +421,7 @@ Both possibilities are described in the following. Example: #scripts/lxdialog/Makefile - host-progs := lxdialog + hostprogs-y := lxdialog lxdialog-objs := checklist.o lxdialog.o Objects with extension .o are compiled from the corresponding .c @@ -438,7 +441,7 @@ Both possibilities are described in the following. Example: #scripts/kconfig/Makefile - host-progs := conf + hostprogs-y := conf conf-objs := conf.o libkconfig.so libkconfig-objs := expr.o type.o @@ -457,7 +460,7 @@ Both possibilities are described in the following. Example: #scripts/kconfig/Makefile - host-progs := qconf + hostprogs-y := qconf qconf-cxxobjs := qconf.o In the example above the executable is composed of the C++ file @@ -468,7 +471,7 @@ Both possibilities are described in the following. Example: #scripts/kconfig/Makefile - host-progs := qconf + hostprogs-y := qconf qconf-cxxobjs := qconf.o qconf-objs := check.o @@ -509,7 +512,7 @@ Both possibilities are described in the following. Example: #drivers/pci/Makefile - host-progs := gen-devlist + hostprogs-y := gen-devlist $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist ( cd $(obj); ./gen-devlist ) < $< @@ -524,18 +527,32 @@ Both possibilities are described in the following. Example: #scripts/lxdialog/Makefile - host-progs := lxdialog - always := $(host-progs) + hostprogs-y := lxdialog + always := $(hostprogs-y) This will tell kbuild to build lxdialog even if not referenced in any rule. +--- 4.7 Using hostprogs-$(CONFIG_FOO) + + A typcal pattern in a Kbuild file lok like this: + + Example: + #scripts/Makefile + hostprogs-$(CONFIG_KALLSYMS) += kallsyms + + Kbuild knows about both 'y' for built-in and 'm' for module. + So if a config symbol evaluate to 'm', kbuild will still build + the binary. In other words Kbuild handle hostprogs-m exactly + like hostprogs-y. But only hostprogs-y is recommend used + when no CONFIG symbol are involved. + === 5 Kbuild clean infrastructure "make clean" deletes most generated files in the src tree where the kernel is compiled. This includes generated files such as host programs. -Kbuild knows targets listed in $(host-progs), $(always), $(extra-y) and -$(targets). They are all deleted during "make clean". +Kbuild knows targets listed in $(hostprogs-y), $(hostprogs-m), $(always), +$(extra-y) and $(targets). They are all deleted during "make clean". Files matching the patterns "*.[oas]", "*.ko", plus some additional files generated by kbuild are deleted all over the kernel src tree when "make clean" is executed. @@ -547,8 +564,17 @@ Additional files can be specified in kbuild makefiles by use of $(clean-files). clean-files := devlist.h classlist.h When executing "make clean", the two files "devlist.h classlist.h" will -be deleted. Kbuild knows that files specified by $(clean-files) are -located in the same directory as the makefile. +be deleted. Kbuild will assume files to be in same relative directory as the +Makefile except if an absolute path is specified (path starting with '/'). + +To delete a directory hirachy use: + Example: + #scripts/package/Makefile + clean-dirs := $(objtree)/debian/ + +This will delete the directory debian, including all subdirectories. +Kbuild will assume the directories to be in the same relative path as the +Makefile if no absolute path is specified (path does not start with '/'). Usually kbuild descends down in subdirectories due to "obj-* := dir/", but in the architecture makefiles where the kbuild infrastructure @@ -914,6 +940,90 @@ When kbuild executes the following steps are followed (roughly): will be displayed with "make KBUILD_VERBOSE=0". +--- 6.8 Preprocessing linker scripts + + When the vmlinux image is build the linker script: + arch/$(ARCH)/kernel/vmlinux.lds is used. + The script is a preprocessed variant of the file vmlinux.lds.S + located in the same directory. + kbuild knows .lds file and includes a rule *lds.S -> *lds. + + Example: + #arch/i386/kernel/Makefile + always := vmlinux.lds + + #Makefile + export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) + + The assigment to $(always) is used to tell kbuild to build the + target: vmlinux.lds. + The assignment to $(CPPFLAGS_vmlinux.lds) tell kbuild to use the + specified options when building the target vmlinux.lds. + + When building the *.lds target kbuild used the variakles: + CPPFLAGS : Set in top-level Makefile + EXTRA_CPPFLAGS : May be set in the kbuild makefile + CPPFLAGS_$(@F) : Target specific flags. + Note that the full filename is used in this + assignment. + + The kbuild infrastructure for *lds file are used in several + 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-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 + GCC_VERSION := $(call cc-version) + cflags-y += $(shell \ + if [ $(GCC_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 The top Makefile exports the following variables: @@ -102,7 +102,7 @@ ifneq ($(KBUILD_OUTPUT),) # check that the output directory actually exists saved-output := $(KBUILD_OUTPUT) KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) -$(if $(wildcard $(KBUILD_OUTPUT)),, \ +$(if $(KBUILD_OUTPUT),, \ $(error output directory "$(saved-output)" does not exist)) .PHONY: $(MAKECMDGOALS) @@ -256,9 +256,32 @@ ifneq ($(findstring s,$(MAKEFLAGS)),) quiet=silent_ endif -check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) +export quiet Q KBUILD_VERBOSE + +###### +# cc support functions to be used (only) in arch/$(ARCH)/Makefile +# See documentation in Documentation/kbuild/makefiles.txt + +# cc-option +# Usage: cflags-y += $(call gcc-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 ;) + +# For backward compatibility +check_gcc = $(warning check_gcc is deprecated - use cc-option) \ + $(call cc-option, $(1),$(2)) + +# cc-option-yn +# Usage: flag := $(call gcc-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-version +# Usage gcc-ver := $(call cc-version $(CC)) +cc-version = $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ + $(if $(1), $(1), $(CC)) -export quiet Q KBUILD_VERBOSE check_gcc # Look for make include files relative to root of kernel src MAKEFLAGS += --include-dir=$(srctree) @@ -285,6 +308,7 @@ DEPMOD = /sbin/depmod KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse +CHECKFLAGS := MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) @@ -294,8 +318,12 @@ AFLAGS_KERNEL = NOSTDINC_FLAGS = -nostdinc -iwithprefix include -CPPFLAGS := -D__KERNEL__ -Iinclude \ - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) +# Use LINUXINCLUDE when you must reference the include/ directory. +# Needed to be compatible with the O= option +LINUXINCLUDE := -Iinclude \ + $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) + +CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common @@ -304,9 +332,9 @@ AFLAGS := -D__ASSEMBLY__ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ - HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK + HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK CHECKFLAGS -export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS +export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE @@ -458,7 +486,7 @@ CFLAGS += -g endif # warn about C99 declaration after statement -CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,) +CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) # # INSTALL_PATH specifies where to place the updated kernel and system map @@ -506,7 +534,6 @@ libs-y := $(libs-y1) $(libs-y2) # normal descending-into-subdirs phase, since at that time # we cannot yet know if we will need to relink vmlinux. # So we descend into init/ inside the rule for vmlinux again. -head-y += $(HEAD) vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) quiet_cmd_vmlinux__ = LD $@ @@ -538,9 +565,10 @@ define rule_vmlinux__ echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd endef -do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) - -LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s +quiet_cmd_sysmap = SYSMAP + cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap + +LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds # Generate section listing all symbols and add it into vmlinux # It's a three stage process: @@ -570,8 +598,10 @@ endif kallsyms.o := .tmp_kallsyms$(last_kallsyms).o define rule_verify_kallsyms - @$(call do_system_map, .tmp_vmlinux$(last_kallsyms), .tmp_System.map) - @cmp -s System.map .tmp_System.map || \ + $(Q)$(if $($(quiet)cmd_sysmap), \ + echo ' $($(quiet)cmd_sysmap) .tmp_System.map' &&) \ + $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map + $(Q)cmp -s System.map .tmp_System.map || \ (echo Inconsistent kallsyms data, try setting CONFIG_KALLSYMS_EXTRA_PASS ; rm .tmp_kallsyms* ; false) endef @@ -581,35 +611,46 @@ cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--al .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE $(call if_changed_dep,as_o_S) -.tmp_kallsyms%.S: .tmp_vmlinux% +.tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) $(call cmd,kallsyms) -.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) -.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) -.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) +# Needs to visit scripts/ before $(KALLSYMS) can be used. +$(KALLSYMS): scripts ; + endif -# Finally the vmlinux rule +# Finally the vmlinux rule +# This rule is also used to generate System.map +# and to verify that the content of kallsyms are consistent define rule_vmlinux - $(rule_vmlinux__); \ - $(call do_system_map, $@, System.map) + $(rule_vmlinux__); + $(Q)$(if $($(quiet)cmd_sysmap), \ + echo ' $($(quiet)cmd_sysmap) System.map' &&) \ + $(cmd_sysmap) $@ System.map; \ + if [ $$? -ne 0 ]; then \ + rm -f $@; \ + /bin/false; \ + fi; $(rule_verify_kallsyms) endef -vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux) # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; +$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds: $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs) # Preset locale variables to speed up the build process. Limit locale @@ -667,7 +708,7 @@ prepare-all: prepare0 prepare # Leave this as default for preprocessing vmlinux.lds.S, which is now # done in arch/$(ARCH)/kernel/Makefile -export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) +export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) # Single targets # --------------------------------------------------------------------------- @@ -940,7 +981,8 @@ help: @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @echo ' make O=dir [targets] Locate all output files in "dir", including .config' - @echo ' make C=1 [targets] Check all c source with checker tool' + @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse)' + @echo ' make C=2 [targets] Force check of all c source with $$CHECK (sparse)' @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file' diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index e1f20ca1cfbb..541bd7965909 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -462,11 +462,6 @@ config ALPHA_SRM If unsure, say N. -config EARLY_PRINTK - bool - depends on ALPHA_GENERIC || ALPHA_SRM - default y - config EISA bool depends on ALPHA_GENERIC || ALPHA_JENSEN || ALPHA_ALCOR || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_RAWHIDE @@ -593,104 +588,7 @@ source "fs/Kconfig" source "arch/alpha/oprofile/Kconfig" -menu "Kernel hacking" - -config ALPHA_LEGACY_START_ADDRESS - bool "Legacy kernel start address" - depends on ALPHA_GENERIC - default n - ---help--- - The 2.4 kernel changed the kernel start address from 0x310000 - to 0x810000 to make room for the Wildfire's larger SRM console. - Recent consoles on Titan and Marvel machines also require the - extra room. - - If you're using aboot 0.7 or later, the bootloader will examine the - ELF headers to determine where to transfer control. Unfortunately, - most older bootloaders -- APB or MILO -- hardcoded the kernel start - address rather than examining the ELF headers, and the result is a - hard lockup. - - Say Y if you have a broken bootloader. Say N if you do not, or if - you wish to run on Wildfire, Titan, or Marvel. - -config ALPHA_LEGACY_START_ADDRESS - bool - depends on !ALPHA_GENERIC && !ALPHA_TITAN && !ALPHA_MARVEL && !ALPHA_WILDFIRE - default y - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config MATHEMU - tristate "Kernel FP software completion" if DEBUG_KERNEL && !SMP - default y if !DEBUG_KERNEL || SMP - help - This option is required for IEEE compliant floating point arithmetic - on the Alpha. The only time you would ever not say Y is to say M in - order to debug the code. Say Y unless you know what you are doing. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_RWLOCK - bool "Read-write spinlock debugging" - depends on DEBUG_KERNEL - help - If you say Y here then read-write lock processing will count how many - times it has tried to get the lock and issue an error message after - too many attempts. If you suspect a rwlock problem or a kernel - hacker asks for this option then say Y. Otherwise say N. - -config DEBUG_SEMAPHORE - bool "Semaphore debugging" - depends on DEBUG_KERNEL - help - If you say Y here then semaphore processing will issue lots of - verbose debugging messages. If you suspect a semaphore problem or a - kernel hacker asks for this option then say Y. Otherwise say N. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -endmenu +source "arch/alpha/Kconfig.debug" source "security/Kconfig" diff --git a/arch/alpha/Kconfig.debug b/arch/alpha/Kconfig.debug new file mode 100644 index 000000000000..36d0106c32eb --- /dev/null +++ b/arch/alpha/Kconfig.debug @@ -0,0 +1,59 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config EARLY_PRINTK + bool + depends on ALPHA_GENERIC || ALPHA_SRM + default y + +config DEBUG_RWLOCK + bool "Read-write spinlock debugging" + depends on DEBUG_KERNEL + help + If you say Y here then read-write lock processing will count how many + times it has tried to get the lock and issue an error message after + too many attempts. If you suspect a rwlock problem or a kernel + hacker asks for this option then say Y. Otherwise say N. + +config DEBUG_SEMAPHORE + bool "Semaphore debugging" + depends on DEBUG_KERNEL + help + If you say Y here then semaphore processing will issue lots of + verbose debugging messages. If you suspect a semaphore problem or a + kernel hacker asks for this option then say Y. Otherwise say N. + +config ALPHA_LEGACY_START_ADDRESS + bool "Legacy kernel start address" + depends on ALPHA_GENERIC + default n + ---help--- + The 2.4 kernel changed the kernel start address from 0x310000 + to 0x810000 to make room for the Wildfire's larger SRM console. + Recent consoles on Titan and Marvel machines also require the + extra room. + + If you're using aboot 0.7 or later, the bootloader will examine the + ELF headers to determine where to transfer control. Unfortunately, + most older bootloaders -- APB or MILO -- hardcoded the kernel start + address rather than examining the ELF headers, and the result is a + hard lockup. + + Say Y if you have a broken bootloader. Say N if you do not, or if + you wish to run on Wildfire, Titan, or Marvel. + +config ALPHA_LEGACY_START_ADDRESS + bool + depends on !ALPHA_GENERIC && !ALPHA_TITAN && !ALPHA_MARVEL && !ALPHA_WILDFIRE + default y + +config MATHEMU + tristate "Kernel FP software completion" if DEBUG_KERNEL && !SMP + default y if !DEBUG_KERNEL || SMP + help + This option is required for IEEE compliant floating point arithmetic + on the Alpha. The only time you would ever not say Y is to say M in + order to debug the code. Say Y unless you know what you are doing. + +endmenu diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile index 0337f5f0d444..2702912059ed 100644 --- a/arch/alpha/Makefile +++ b/arch/alpha/Makefile @@ -11,7 +11,7 @@ NM := $(NM) -B LDFLAGS_vmlinux := -static -N #-relax -CHECK := $(CHECK) -D__alpha__=1 +CHECKFLAGS += -D__alpha__=1 cflags-y := -pipe -mno-fp-regs -ffixed-8 # Determine if we can use the BWX instructions with GAS. @@ -22,15 +22,11 @@ $(error The assembler '$(AS)' does not support the BWX instruction) endif # Determine if GCC understands the -mcpu= option. -have_mcpu := $(shell if $(CC) -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) - -have_mcpu_pca56 := $(shell if $(CC) -mcpu=pca56 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) - -have_mcpu_ev6 := $(shell if $(CC) -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) - -have_mcpu_ev67 := $(shell if $(CC) -mcpu=ev67 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) - -have_msmall_data := $(shell if $(CC) -msmall-data -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi) +have_mcpu := $(call cc-option-yn, -mcpu=ev5) +have_mcpu_pca56 := $(call cc-option-yn, -mcpu=pca56) +have_mcpu_ev6 := $(call cc-option-yn, -mcpu=ev6) +have_mcpu_ev67 := $(call cc-option-yn, -mcpu=ev67) +have_msmall_data := $(call cc-option-yn, -msmall-data) cflags-$(have_msmall_data) += -msmall-data diff --git a/arch/alpha/boot/Makefile b/arch/alpha/boot/Makefile index e30945095f70..e1ae14cd2b4e 100644 --- a/arch/alpha/boot/Makefile +++ b/arch/alpha/boot/Makefile @@ -8,7 +8,7 @@ # Copyright (C) 1994 by Linus Torvalds # -host-progs := tools/mkbb tools/objstrip +hostprogs-y := tools/mkbb tools/objstrip targets := vmlinux.gz vmlinux \ vmlinux.nh tools/lxboot tools/bootlx tools/bootph \ tools/bootpzh bootloader bootpheader bootpzheader diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index 73202af82a4a..5dac761f2b97 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds EXTRA_AFLAGS := $(CFLAGS) EXTRA_CFLAGS := -Werror -Wno-sign-compare diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ac644beed720..1a285c98fcbd 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -65,7 +65,6 @@ config GENERIC_ISA_DMA source "init/Kconfig" - menu "System Type" choice @@ -252,7 +251,6 @@ config XSCALE_PMU endmenu - menu "General setup" # Select various configuration options depending on the machine type @@ -666,169 +664,10 @@ source "drivers/misc/Kconfig" source "drivers/usb/Kconfig" - -menu "Kernel hacking" - -# RMK wants arm kernels compiled with frame pointers so hardwire this to y. -# If you know what you are doing and are willing to live without stack -# traces, you can get a slightly smaller kernel by setting this option to -# n, but then RMK will have to kill you ;). -config FRAME_POINTER - bool - default y - help - If you say N here, the resulting kernel will be slightly smaller and - faster. However, when a problem occurs with the kernel, the - information that is reported is severely limited. Most people - should say Y here. - -config DEBUG_USER - bool "Verbose user fault messages" - help - When a user program crashes due to an exception, the kernel can - print a brief message explaining what the problem was. This is - sometimes helpful for debugging but serves no purpose on a - production system. Most people should say N here. - - In addition, you need to pass user_debug=N on the kernel command - line to enable this feature. N consists of the sum of: - - 1 - undefined instruction events - 2 - system calls - 4 - invalid data aborts - 8 - SIGSEGV faults - 16 - SIGBUS faults - -config DEBUG_INFO - bool "Include GDB debugging information in kernel binary" - help - Say Y here to include source-level debugging information in the - `vmlinux' binary image. This is handy if you want to use gdb or - addr2line to debug the kernel. It has no impact on the in-memory - footprint of the running kernel but it can increase the amount of - time and disk space needed for compilation of the kernel. If in - doubt say N. - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_WAITQ - bool "Wait queue debugging" - depends on DEBUG_KERNEL - -config DEBUG_BUGVERBOSE - bool "Verbose BUG() reporting (adds 70K)" - depends on DEBUG_KERNEL - help - Say Y here to make BUG() panics output the file name and line number - of the BUG call as well as the EIP and oops trace. This aids - debugging but costs about 70-100K of memory. - -config DEBUG_ERRORS - bool "Verbose kernel error messages" - depends on DEBUG_KERNEL - help - This option controls verbose debugging information which can be - printed when the kernel detects an internal error. This debugging - information is useful to kernel hackers when tracking down problems, - but mostly meaningless to other people. It's safe to say Y unless - you are concerned with the code size or don't want to see these - messages. - -# These options are only for real kernel hackers who want to get their hands dirty. -config DEBUG_LL - bool "Kernel low-level debugging functions" - depends on DEBUG_KERNEL - help - Say Y here to include definitions of printascii, printchar, printhex - in the kernel. This is helpful if you are debugging code that - executes before the console is initialized. - -config DEBUG_ICEDCC - bool "Kernel low-level debugging via EmbeddedICE DCC channel" - depends on DEBUG_LL - help - Say Y here if you want the debug print routines to direct their - output to the EmbeddedICE macrocell's DCC channel using - co-processor 14. This is known to work on the ARM9 style ICE - channel. - - It does include a timeout to ensure that the system does not - totally freeze when there is nothing connected to read. - -config DEBUG_DC21285_PORT - bool "Kernel low-level debugging messages via footbridge serial port" - depends on DEBUG_LL && FOOTBRIDGE - help - Say Y here if you want the debug print routines to direct their - output to the serial port in the DC21285 (Footbridge). Saying N - will cause the debug messages to appear on the first 16550 - serial port. - -config DEBUG_CLPS711X_UART2 - bool "Kernel low-level debugging messages via UART2" - depends on DEBUG_LL && ARCH_CLPS711X - help - Say Y here if you want the debug print routines to direct their - output to the second serial port on these devices. Saying N will - cause the debug messages to appear on the first serial port. - -config DEBUG_S3C2410_PORT - depends on DEBUG_LL && ARCH_S3C2410 - bool "Kernel low-level debugging messages via S3C2410 UART" - help - Say Y here if you want debug print routines to go to one of the - S3C2410 internal UARTs. The chosen UART must have been configured - before it is used. - -config DEBUG_S3C2410_UART - depends on DEBUG_LL && ARCH_S3C2410 - int "S3C2410 UART to use for low-level debug" - default "0" - help - Choice for UART for kernel low-level using S3C2410 UARTS, - should be between zero and two. The port must have been - initalised by the boot-loader before use. - -endmenu +source "arch/arm/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug new file mode 100644 index 000000000000..266f46ca03c6 --- /dev/null +++ b/arch/arm/Kconfig.debug @@ -0,0 +1,115 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +# RMK wants arm kernels compiled with frame pointers so hardwire this to y. +# If you know what you are doing and are willing to live without stack +# traces, you can get a slightly smaller kernel by setting this option to +# n, but then RMK will have to kill you ;). +config FRAME_POINTER + bool + default y + help + If you say N here, the resulting kernel will be slightly smaller and + faster. However, when a problem occurs with the kernel, the + information that is reported is severely limited. Most people + should say Y here. + +config DEBUG_USER + bool "Verbose user fault messages" + help + When a user program crashes due to an exception, the kernel can + print a brief message explaining what the problem was. This is + sometimes helpful for debugging but serves no purpose on a + production system. Most people should say N here. + + In addition, you need to pass user_debug=N on the kernel command + line to enable this feature. N consists of the sum of: + + 1 - undefined instruction events + 2 - system calls + 4 - invalid data aborts + 8 - SIGSEGV faults + 16 - SIGBUS faults + +config DEBUG_WAITQ + bool "Wait queue debugging" + depends on DEBUG_KERNEL + +config DEBUG_ERRORS + bool "Verbose kernel error messages" + depends on DEBUG_KERNEL + help + This option controls verbose debugging information which can be + printed when the kernel detects an internal error. This debugging + information is useful to kernel hackers when tracking down problems, + but mostly meaningless to other people. It's safe to say Y unless + you are concerned with the code size or don't want to see these + messages. + +config DEBUG_INFO + bool "Include GDB debugging information in kernel binary" + help + Say Y here to include source-level debugging information in the + `vmlinux' binary image. This is handy if you want to use gdb or + addr2line to debug the kernel. It has no impact on the in-memory + footprint of the running kernel but it can increase the amount of + time and disk space needed for compilation of the kernel. If in + doubt say N. + +# These options are only for real kernel hackers who want to get their hands dirty. +config DEBUG_LL + bool "Kernel low-level debugging functions" + depends on DEBUG_KERNEL + help + Say Y here to include definitions of printascii, printchar, printhex + in the kernel. This is helpful if you are debugging code that + executes before the console is initialized. + +config DEBUG_ICEDCC + bool "Kernel low-level debugging via EmbeddedICE DCC channel" + depends on DEBUG_LL + help + Say Y here if you want the debug print routines to direct their + output to the EmbeddedICE macrocell's DCC channel using + co-processor 14. This is known to work on the ARM9 style ICE + channel. + + It does include a timeout to ensure that the system does not + totally freeze when there is nothing connected to read. + +config DEBUG_DC21285_PORT + bool "Kernel low-level debugging messages via footbridge serial port" + depends on DEBUG_LL && FOOTBRIDGE + help + Say Y here if you want the debug print routines to direct their + output to the serial port in the DC21285 (Footbridge). Saying N + will cause the debug messages to appear on the first 16550 + serial port. + +config DEBUG_CLPS711X_UART2 + bool "Kernel low-level debugging messages via UART2" + depends on DEBUG_LL && ARCH_CLPS711X + help + Say Y here if you want the debug print routines to direct their + output to the second serial port on these devices. Saying N will + cause the debug messages to appear on the first serial port. + +config DEBUG_S3C2410_PORT + depends on DEBUG_LL && ARCH_S3C2410 + bool "Kernel low-level debugging messages via S3C2410 UART" + help + Say Y here if you want debug print routines to go to one of the + S3C2410 internal UARTs. The chosen UART must have been configured + before it is used. + +config DEBUG_S3C2410_UART + depends on DEBUG_LL && ARCH_S3C2410 + int "S3C2410 UART to use for low-level debug" + default "0" + help + Choice for UART for kernel low-level using S3C2410 UARTS, + should be between zero and two. The port must have been + initalised by the boot-loader before use. + +endmenu diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ca201efcfb15..4b7a353ae30f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -9,7 +9,7 @@ LDFLAGS_vmlinux :=-p --no-undefined -X LDFLAGS_BLOB :=--format binary -AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) +CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) OBJCOPYFLAGS :=-O binary -R .note -R .comment -S GZFLAGS :=-9 #CFLAGS +=-pipe @@ -36,8 +36,8 @@ comma = , # Note that GCC does not numerically define an architecture version # macro, but instead defines a whole series of macros which makes # testing for a specific architecture or later rather impossible. -arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call check_gcc,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) -arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call check_gcc,-march=armv5te,-march=armv4) +arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) +arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4) arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 @@ -51,14 +51,14 @@ tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 -tune-$(CONFIG_CPU_XSCALE) :=$(call check_gcc,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale +tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale tune-$(CONFIG_CPU_V6) :=-mtune=strongarm # Need -Uarm for gcc < 3.x -CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm +CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call cc-option,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu -CHECK := $(CHECK) -D__arm__=1 +CHECKFLAGS += -D__arm__=1 #Default value DATAADDR := . diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 67d874abad7a..936dee40e5e7 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -29,7 +29,7 @@ endif head-y := head.o obj-$(CONFIG_DEBUG_LL) += debug.o -extra-y := $(head-y) init_task.o vmlinux.lds.s +extra-y := $(head-y) init_task.o vmlinux.lds # Spell out some dependencies that aren't automatically figured out $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig index ce96fd34b17e..d51376a092a9 100644 --- a/arch/arm26/Kconfig +++ b/arch/arm26/Kconfig @@ -62,7 +62,7 @@ config ARCH_ARC bool "Archimedes" help Say Y to support the Acorn Archimedes. - + The Acorn Archimedes was an personal computer based on an 8MHz ARM2 processor, released in 1987. It supported up to 16MB of RAM in later models and floppy, harddisc, ethernet etc. @@ -71,7 +71,7 @@ config ARCH_A5K bool "A5000" help Say Y here to to support the Acorn A5000. - + Linux can support the internal IDE disk and CD-ROM interface, serial and parallel port, and the floppy drive. Note that on some A5000s the floppy is @@ -214,118 +214,7 @@ source "drivers/misc/Kconfig" source "drivers/usb/Kconfig" -menu "Kernel hacking" - -# RMK wants arm kernels compiled with frame pointers so hardwire this to y. -# If you know what you are doing and are willing to live without stack -# traces, you can get a slightly smaller kernel by setting this option to -# n, but then RMK will have to kill you ;). -config FRAME_POINTER - bool - default y - help - If you say N here, the resulting kernel will be slightly smaller and - faster. However, when a problem occurs with the kernel, the - information that is reported is severely limited. Most people - should say Y here. - -config DEBUG_USER - bool "Verbose user fault messages" - help - When a user program crashes due to an exception, the kernel can - print a brief message explaining what the problem was. This is - sometimes helpful for debugging but serves no purpose on a - production system. Most people should say N here. - -config DEBUG_INFO - bool "Include GDB debugging information in kernel binary" - help - Say Y here to include source-level debugging information in the - `vmlinux' binary image. This is handy if you want to use gdb or - addr2line to debug the kernel. It has no impact on the in-memory - footprint of the running kernel but it can increase the amount of - time and disk space needed for compilation of the kernel. If in - doubt say N. - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_WAITQ - bool "Wait queue debugging" - depends on DEBUG_KERNEL - -config DEBUG_BUGVERBOSE - bool "Verbose BUG() reporting (adds 70K)" - depends on DEBUG_KERNEL - help - Say Y here to make BUG() panics output the file name and line number - of the BUG call as well as the EIP and oops trace. This aids - debugging but costs about 70-100K of memory. - -config DEBUG_ERRORS - bool "Verbose kernel error messages" - depends on DEBUG_KERNEL - help - This option controls verbose debugging information which can be - printed when the kernel detects an internal error. This debugging - information is useful to kernel hackers when tracking down problems, - but mostly meaningless to other people. It's safe to say Y unless - you are concerned with the code size or don't want to see these - messages. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -# These options are only for real kernel hackers who want to get their hands dirty. -config DEBUG_LL - bool "Kernel low-level debugging functions" - depends on DEBUG_KERNEL - help - Say Y here to include definitions of printascii, printchar, printhex - in the kernel. This is helpful if you are debugging code that - executes before the console is initialized. - -endmenu +source "arch/arm26/Kconfig.debug" source "security/Kconfig" diff --git a/arch/arm26/Kconfig.debug b/arch/arm26/Kconfig.debug new file mode 100644 index 000000000000..e2c920dc1a69 --- /dev/null +++ b/arch/arm26/Kconfig.debug @@ -0,0 +1,60 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +# RMK wants arm kernels compiled with frame pointers so hardwire this to y. +# If you know what you are doing and are willing to live without stack +# traces, you can get a slightly smaller kernel by setting this option to +# n, but then RMK will have to kill you ;). +config FRAME_POINTER + bool + default y + help + If you say N here, the resulting kernel will be slightly smaller and + faster. However, when a problem occurs with the kernel, the + information that is reported is severely limited. Most people + should say Y here. + +config DEBUG_USER + bool "Verbose user fault messages" + help + When a user program crashes due to an exception, the kernel can + print a brief message explaining what the problem was. This is + sometimes helpful for debugging but serves no purpose on a + production system. Most people should say N here. + +config DEBUG_WAITQ + bool "Wait queue debugging" + depends on DEBUG_KERNEL + +config DEBUG_ERRORS + bool "Verbose kernel error messages" + depends on DEBUG_KERNEL + help + This option controls verbose debugging information which can be + printed when the kernel detects an internal error. This debugging + information is useful to kernel hackers when tracking down problems, + but mostly meaningless to other people. It's safe to say Y unless + you are concerned with the code size or don't want to see these + messages. + +config DEBUG_INFO + bool "Include GDB debugging information in kernel binary" + help + Say Y here to include source-level debugging information in the + `vmlinux' binary image. This is handy if you want to use gdb or + addr2line to debug the kernel. It has no impact on the in-memory + footprint of the running kernel but it can increase the amount of + time and disk space needed for compilation of the kernel. If in + doubt say N. + +# These options are only for real kernel hackers who want to get their hands dirty. +config DEBUG_LL + bool "Kernel low-level debugging functions" + depends on DEBUG_KERNEL + help + Say Y here to include definitions of printascii, printchar, printhex + in the kernel. This is helpful if you are debugging code that + executes before the console is initialized. + +endmenu diff --git a/arch/arm26/Makefile b/arch/arm26/Makefile index 3b0294a8d06b..969231842eed 100644 --- a/arch/arm26/Makefile +++ b/arch/arm26/Makefile @@ -9,7 +9,7 @@ LDFLAGS_vmlinux :=-p -X LDFLAGS_BLOB :=--format binary -AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) +CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) OBJCOPYFLAGS :=-O binary -R .note -R .comment -S GZFLAGS :=-9 diff --git a/arch/arm26/kernel/Makefile b/arch/arm26/kernel/Makefile index 7e10b557cb1d..e2e5503f7192 100644 --- a/arch/arm26/kernel/Makefile +++ b/arch/arm26/kernel/Makefile @@ -14,5 +14,5 @@ obj-y := compat.o dma.o entry.o irq.o \ obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_MODULES) += armksyms.o -extra-y := init_task.o vmlinux.lds.s +extra-y := init_task.o vmlinux.lds diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 481edcadc057..81a4a9c18927 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig @@ -20,8 +20,11 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool -source "init/Kconfig" +config CRIS + bool + default y +source "init/Kconfig" menu "General setup" @@ -51,7 +54,7 @@ config ETRAX_FAST_TIMER bool "Enable ETRAX fast timer API" help This options enables the API to a fast timer implementation using - timer1 to get sub jiffie resolution timers (primarily one-shot + timer1 to get sub jiffie resolution timers (primarily one-shot timers). This is needed if CONFIG_ETRAX_SERIAL_FAST_TIMER is enabled. @@ -69,7 +72,6 @@ config PREEMPT endmenu - menu "Hardware setup" choice @@ -96,7 +98,7 @@ endchoice config ETRAX_ARCH_V10 bool default y if ETRAX100LX || ETRAX100LX_V2 - default n if !(ETRAX100LX || ETRAX100LX_V2) + default n if !(ETRAX100LX || ETRAX100LX_V2) config ETRAX_DRAM_SIZE int "DRAM size (dec, in MB)" @@ -165,54 +167,10 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -menu "Kernel hacking" - -#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC -config PROFILE - bool "Kernel profiling support" - -config PROFILE_SHIFT - int "Profile shift count" - depends on PROFILE - default "2" - -config ETRAX_KGDB - bool "Use kernel GDB debugger" - ---help--- - The CRIS version of gdb can be used to remotely debug a running - Linux kernel via the serial debug port. Provided you have gdb-cris - installed, run gdb-cris vmlinux, then type - - (gdb) set remotebaud 115200 <- kgdb uses 115200 as default - (gdb) target remote /dev/ttyS0 <- maybe you use another port - - This should connect you to your booted kernel (or boot it now if you - didn't before). The kernel halts when it boots, waiting for gdb if - this option is turned on! - - -config DEBUG_INFO - bool "Compile the kernel with debug info" - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -endmenu +source "arch/cris/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/cris/Kconfig.debug b/arch/cris/Kconfig.debug new file mode 100644 index 000000000000..9864aade2592 --- /dev/null +++ b/arch/cris/Kconfig.debug @@ -0,0 +1,28 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC +config PROFILE + bool "Kernel profiling support" + +config PROFILE_SHIFT + int "Profile shift count" + depends on PROFILE + default "2" + +config ETRAX_KGDB + bool "Use kernel GDB debugger" + ---help--- + The CRIS version of gdb can be used to remotely debug a running + Linux kernel via the serial debug port. Provided you have gdb-cris + installed, run gdb-cris vmlinux, then type + + (gdb) set remotebaud 115200 <- kgdb uses 115200 as default + (gdb) target remote /dev/ttyS0 <- maybe you use another port + + This should connect you to your booted kernel (or boot it now if you + didn't before). The kernel halts when it boots, waiting for gdb if + this option is turned on! + +endmenu diff --git a/arch/cris/Makefile b/arch/cris/Makefile index 30585a70cfab..1c8702cb4cd4 100644 --- a/arch/cris/Makefile +++ b/arch/cris/Makefile @@ -29,7 +29,7 @@ LDFLAGS_BLOB := --format binary --oformat elf32-cris \ OBJCOPYFLAGS := -O binary -R .note -R .comment -S -AFLAGS_vmlinux.lds.o = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) +CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) AFLAGS += -mlinux CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe @@ -39,7 +39,7 @@ CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g CFLAGS += -fno-omit-frame-pointer endif -HEAD := arch/$(ARCH)/$(SARCH)/kernel/head.o +head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a) diff --git a/arch/cris/kernel/Makefile b/arch/cris/kernel/Makefile index 7c071a765fd6..1546a0e74047 100644 --- a/arch/cris/kernel/Makefile +++ b/arch/cris/kernel/Makefile @@ -3,7 +3,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o irq.o ptrace.o setup.o \ time.o sys_cris.o semaphore.o diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 8497cfb80786..62bb7ba4c2bb 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -176,86 +176,15 @@ source "drivers/serial/Kconfig" source "drivers/i2c/Kconfig" source "drivers/usb/Kconfig" - + endmenu source "fs/Kconfig" -menu "Kernel hacking" - -config FULLDEBUG - bool "Full Symbolic/Source Debugging support" - help - Enable debugging symbols on kernel build. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - help - Enables console device to interprent special characters as - commands to dump state information. - -config HIGHPROFILE - bool "Use fast second timer for profiling" - help - Use a fast secondary clock to produce profiling information. - -config NO_KERNEL_MSG - bool "Suppress Kernel BUG Messages" - help - Do not output any debug BUG messages within the kernel. - -config GDB_MAGICPRINT - bool "Message Output for GDB MagicPrint service" - depends on (H8300H_SIM || H8S_SIM) - help - kernel messages output useing MagicPrint service from GDB - -config SYSCALL_PRINT - bool "SystemCall trace print" - help - outout history of systemcall - -config GDB_DEBUG - bool "Use gdb stub" - depends on (!H8300H_SIM && !H8S_SIM) - help - gdb stub exception support - -config CONFIG_SH_STANDARD_BIOS - bool "Use gdb protocol serial console" - depends on (!H8300H_SIM && !H8S_SIM) - help - serial console output using GDB protocol. - Require eCos/RedBoot - -config DEFAULT_CMDLINE - bool "Use buildin commandline" - default n - help - buildin kernel commandline enabled. - -config KERNEL_COMMAND - string "Buildin commmand string" - depends on DEFAULT_CMDLINE - help - buildin kernel commandline strings. - -config BLKDEV_RESERVE - bool "BLKDEV Reserved Memory" - default n - help - Reserved BLKDEV area. - -config CONFIG_BLKDEV_RESERVE_ADDRESS - hex 'start address' - depends on BLKDEV_RESERVE - help - BLKDEV start address. -endmenu +source "arch/h8300/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/h8300/Kconfig.debug b/arch/h8300/Kconfig.debug new file mode 100644 index 000000000000..55034d08abff --- /dev/null +++ b/arch/h8300/Kconfig.debug @@ -0,0 +1,68 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config FULLDEBUG + bool "Full Symbolic/Source Debugging support" + help + Enable debugging symbols on kernel build. + +config HIGHPROFILE + bool "Use fast second timer for profiling" + help + Use a fast secondary clock to produce profiling information. + +config NO_KERNEL_MSG + bool "Suppress Kernel BUG Messages" + help + Do not output any debug BUG messages within the kernel. + +config GDB_MAGICPRINT + bool "Message Output for GDB MagicPrint service" + depends on (H8300H_SIM || H8S_SIM) + help + kernel messages output useing MagicPrint service from GDB + +config SYSCALL_PRINT + bool "SystemCall trace print" + help + outout history of systemcall + +config GDB_DEBUG + bool "Use gdb stub" + depends on (!H8300H_SIM && !H8S_SIM) + help + gdb stub exception support + +config CONFIG_SH_STANDARD_BIOS + bool "Use gdb protocol serial console" + depends on (!H8300H_SIM && !H8S_SIM) + help + serial console output using GDB protocol. + Require eCos/RedBoot + +config DEFAULT_CMDLINE + bool "Use buildin commandline" + default n + help + buildin kernel commandline enabled. + +config KERNEL_COMMAND + string "Buildin commmand string" + depends on DEFAULT_CMDLINE + help + buildin kernel commandline strings. + +config BLKDEV_RESERVE + bool "BLKDEV Reserved Memory" + default n + help + Reserved BLKDEV area. + +config CONFIG_BLKDEV_RESERVE_ADDRESS + hex 'start address' + depends on BLKDEV_RESERVE + help + BLKDEV start address. + +endmenu diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile index 1f4ef89b53d2..71b6131e98b8 100644 --- a/arch/h8300/kernel/Makefile +++ b/arch/h8300/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o ptrace.o ints.o \ sys_h8300.o time.o semaphore.o signal.o \ diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index af9750136365..a70b842324cb 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -31,7 +31,6 @@ config GENERIC_ISA_DMA source "init/Kconfig" - menu "Processor type and features" choice @@ -55,20 +54,20 @@ config X86_ELAN config X86_VOYAGER bool "Voyager (NCR)" help - Voyager is a MCA based 32 way capable SMP architecture proprietary - to NCR Corp. Machine classes 345x/35xx/4100/51xx are voyager based. - + Voyager is an MCA-based 32-way capable SMP architecture proprietary + to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based. + *** WARNING *** - + If you do not specifically know you have a Voyager based machine, - say N here otherwise the kernel you build will not be bootable. + say N here, otherwise the kernel you build will not be bootable. config X86_NUMAQ bool "NUMAQ (IBM/Sequent)" select DISCONTIGMEM select NUMA help - This option is used for getting Linux to run on a (IBM/Sequent) NUMA + This option is used for getting Linux to run on a (IBM/Sequent) NUMA multiquad box. This changes the way that processors are bootstrapped, and uses Clustered Logical APIC addressing mode instead of Flat Logical. You will need a new lynxer.elf file to flash your firmware with - send @@ -115,8 +114,8 @@ config X86_ES7000 depends on SMP help Support for Unisys ES7000 systems. Say 'Y' here if this kernel is - supposed to run on an IA32-based Unisys ES7000 system. - Only choose this option if you have such a system, otherwise you + supposed to run on an IA32-based Unisys ES7000 system. + Only choose this option if you have such a system, otherwise you should say N here. endchoice @@ -322,7 +321,7 @@ config MVIAC3_2 endchoice config X86_GENERIC - bool "Generic x86 support" + bool "Generic x86 support" help Instead of just including optimizations for the selected x86 variant (e.g. PII, Crusoe or Athlon), include some more @@ -1027,7 +1026,6 @@ source "arch/i386/kernel/cpu/cpufreq/Kconfig" endmenu - menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" config X86_VISWS_APIC @@ -1158,7 +1156,7 @@ config SCx200 tristate "NatSemi SCx200 support" depends on !X86_VOYAGER help - This provides basic support for the National Semiconductor SCx200 + This provides basic support for the National Semiconductor SCx200 processor. Right now this is just a driver for the GPIO pins. If you don't know what to do here, say N. @@ -1172,7 +1170,6 @@ source "drivers/pci/hotplug/Kconfig" endmenu - menu "Executable file formats" source "fs/Kconfig.binfmt" @@ -1185,130 +1182,7 @@ source "fs/Kconfig" source "arch/i386/oprofile/Kconfig" - -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config EARLY_PRINTK - bool "Early printk" if EMBEDDED - default y - help - Write kernel log output directly into the VGA buffer or to a serial - port. - - This is useful for kernel debugging when your machine crashes very - early before the console code is initialized. For normal operation - it is not recommended because it looks ugly and doesn't cooperate - with klogd/syslogd or the X server. You should normally N here, - unless you want to debug such a crash. - -config DEBUG_STACKOVERFLOW - bool "Check for stack overflows" - depends on DEBUG_KERNEL - -config DEBUG_STACK_USAGE - bool "Stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_PAGEALLOC - bool "Page alloc debugging" - depends on DEBUG_KERNEL - help - Unmap pages from the kernel linear mapping after free_pages(). - This results in a large slowdown, but helps to find certain types - of memory corruptions. - -config DEBUG_HIGHMEM - bool "Highmem debugging" - depends on DEBUG_KERNEL && HIGHMEM - help - This options enables addition error checking for high memory systems. - Disable for production systems. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -config 4KSTACKS - bool "Use 4Kb for kernel stacks instead of 8Kb" - help - If you say Y here the kernel will use a 4Kb stacksize for the - kernel stack attached to each process/thread. This facilitates - running more threads on a system and also reduces the pressure - on the VM subsystem for higher order allocations. This option - will also use IRQ stacks to compensate for the reduced stackspace. - -config X86_FIND_SMP_CONFIG - bool - depends on X86_LOCAL_APIC || X86_VOYAGER - default y - -config X86_MPPARSE - bool - depends on X86_LOCAL_APIC && !X86_VISWS - default y - -endmenu +source "arch/i386/Kconfig.debug" source "security/Kconfig" diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug new file mode 100644 index 000000000000..16b0b7ff7fcc --- /dev/null +++ b/arch/i386/Kconfig.debug @@ -0,0 +1,58 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config EARLY_PRINTK + bool "Early printk" if EMBEDDED + default y + help + Write kernel log output directly into the VGA buffer or to a serial + port. + + This is useful for kernel debugging when your machine crashes very + early before the console code is initialized. For normal operation + it is not recommended because it looks ugly and doesn't cooperate + with klogd/syslogd or the X server. You should normally N here, + unless you want to debug such a crash. + +config DEBUG_STACKOVERFLOW + bool "Check for stack overflows" + depends on DEBUG_KERNEL + +config DEBUG_STACK_USAGE + bool "Stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +config DEBUG_PAGEALLOC + bool "Page alloc debugging" + depends on DEBUG_KERNEL + help + Unmap pages from the kernel linear mapping after free_pages(). + This results in a large slowdown, but helps to find certain types + of memory corruptions. + +config 4KSTACKS + bool "Use 4Kb for kernel stacks instead of 8Kb" + help + If you say Y here the kernel will use a 4Kb stacksize for the + kernel stack attached to each process/thread. This facilitates + running more threads on a system and also reduces the pressure + on the VM subsystem for higher order allocations. This option + will also use IRQ stacks to compensate for the reduced stackspace. + +config X86_FIND_SMP_CONFIG + bool + depends on X86_LOCAL_APIC || X86_VOYAGER + default y + +config X86_MPPARSE + bool + depends on X86_LOCAL_APIC && !X86_VISWS + default y + +endmenu diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 1e446b2340a5..5737a3511bc7 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -18,48 +18,47 @@ LDFLAGS := -m elf_i386 OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -CHECK := $(CHECK) -D__i386__=1 +CHECKFLAGS += -D__i386__=1 CFLAGS += -pipe -msoft-float # prevent gcc from keeping the stack 16 byte aligned -CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) - -align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0)) +CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) +align := $(subst -functions=0,,$(call cc-option,-falign-functions=0,-malign-functions=0)) cflags-$(CONFIG_M386) += -march=i386 cflags-$(CONFIG_M486) += -march=i486 cflags-$(CONFIG_M586) += -march=i586 cflags-$(CONFIG_M586TSC) += -march=i586 -cflags-$(CONFIG_M586MMX) += $(call check_gcc,-march=pentium-mmx,-march=i586) +cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586) cflags-$(CONFIG_M686) += -march=i686 -cflags-$(CONFIG_MPENTIUMII) += $(call check_gcc,-march=pentium2,-march=i686) -cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686) -cflags-$(CONFIG_MPENTIUMM) += $(call check_gcc,-march=pentium3,-march=i686) -cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686) +cflags-$(CONFIG_MPENTIUMII) += $(call cc-option,-march=pentium2,-march=i686) +cflags-$(CONFIG_MPENTIUMIII) += $(call cc-option,-march=pentium3,-march=i686) +cflags-$(CONFIG_MPENTIUMM) += $(call cc-option,-march=pentium3,-march=i686) +cflags-$(CONFIG_MPENTIUM4) += $(call cc-option,-march=pentium4,-march=i686) cflags-$(CONFIG_MK6) += -march=k6 # Please note, that patches that add -march=athlon-xp and friends are pointless. # They make zero difference whatsosever to performance at this time. -cflags-$(CONFIG_MK7) += $(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4) -cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,$(call check_gcc,-march=athlon,-march=i686 $(align)-functions=4)) +cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4) +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)) cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 -cflags-$(CONFIG_MWINCHIPC6) += $(call check_gcc,-march=winchip-c6,-march=i586) -cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586) -cflags-$(CONFIG_MWINCHIP3D) += $(call check_gcc,-march=winchip2,-march=i586) -cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 -cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) +cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) +cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586) +cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) +cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 +cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) # AMD Elan support cflags-$(CONFIG_X86_ELAN) += -march=i486 # -mregparm=3 works ok on gcc-3.0 and later # -GCC_VERSION := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) +GCC_VERSION := $(call cc-version) cflags-$(CONFIG_REGPARM) += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;) # Disable unit-at-a-time mode, it makes gcc use a lot more stack # due to the lack of sharing of stacklots. -CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) +CFLAGS += $(call cc-option,-fno-unit-at-a-time) CFLAGS += $(cflags-y) diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile index d70853d99215..aa7064a75ee6 100644 --- a/arch/i386/boot/Makefile +++ b/arch/i386/boot/Makefile @@ -29,9 +29,9 @@ targets := vmlinux.bin bootsect bootsect.o setup setup.o \ zImage bzImage subdir- := compressed -host-progs := tools/build +hostprogs-y := tools/build -HOSTCFLAGS_build.o := -Iinclude +HOSTCFLAGS_build.o := $(LINUXINCLUDE) # --------------------------------------------------------------------------- diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 00cc32e3383e..e03816e72f50 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 72b48fb290c2..4459907b0a8a 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -372,119 +372,7 @@ source "arch/ia64/hp/sim/Kconfig" source "arch/ia64/oprofile/Kconfig" -menu "Kernel hacking" - -choice - prompt "Physical memory granularity" - default IA64_GRANULE_64MB - -config IA64_GRANULE_16MB - bool "16MB" - help - IA-64 identity-mapped regions use a large page size called "granules". - - Select "16MB" for a small granule size. - Select "64MB" for a large granule size. This is the current default. - -config IA64_GRANULE_64MB - bool "64MB" - depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_SGI_SN2) - -endchoice - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config IA64_PRINT_HAZARDS - bool "Print possible IA-64 dependency violations to console" - depends on DEBUG_KERNEL - help - Selecting this option prints more information for Illegal Dependency - Faults, that is, for Read-after-Write (RAW), Write-after-Write (WAW), - or Write-after-Read (WAR) violations. This option is ignored if you - are compiling for an Itanium A step processor - (CONFIG_ITANIUM_ASTEP_SPECIFIC). If you're unsure, select Y. - -config DISABLE_VHPT - bool "Disable VHPT" - depends on DEBUG_KERNEL - help - The Virtual Hash Page Table (VHPT) enhances virtual address - translation performance. Normally you want the VHPT active but you - can select this option to disable the VHPT for debugging. If you're - unsure, answer N. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config IA64_DEBUG_CMPXCHG - bool "Turn on compare-and-exchange bug checking (slow!)" - depends on DEBUG_KERNEL - help - Selecting this option turns on bug checking for the IA-64 - compare-and-exchange instructions. This is slow! Itaniums - from step B3 or later don't have this problem. If you're unsure, - select N. - -config IA64_DEBUG_IRQ - bool "Turn on irq debug checks (slow!)" - depends on DEBUG_KERNEL - help - Selecting this option turns on bug checking for the IA-64 irq_save - and restore instructions. It's useful for tracking down spinlock - problems, but slow! If you're unsure, select N. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config SYSVIPC_COMPAT - bool - depends on COMPAT && SYSVIPC - default y -endmenu +source "arch/ia64/Kconfig.debug" source "security/Kconfig" diff --git a/arch/ia64/Kconfig.debug b/arch/ia64/Kconfig.debug new file mode 100644 index 000000000000..19edc8b2c61d --- /dev/null +++ b/arch/ia64/Kconfig.debug @@ -0,0 +1,64 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +choice + prompt "Physical memory granularity" + default IA64_GRANULE_64MB + +config IA64_GRANULE_16MB + bool "16MB" + help + IA-64 identity-mapped regions use a large page size called "granules". + + Select "16MB" for a small granule size. + Select "64MB" for a large granule size. This is the current default. + +config IA64_GRANULE_64MB + bool "64MB" + depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_SGI_SN2) + +endchoice + +config IA64_PRINT_HAZARDS + bool "Print possible IA-64 dependency violations to console" + depends on DEBUG_KERNEL + help + Selecting this option prints more information for Illegal Dependency + Faults, that is, for Read-after-Write (RAW), Write-after-Write (WAW), + or Write-after-Read (WAR) violations. This option is ignored if you + are compiling for an Itanium A step processor + (CONFIG_ITANIUM_ASTEP_SPECIFIC). If you're unsure, select Y. + +config DISABLE_VHPT + bool "Disable VHPT" + depends on DEBUG_KERNEL + help + The Virtual Hash Page Table (VHPT) enhances virtual address + translation performance. Normally you want the VHPT active but you + can select this option to disable the VHPT for debugging. If you're + unsure, answer N. + +config IA64_DEBUG_CMPXCHG + bool "Turn on compare-and-exchange bug checking (slow!)" + depends on DEBUG_KERNEL + help + Selecting this option turns on bug checking for the IA-64 + compare-and-exchange instructions. This is slow! Itaniums + from step B3 or later don't have this problem. If you're unsure, + select N. + +config IA64_DEBUG_IRQ + bool "Turn on irq debug checks (slow!)" + depends on DEBUG_KERNEL + help + Selecting this option turns on bug checking for the IA-64 irq_save + and restore instructions. It's useful for tracking down spinlock + problems, but slow! If you're unsure, select N. + +config SYSVIPC_COMPAT + bool + depends on COMPAT && SYSVIPC + default y + +endmenu diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index f2ca1e231388..955489b17307 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -23,9 +23,7 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ -falign-functions=32 -frename-registers CFLAGS_KERNEL := -mconstant-gp -GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') -GCC_MINOR_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f2 -d'.') - +GCC_VERSION := $(call cc-version) GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) $(OBJDUMP)) CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags $(CC) $(OBJDUMP) $(READELF)) @@ -37,16 +35,14 @@ $(error Sorry, you need a newer version of the assember, one that is built from ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) endif -ifeq ($(GCC_VERSION),2) +ifneq ($(shell if [ $(GCC_VERSION) -lt 0300 ] ; then echo "bad"; fi ;),) $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad code.) endif -ifeq ($(GCC_VERSION),3) - ifeq ($(GCC_MINOR_VERSION),4) +ifeq ($(GCC_VERSION),0304) # Workaround Itanium 1 bugs in gcc 3.4. # cflags-$(CONFIG_ITANIUM) += -mtune=merced cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley - endif endif cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index 7d1e2f3d4d58..da4a9597d010 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ @@ -21,25 +21,25 @@ obj-$(CONFIG_IA64_CYCLONE) += cyclone.o # The gate DSO image is built using a special linker script. targets += gate.so gate-syms.o -extra-y += gate.so gate-syms.o gate.lds.s gate.o +extra-y += gate.so gate-syms.o gate.lds gate.o # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state. CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 -AFLAGS_gate.lds.o += -P -C -U$(ARCH) +CPPFLAGS_gate.lds := -P -C -U$(ARCH) quiet_cmd_gate = GATE $@ cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 -$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE +$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE $(call if_changed,gate) $(obj)/built-in.o: $(obj)/gate-syms.o $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o GATECFLAGS_gate-syms.o = -r -$(obj)/gate-syms.o: $(src)/gate.lds.s $(obj)/gate.o FORCE +$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE $(call if_changed,gate) # gate-data.o contains the gate DSO image as data in section .data.gate. diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 1fa88d5f3a08..b3ab305ba9f2 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -21,12 +21,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool - mainmenu "Linux/68k Kernel Configuration" source "init/Kconfig" - menu "Platform dependent setup" config EISA @@ -355,7 +353,6 @@ config 060_WRITETHROUGH endmenu - menu "General setup" source "fs/Kconfig.binfmt" @@ -447,7 +444,6 @@ endmenu source "drivers/Kconfig" - menu "Character devices" config ATARI_MFPSER @@ -652,47 +648,10 @@ endmenu source "fs/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - -config DEBUG_BUGVERBOSE - bool "Verbose BUG() reporting" - depends on DEBUG_KERNEL - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -endmenu +source "arch/m68k/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/m68k/Kconfig.debug b/arch/m68k/Kconfig.debug new file mode 100644 index 000000000000..f53b6d5300e5 --- /dev/null +++ b/arch/m68k/Kconfig.debug @@ -0,0 +1,5 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +endmenu diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index bc79771e8953..5eb62709887a 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -28,7 +28,7 @@ ifdef CONFIG_SUN3 LDFLAGS_vmlinux = -N endif -CHECK := $(CHECK) -D__mc68000__=1 -I$(shell $(CC) -print-file-name=include) +CHECKFLAGS += -D__mc68000__=1 -I$(shell $(CC) -print-file-name=include) # without -fno-strength-reduce the 53c7xx.c driver fails ;-( CFLAGS += -pipe -fno-strength-reduce -ffixed-a2 diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index 081a6747c67a..458925c471a1 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -7,7 +7,7 @@ ifndef CONFIG_SUN3 else extra-y := sun3-head.o endif -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index f11317725a55..d8769bc86bd7 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig @@ -5,6 +5,10 @@ mainmenu "uClinux/68k (w/o MMU) Kernel Configuration" +config M68KNOMMU + bool + default y + config MMU bool default n @@ -25,7 +29,6 @@ config RWSEM_XCHGADD_ALGORITHM bool default n - source "init/Kconfig" menu "Processor type and features" @@ -388,7 +391,7 @@ config LARGE_ALLOCS a lot of RAM, and you need to able to allocate very large contiguous chunks. If unsure, say N. -choice +choice prompt "RAM size" default AUTO @@ -421,7 +424,7 @@ config RAM32MB endchoice -choice +choice prompt "RAM bus width" default RAMAUTOBIT @@ -472,7 +475,6 @@ endchoice endmenu - menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" config PCI @@ -511,64 +513,10 @@ source "drivers/Kconfig" source "fs/Kconfig" -menu "Kernel hacking" - -config FULLDEBUG - bool "Full Symbolic/Source Debugging support" - help - Enable debuging symbols on kernel build. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - help - Enables console device to interpret special characters as - commands to dump state information. - -config HIGHPROFILE - bool "Use fast second timer for profiling" - depends on COLDFIRE - help - Use a fast secondary clock to produce profiling information. - -config BOOTPARAM - bool 'Compiled-in Kernel Boot Parameter' - -config BOOTPARAM_STRING - string 'Kernel Boot Parameter' - default 'console=ttyS0,19200' - depends on BOOTPARAM - -config DUMPTOFLASH - bool "Panic/Dump to FLASH" - depends on COLDFIRE - help - Dump any panic of trap output into a flash memory segment - for later analysis. - -config NO_KERNEL_MSG - bool "Suppress Kernel BUG Messages" - help - Do not output any debug BUG messages within the kernel. - -config BDM_DISABLE - bool "Disable BDM signals" - depends on (EXPERIMENTAL && COLDFIRE) - help - Disable the ColdFire CPU's BDM signals. - -endmenu +source "arch/m68knommu/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/m68knommu/Kconfig.debug b/arch/m68knommu/Kconfig.debug new file mode 100644 index 000000000000..763c9aa0b4fd --- /dev/null +++ b/arch/m68knommu/Kconfig.debug @@ -0,0 +1,42 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config FULLDEBUG + bool "Full Symbolic/Source Debugging support" + help + Enable debuging symbols on kernel build. + +config HIGHPROFILE + bool "Use fast second timer for profiling" + depends on COLDFIRE + help + Use a fast secondary clock to produce profiling information. + +config BOOTPARAM + bool 'Compiled-in Kernel Boot Parameter' + +config BOOTPARAM_STRING + string 'Kernel Boot Parameter' + default 'console=ttyS0,19200' + depends on BOOTPARAM + +config DUMPTOFLASH + bool "Panic/Dump to FLASH" + depends on COLDFIRE + help + Dump any panic of trap output into a flash memory segment + for later analysis. + +config NO_KERNEL_MSG + bool "Suppress Kernel BUG Messages" + help + Do not output any debug BUG messages within the kernel. + +config BDM_DISABLE + bool "Disable BDM signals" + depends on (EXPERIMENTAL && COLDFIRE) + help + Disable the ColdFire CPU's BDM signals. + +endmenu diff --git a/arch/m68knommu/kernel/Makefile b/arch/m68knommu/kernel/Makefile index 1a6a3600efff..1c6cd1ab571e 100644 --- a/arch/m68knommu/kernel/Makefile +++ b/arch/m68knommu/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for arch/m68knommu/kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 6ab62cb4ddef..ecad69906ff8 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -381,7 +381,7 @@ config DDB5476 evaluation board. Features : kernel debugging, serial terminal, NFS root fs, on-board - ether port USB, AC97, PCI, PCI VGA card & framebuffer console, + ether port USB, AC97, PCI, PCI VGA card & framebuffer console, IDE controller, PS2 keyboard, PS2 mouse, etc. config DDB5477 @@ -400,7 +400,7 @@ config DDB5477_BUS_FREQUENCY int "bus frequency (in kHZ, 0 for auto-detect)" depends on DDB5477 default 0 - + config NEC_OSPREY bool "Support for NEC Osprey board" select DMA_NONCOHERENT @@ -513,15 +513,15 @@ config SOC_AU1550 endchoice -choice +choice prompt "AMD/Alchemy Au1x00 board support" depends on SOC_AU1X00 help These are evaluation boards built by AMD/Alchemy to showcase their Au1X00 Internet Edge Processors. The SOC design - is based on the MIPS32 architecture running at 266/400/500MHz - with many integrated peripherals. Further information can be - found at their website, <http://www.amd.com/>. Say Y here if you + is based on the MIPS32 architecture running at 266/400/500MHz + with many integrated peripherals. Further information can be + found at their website, <http://www.amd.com/>. Say Y here if you wish to build a kernel for this platform. config MIPS_PB1000 @@ -1091,7 +1091,6 @@ config TANBAC_TB0219 endmenu - menu "CPU selection" choice @@ -1194,7 +1193,7 @@ config PAGE_SIZE_4KB This option select the standard 4kB Linux page size. On some R3000-family processors this is the only available page size. Using 4kB page size will minimize memory consumption and is therefore - recommended for low memory systems. + recommended for low memory systems. config PAGE_SIZE_8KB bool "8kB" @@ -1382,21 +1381,6 @@ config PREEMPT This allows applications to run more reliably even when the system is under load. -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - config RTC_DS1742 bool "DS1742 BRAM/RTC support" depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 @@ -1562,7 +1546,7 @@ config EMBEDDED_RAMDISK_IMAGE default "ramdisk.gz" help This is the filename of the ramdisk image to be built into the - kernel. Relative pathnames are relative to arch/mips/ramdisk/. + kernel. Relative pathnames are relative to arch/mips/ramdisk/. The ramdisk image is not part of the kernel distribution; you must provide one yourself. @@ -1572,119 +1556,7 @@ source "drivers/Kconfig" source "fs/Kconfig" -menu "Kernel hacking" - -config CROSSCOMPILE - bool "Are you using a crosscompiler" - help - Say Y here if you are compiling the kernel on a different - architecture than the one it is intended to run on. - -config CMDLINE - string "Default kernel command string" - default "" - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, you can supply - some command-line options at build time by entering them here. In - other cases you can specify kernel args so that you don't have - to set them up in board prom initialization routines. - -config DEBUG_KERNEL - bool "Kernel debugging" - -config DEBUG_STACK_USAGE - bool "Enable stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config KGDB - bool "Remote GDB kernel debugging" - depends on DEBUG_KERNEL - select DEBUG_INFO - help - If you say Y here, it will be possible to remotely debug the MIPS - kernel using gdb. This enlarges your kernel image disk size by - several megabytes and requires a machine with more than 16 MB, - better 32 MB RAM to avoid excessive linking time. This is only - useful for kernel hackers. If unsure, say N. - -config GDB_CONSOLE - bool "Console output to GDB" - depends on KGDB - help - If you are using GDB for remote debugging over a serial port and - would like kernel messages to be formatted into GDB $O packets so - that GDB prints them as program output, say 'Y'. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config SB1XXX_CORELIS - bool "Corelis Debugger" - depends on SIBYTE_SB1xxx_SOC - select DEBUG_INFO - help - Select compile flags that produce code that can be processed by the - Corelis mksym utility and UDB Emulator. - -config RUNTIME_DEBUG - bool "Enable run-time debugging" - depends on DEBUG_KERNEL - help - If you say Y here, some debugging macros will do run-time checking. - If you say N here, those macros will mostly turn to no-ops. See - include/asm-mips/debug.h for debuging macros. - If unsure, say N. - - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config MIPS_UNCACHED - bool "Run uncached" - depends on DEBUG_KERNEL && !SMP && !SGI_IP27 - help - If you say Y here there kernel will disable all CPU caches. This will - reduce the system's performance dramatically but can help finding - otherwise hard to track bugs. It can also useful if you're doing - hardware debugging with a logic analyzer and need to see all traffic - on the bus. - -config DEBUG_HIGHMEM - bool "Highmem debugging" - depends on DEBUG_KERNEL && HIGHMEM - -endmenu +source "arch/mips/Kconfig.debug" source "security/Kconfig" diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug new file mode 100644 index 000000000000..d3c5cc3b9c9d --- /dev/null +++ b/arch/mips/Kconfig.debug @@ -0,0 +1,76 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config CROSSCOMPILE + bool "Are you using a crosscompiler" + help + Say Y here if you are compiling the kernel on a different + architecture than the one it is intended to run on. + +config CMDLINE + string "Default kernel command string" + default "" + help + On some platforms, there is currently no way for the boot loader to + pass arguments to the kernel. For these platforms, you can supply + some command-line options at build time by entering them here. In + other cases you can specify kernel args so that you don't have + to set them up in board prom initialization routines. + +config DEBUG_STACK_USAGE + bool "Enable stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +config KGDB + bool "Remote GDB kernel debugging" + depends on DEBUG_KERNEL + select DEBUG_INFO + help + If you say Y here, it will be possible to remotely debug the MIPS + kernel using gdb. This enlarges your kernel image disk size by + several megabytes and requires a machine with more than 16 MB, + better 32 MB RAM to avoid excessive linking time. This is only + useful for kernel hackers. If unsure, say N. + +config GDB_CONSOLE + bool "Console output to GDB" + depends on KGDB + help + If you are using GDB for remote debugging over a serial port and + would like kernel messages to be formatted into GDB $O packets so + that GDB prints them as program output, say 'Y'. + +config SB1XXX_CORELIS + bool "Corelis Debugger" + depends on SIBYTE_SB1xxx_SOC + select DEBUG_INFO + help + Select compile flags that produce code that can be processed by the + Corelis mksym utility and UDB Emulator. + +config RUNTIME_DEBUG + bool "Enable run-time debugging" + depends on DEBUG_KERNEL + help + If you say Y here, some debugging macros will do run-time checking. + If you say N here, those macros will mostly turn to no-ops. See + include/asm-mips/debug.h for debuging macros. + If unsure, say N. + +config MIPS_UNCACHED + bool "Run uncached" + depends on DEBUG_KERNEL && !SMP && !SGI_IP27 + help + If you say Y here there kernel will disable all CPU caches. This will + reduce the system's performance dramatically but can help finding + otherwise hard to track bugs. It can also useful if you're doing + hardware debugging with a logic analyzer and need to see all traffic + on the bus. + +endmenu diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 371558708a50..5025c01b93ed 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -56,14 +56,12 @@ endif # cflags-y := -I $(TOPDIR)/include/asm/gcc cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -cflags-y += $(call check_gcc, -finline-limit=100000,) +cflags-y += $(call cc-option, -finline-limit=100000) LDFLAGS_vmlinux += -G 0 -static -n MODFLAGS += -mlong-calls cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer -check_warning = $(shell if $(CC) $(1) -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) - # # Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>) # @@ -162,7 +160,7 @@ cflags-$(CONFIG_CPU_R5432) += \ cflags-$(CONFIG_CPU_NEVADA) += \ $(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \ -Wa,--trap -# $(call check_gcc,-mmad,) +# $(call cc-option,-mmad) cflags-$(CONFIG_CPU_RM7000) += \ $(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \ @@ -643,7 +641,7 @@ endif # none has been choosen above. # -AFLAGS_vmlinux.lds.o := \ +CPPFLAGS_vmlinux.lds := \ -D"LOADADDR=$(load-y)" \ -D"JIFFIES=$(JIFFIES)" \ -imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 3fd45773771e..86783790d22c 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the Linux/MIPS kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 9e37d3dfe66b..4bdec1e0f34d 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -106,7 +106,7 @@ config PARISC64 depends on PA8X00 help Enable this if you want to support 64bit kernel on PA-RISC platform. - + At the moment, only people willing to use more than 2GB of RAM, or having a 64bit-only capable PA-RISC machine should say Y here. @@ -188,76 +188,10 @@ source "fs/Kconfig" source "arch/parisc/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_RWLOCK - bool "Read-write spinlock debugging" - depends on DEBUG_KERNEL && SMP - help - If you say Y here then read-write lock processing will count how many - times it has tried to get the lock and issue an error message after - too many attempts. If you suspect a rwlock problem or a kernel - hacker asks for this option then say Y. Otherwise say N. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -endmenu +source "arch/parisc/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug new file mode 100644 index 000000000000..8caaed187a1f --- /dev/null +++ b/arch/parisc/Kconfig.debug @@ -0,0 +1,14 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config DEBUG_RWLOCK + bool "Read-write spinlock debugging" + depends on DEBUG_KERNEL && SMP + help + If you say Y here then read-write lock processing will count how many + times it has tried to get the lock and issue an error message after + too many attempts. If you suspect a rwlock problem or a kernel + hacker asks for this option then say Y. Otherwise say N. + +endmenu diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile index b032c6b79b13..adffb0504b4c 100644 --- a/arch/parisc/kernel/Makefile +++ b/arch/parisc/kernel/Makefile @@ -4,7 +4,7 @@ head-y := head.o head-$(CONFIG_PARISC64) := head64.o -extra-y := init_task.o $(head-y) vmlinux.lds.s +extra-y := init_task.o $(head-y) vmlinux.lds AFLAGS_entry.o := -traditional AFLAGS_pacache.o := -traditional diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index cc4e6b9db773..2f019703cb61 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig @@ -49,7 +49,7 @@ config 6xx There are four types of PowerPC chips supported. The more common types (601, 603, 604, 740, 750, 7400), the Motorola embedded versions (821, 823, 850, 855, 860, 52xx, 8260), the IBM embedded - versions (403 and 405) and the high end 64 bit Power processors + versions (403 and 405) and the high end 64 bit Power processors (POWER 3, POWER4, and IBM 970 also known as G5) Unless you are building a kernel for one of the embedded processor systems, 64 bit IBM RS/6000 or an Apple G5, choose 6xx. @@ -626,7 +626,7 @@ config EMBEDDEDBOOT bool depends on 8xx || 8260 default y - + config PPC_MPC52xx bool @@ -1043,13 +1043,13 @@ config PCI_8260 bool depends on PCI && 8260 && !8272 default y - + config 8260_PCI9 bool " Enable workaround for MPC826x erratum PCI 9" depends on PCI_8260 default y -choice +choice prompt " IDMA channel for PCI 9 workaround" depends on 8260_PCI9 @@ -1228,128 +1228,7 @@ source "lib/Kconfig" source "arch/ppc/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and to CONFIG_SMP to include code to check for missing - spinlock initialization and some other common spinlock errors. - -config DEBUG_HIGHMEM - bool "Highmem debugging" - depends on DEBUG_KERNEL && HIGHMEM - help - This options enables additional error checking for high memory - systems. Disable for production systems. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - depends on DEBUG_KERNEL - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config KGDB - bool "Include kgdb kernel debugger" - depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx) - select DEBUG_INFO - help - Include in-kernel hooks for kgdb, the Linux kernel source level - debugger. See <http://kgdb.sourceforge.net/> for more information. - Unless you are intending to debug the kernel, say N here. - -choice - prompt "Serial Port" - depends on KGDB - default KGDB_TTYS1 - -config KGDB_TTYS0 - bool "ttyS0" - -config KGDB_TTYS1 - bool "ttyS1" - -config KGDB_TTYS2 - bool "ttyS2" - -config KGDB_TTYS3 - bool "ttyS3" - -endchoice - -config KGDB_CONSOLE - bool "Enable serial console thru kgdb port" - depends on KGDB && 8xx || CPM2 - help - If you enable this, all serial console messages will be sent - over the gdb stub. - If unsure, say N. - -config XMON - bool "Include xmon kernel debugger" - depends on DEBUG_KERNEL - help - Include in-kernel hooks for the xmon kernel monitor/debugger. - Unless you are intending to debug the kernel, say N here. - -config BDI_SWITCH - bool "Include BDI-2000 user context switcher" - depends on DEBUG_KERNEL - help - Include in-kernel support for the Abatron BDI2000 debugger. - Unless you are intending to debug the kernel with one of these - machines, say N here. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use some sort of debugger to - debug the kernel. - If you don't debug the kernel, you can say N. - -config BOOTX_TEXT - bool "Support for early boot text console (BootX or OpenFirmware only)" - depends PPC_OF - help - Say Y here to see progress messages from the boot firmware in text - mode. Requires either BootX or Open Firmware. - -config SERIAL_TEXT_DEBUG - bool "Support for early boot texts over serial port" - depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 || PPC_MPC52xx - -config PPC_OCP - bool - depends on IBM_OCP || FSL_OCP - default y - -endmenu +source "arch/ppc/Kconfig.debug" source "security/Kconfig" diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug new file mode 100644 index 000000000000..7f86f4c8c8cb --- /dev/null +++ b/arch/ppc/Kconfig.debug @@ -0,0 +1,72 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config KGDB + bool "Include kgdb kernel debugger" + depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx) + select DEBUG_INFO + help + Include in-kernel hooks for kgdb, the Linux kernel source level + debugger. See <http://kgdb.sourceforge.net/> for more information. + Unless you are intending to debug the kernel, say N here. + +choice + prompt "Serial Port" + depends on KGDB + default KGDB_TTYS1 + +config KGDB_TTYS0 + bool "ttyS0" + +config KGDB_TTYS1 + bool "ttyS1" + +config KGDB_TTYS2 + bool "ttyS2" + +config KGDB_TTYS3 + bool "ttyS3" + +endchoice + +config KGDB_CONSOLE + bool "Enable serial console thru kgdb port" + depends on KGDB && 8xx || CPM2 + help + If you enable this, all serial console messages will be sent + over the gdb stub. + If unsure, say N. + +config XMON + bool "Include xmon kernel debugger" + depends on DEBUG_KERNEL + help + Include in-kernel hooks for the xmon kernel monitor/debugger. + Unless you are intending to debug the kernel, say N here. + +config BDI_SWITCH + bool "Include BDI-2000 user context switcher" + depends on DEBUG_KERNEL + help + Include in-kernel support for the Abatron BDI2000 debugger. + Unless you are intending to debug the kernel with one of these + machines, say N here. + +config BOOTX_TEXT + bool "Support for early boot text console (BootX or OpenFirmware only)" + depends PPC_OF + help + Say Y here to see progress messages from the boot firmware in text + mode. Requires either BootX or Open Firmware. + +config SERIAL_TEXT_DEBUG + bool "Support for early boot texts over serial port" + depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 || PPC_MPC52xx + +config PPC_OCP + bool + depends on IBM_OCP || FSL_OCP + default y + +endmenu diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index e15c6919a27f..df7b607b4d88 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -13,7 +13,7 @@ # This must match PAGE_OFFSET in include/asm-ppc/page.h. KERNELLOAD := $(CONFIG_KERNEL_START) -HAS_BIARCH := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;) +HAS_BIARCH := $(call cc-option-yn, -m32) ifeq ($(HAS_BIARCH),y) AS := $(AS) -a32 LD := $(LD) -m elf32ppc @@ -27,7 +27,7 @@ CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \ -ffixed-r2 -Wno-uninitialized -mmultiple CPP = $(CC) -E $(CFLAGS) -CHECK := $(CHECK) -D__powerpc__=1 +CHECKFLAGS += -D__powerpc__=1 ifndef CONFIG_E500 CFLAGS += -mstring @@ -70,7 +70,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm all: zImage -AFLAGS_vmlinux.lds.o := -Upowerpc +CPPFLAGS_vmlinux.lds := -Upowerpc # All the instructions talk about "make bzImage". bzImage: zImage @@ -112,7 +112,7 @@ else NEW_AS := 0 endif # gcc-3.4 and binutils-2.14 are a fatal combination. -GCC_VERSION := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) +GCC_VERSION := $(call cc-version) BAD_GCC_AS := $(shell echo mftb 5 | $(AS) -mppc -many -o /dev/null >/dev/null 2>&1 && echo 0 || echo 1) checkbin: diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile index 8c1d7eb8b8fa..995f89bb049c 100644 --- a/arch/ppc/boot/Makefile +++ b/arch/ppc/boot/Makefile @@ -23,12 +23,12 @@ subdir-$(CONFIG_PPC_OF) += of1275 # for cleaning subdir- += simple openfirmware -host-progs := $(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) $(BOOT_TARGETS): $(bootdir-y) $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ - $(addprefix $(obj)/,$(host-progs)) + $(addprefix $(obj)/,$(hostprogs-y)) $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile index 2531070a689a..94e0b41d663b 100644 --- a/arch/ppc/kernel/Makefile +++ b/arch/ppc/kernel/Makefile @@ -9,7 +9,7 @@ extra-$(CONFIG_E500) := head_e500.o extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_POWER4) += idle_power4.o -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \ diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index 5705ce63bfc7..c11f5cc5605a 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig @@ -1,4 +1,4 @@ -# +# # For a description of the syntax of this configuration file, # see Documentation/kbuild/kconfig-language.txt. # @@ -227,7 +227,7 @@ config SCANLOG config LPARCFG tristate "LPAR Configuration Data" help - Provide system capacity information via human readable + Provide system capacity information via human readable <key word>=<value> pairs through a /proc/ppc64/lparcfg interface. endmenu @@ -343,102 +343,10 @@ config VIOPATH source "arch/ppc64/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_STACKOVERFLOW - bool "Check for stack overflows" - depends on DEBUG_KERNEL - -config DEBUG_STACK_USAGE - bool "Stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUGGER - bool "Enable debugger hooks" - depends on DEBUG_KERNEL - help - Include in-kernel hooks for kernel debuggers. Unless you are - intending to debug the kernel, say N here. - -config XMON - bool "Include xmon kernel debugger" - depends on DEBUGGER - help - Include in-kernel hooks for the xmon kernel monitor/debugger. - Unless you are intending to debug the kernel, say N here. - -config XMON_DEFAULT - bool "Enable xmon by default" - depends on XMON - -config PPCDBG - bool "Include PPCDBG realtime debugging" - depends on DEBUG_KERNEL - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config IRQSTACKS - bool "Use separate kernel stacks when processing interrupts" - help - If you say Y here the kernel will use separate kernel stacks - for handling hard and soft interrupts. This can help avoid - overflowing the process kernel stacks. - -config SPINLINE - bool "Inline spinlock code at each call site" - depends on SMP && !PPC_SPLPAR && !PPC_ISERIES - help - Say Y if you want to have the code for acquiring spinlocks - and rwlocks inlined at each call site. This makes the kernel - somewhat bigger, but can be useful when profiling the kernel. - - If in doubt, say N. - -endmenu +source "arch/ppc64/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/ppc64/Kconfig.debug b/arch/ppc64/Kconfig.debug new file mode 100644 index 000000000000..041c5a71d0cc --- /dev/null +++ b/arch/ppc64/Kconfig.debug @@ -0,0 +1,57 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config DEBUG_STACKOVERFLOW + bool "Check for stack overflows" + depends on DEBUG_KERNEL + +config DEBUG_STACK_USAGE + bool "Stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +config DEBUGGER + bool "Enable debugger hooks" + depends on DEBUG_KERNEL + help + Include in-kernel hooks for kernel debuggers. Unless you are + intending to debug the kernel, say N here. + +config XMON + bool "Include xmon kernel debugger" + depends on DEBUGGER + help + Include in-kernel hooks for the xmon kernel monitor/debugger. + Unless you are intending to debug the kernel, say N here. + +config XMON_DEFAULT + bool "Enable xmon by default" + depends on XMON + +config PPCDBG + bool "Include PPCDBG realtime debugging" + depends on DEBUG_KERNEL + +config IRQSTACKS + bool "Use separate kernel stacks when processing interrupts" + help + If you say Y here the kernel will use separate kernel stacks + for handling hard and soft interrupts. This can help avoid + overflowing the process kernel stacks. + +config SPINLINE + bool "Inline spinlock code at each call site" + depends on SMP && !PPC_SPLPAR && !PPC_ISERIES + help + Say Y if you want to have the code for acquiring spinlocks + and rwlocks inlined at each call site. This makes the kernel + somewhat bigger, but can be useful when profiling the kernel. + + If in doubt, say N. + +endmenu diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile index 10c1d6299eee..dd858fe61603 100644 --- a/arch/ppc64/Makefile +++ b/arch/ppc64/Makefile @@ -15,14 +15,14 @@ KERNELLOAD := 0xc000000000000000 -HAS_BIARCH := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;) +HAS_BIARCH := $(call cc-option-yn, -m64) ifeq ($(HAS_BIARCH),y) AS := $(AS) -a64 LD := $(LD) -m elf64ppc CC := $(CC) -m64 endif -CHECK := $(CHECK) -m64 -D__powerpc__=1 +CHECKFLAGS += -m64 -D__powerpc__=1 LDFLAGS := -m elf64ppc LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) @@ -30,14 +30,14 @@ CFLAGS += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \ -mtraceback=none ifeq ($(CONFIG_POWER4_ONLY),y) - CFLAGS += $(call check_gcc,-mcpu=power4,) + CFLAGS += $(call cc-option,-mcpu=power4) else - CFLAGS += $(call check_gcc,-mtune=power4,) + CFLAGS += $(call cc-option,-mtune=power4) endif # Enable unit-at-a-time mode when possible. It shrinks the # kernel considerably. -CFLAGS += $(call check_gcc,-funit-at-a-time,) +CFLAGS += $(call cc-option,-funit-at-a-time) head-y := arch/ppc64/kernel/head.o diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile index 9d6431dd6a12..365cbaa4d4a6 100644 --- a/arch/ppc64/boot/Makefile +++ b/arch/ppc64/boot/Makefile @@ -25,7 +25,7 @@ CROSS32_COMPILE ?= BOOTCC := $(CROSS32_COMPILE)gcc HOSTCC := gcc -BOOTCFLAGS := $(HOSTCFLAGS) -Iinclude -fno-builtin +BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin BOOTAS := $(CROSS32_COMPILE)as BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional BOOTLD := $(CROSS32_COMPILE)ld @@ -58,7 +58,7 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section))) src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) -host-progs := piggy addnote addSystemMap addRamDisk +hostprogs-y := piggy addnote addSystemMap addRamDisk targets += zImage zImage.initrd imagesize.c \ $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index c5dd7e13b7c1..6f23daaf8dd2 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile @@ -3,7 +3,7 @@ # EXTRA_CFLAGS += -mno-minimal-toc -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ time.o process.o signal.o syscalls.o misc.o ptrace.o \ diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ce8cb18b90a4..0b59784d46ef 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -48,7 +48,7 @@ config ARCH_S390_31 depends on ARCH_S390X = 'n' default y -choice +choice prompt "Processor type" default MARCH_G5 @@ -73,8 +73,7 @@ config MARCH_Z990 This will be slightly faster but does not work on older machines such as the z900. -endchoice - +endchoice config SMP bool "Symmetric multi-processing support" @@ -121,7 +120,7 @@ config MATHEMU depends on MARCH_G5 help This option is required for IEEE compliant floating point arithmetic - on older S/390 machines. Say Y unless you know your machine doesn't + on older S/390 machines. Say Y unless you know your machine doesn't need this. config S390_SUPPORT @@ -156,7 +155,7 @@ config MACHCHK_WARNING bool "Process warning machine checks" help Select this option if you want the machine check handler on IBM S/390 or - zSeries to process warning machine checks (e.g. on power failures). + zSeries to process warning machine checks (e.g. on power failures). If unsure, say "Y". config QDIO @@ -388,64 +387,10 @@ source "fs/Kconfig" source "arch/s390/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config KALLSYMS - bool "Load all symbols for debugging/kksymoops" - depends on DEBUG_KERNEL - help - Say Y here to let the kernel print out symbolic crash information and - symbolic stack backtraces. This increases the size of the kernel - somewhat, as all symbols have to be loaded into the kernel image. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -endmenu +source "arch/s390/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug new file mode 100644 index 000000000000..f53b6d5300e5 --- /dev/null +++ b/arch/s390/Kconfig.debug @@ -0,0 +1,5 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +endmenu diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 68c1a72b0d92..904465485a92 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -28,12 +28,12 @@ AFLAGS += -m64 UTS_MACHINE := s390x endif -cflags-$(CONFIG_MARCH_G5) += $(call check_gcc,-march=g5,) -cflags-$(CONFIG_MARCH_Z900) += $(call check_gcc,-march=z900,) -cflags-$(CONFIG_MARCH_Z990) += $(call check_gcc,-march=z990,) +cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) +cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) +cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) CFLAGS += $(cflags-y) -CFLAGS += $(call check_gcc,-finline-limit=10000,) +CFLAGS += $(call cc-option,-finline-limit=10000) CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare CFLAGS += -mbackchain diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 892b7e1b06c4..7f1ce2362c3d 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -10,7 +10,7 @@ obj-y := bitmap.o traps.o time.o process.o \ extra-$(CONFIG_ARCH_S390_31) += head.o extra-$(CONFIG_ARCH_S390X) += head64.o -extra-y += init_task.o vmlinux.lds.s +extra-y += init_task.o vmlinux.lds obj-$(CONFIG_MODULES) += s390_ksyms.o module.o obj-$(CONFIG_SMP) += smp.o diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ce61d06cae26..de30f48e5a22 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -194,7 +194,7 @@ endchoice choice prompt "Processor subtype" - + config CPU_SUBTYPE_SH7604 bool "SH7604" depends on CPU_SH2 @@ -301,7 +301,7 @@ config MEMORY_START ---help--- Computers built with Hitachi SuperH processors always map the ROM starting at address zero. But the processor - does not specify the range that RAM takes. + does not specify the range that RAM takes. The physical memory (RAM) start address will be automatically set to 08000000, unless you selected one of the following @@ -339,7 +339,7 @@ config MEMORY_SET # If none of the above have set memory start/size, ask the user. config MEMORY_OVERRIDE bool "Override default load address and memory size" - + # XXX: break these out into the board-specific configs below config CF_ENABLER bool "Compact Flash Enabler support" @@ -522,7 +522,7 @@ config SH_STORE_QUEUES help Selecting this option will enable an in-kernel API for manipulating the store queues integrated in the SH-4 processors. - + config SMP bool "Symmetric multi-processing support" ---help--- @@ -711,7 +711,6 @@ source "drivers/pci/hotplug/Kconfig" endmenu - menu "Executable file formats" source "fs/Kconfig.binfmt" @@ -742,161 +741,10 @@ source "fs/Kconfig" source "arch/sh/oprofile/Kconfig" -menu "Kernel hacking" - -config MAGIC_SYSRQ - bool "Magic SysRq key" - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config SH_STANDARD_BIOS - bool "Use LinuxSH standard BIOS" - help - Say Y here if your target has the gdb-sh-stub - package from www.m17n.org (or any conforming standard LinuxSH BIOS) - in FLASH or EPROM. The kernel will use standard BIOS calls during - boot for various housekeeping tasks (including calls to read and - write characters to a system console, get a MAC address from an - on-board Ethernet interface, and shut down the hardware). Note this - does not work with machines with an existing operating system in - mask ROM and no flash (WindowsCE machines fall in this category). - If unsure, say N. - -config EARLY_SCIF_CONSOLE - bool "Use early SCIF console" - depends on CPU_SH4 - -config EARLY_PRINTK - bool "Early printk support" - depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE - help - Say Y here to redirect kernel printk messages to the serial port - used by the SH-IPL bootloader, starting very early in the boot - process and ending when the kernel's serial console is initialised. - This option is only useful porting the kernel to a new machine, - when the kernel may crash or hang before the serial console is - initialised. If unsure, say N. - -config KGDB - bool "Include KGDB kernel debugger" - help - Include in-kernel hooks for kgdb, the Linux kernel source level - debugger. See <http://kgdb.sourceforge.net/> for more information. - Unless you are intending to debug the kernel, say N here. - -menu "KGDB configuration options" - depends on KGDB - -config MORE_COMPILE_OPTIONS - bool "Add any additional compile options" - help - If you want to add additional CFLAGS to the kernel build, enable this - option and then enter what you would like to add in the next question. - Note however that -g is already appended with the selection of KGDB. - -config COMPILE_OPTIONS - string "Additional compile arguments" - depends on MORE_COMPILE_OPTIONS - -config KGDB_NMI - bool "Enter KGDB on NMI" - default n - -config KGDB_THREAD - bool "Include KGDB thread support" - default y - -config SH_KGDB_CONSOLE - bool "Console messages through GDB" - default n - -config KGDB_SYSRQ - bool "Allow SysRq 'G' to enter KGDB" - default y - -config KGDB_KERNEL_ASSERTS - bool "Include KGDB kernel assertions" - default n - -comment "Serial port setup" - -config KGDB_DEFPORT - int "Port number (ttySCn)" - default "1" - -config KGDB_DEFBAUD - int "Baud rate" - default "115200" - -choice - prompt "Parity" - depends on KGDB - default KGDB_DEFPARITY_N - -config KGDB_DEFPARITY_N - bool "None" - -config KGDB_DEFPARITY_E - bool "Even" - -config KGDB_DEFPARITY_O - bool "Odd" - -endchoice - -choice - prompt "Data bits" - depends on KGDB - default KGDB_DEFBITS_8 - -config KGDB_DEFBITS_8 - bool "8" - -config KGDB_DEFBITS_7 - bool "7" - -endchoice - -endmenu - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - default y if KGDB - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -endmenu +source "arch/sh/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug new file mode 100644 index 000000000000..3fab181da364 --- /dev/null +++ b/arch/sh/Kconfig.debug @@ -0,0 +1,124 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config SH_STANDARD_BIOS + bool "Use LinuxSH standard BIOS" + help + Say Y here if your target has the gdb-sh-stub + package from www.m17n.org (or any conforming standard LinuxSH BIOS) + in FLASH or EPROM. The kernel will use standard BIOS calls during + boot for various housekeeping tasks (including calls to read and + write characters to a system console, get a MAC address from an + on-board Ethernet interface, and shut down the hardware). Note this + does not work with machines with an existing operating system in + mask ROM and no flash (WindowsCE machines fall in this category). + If unsure, say N. + +config EARLY_SCIF_CONSOLE + bool "Use early SCIF console" + depends on CPU_SH4 + +config EARLY_PRINTK + bool "Early printk support" + depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE + help + Say Y here to redirect kernel printk messages to the serial port + used by the SH-IPL bootloader, starting very early in the boot + process and ending when the kernel's serial console is initialised. + This option is only useful porting the kernel to a new machine, + when the kernel may crash or hang before the serial console is + initialised. If unsure, say N. + +config KGDB + bool "Include KGDB kernel debugger" + help + Include in-kernel hooks for kgdb, the Linux kernel source level + debugger. See <http://kgdb.sourceforge.net/> for more information. + Unless you are intending to debug the kernel, say N here. + +menu "KGDB configuration options" + depends on KGDB + +config MORE_COMPILE_OPTIONS + bool "Add any additional compile options" + help + If you want to add additional CFLAGS to the kernel build, enable this + option and then enter what you would like to add in the next question. + Note however that -g is already appended with the selection of KGDB. + +config COMPILE_OPTIONS + string "Additional compile arguments" + depends on MORE_COMPILE_OPTIONS + +config KGDB_NMI + bool "Enter KGDB on NMI" + default n + +config KGDB_THREAD + bool "Include KGDB thread support" + default y + +config SH_KGDB_CONSOLE + bool "Console messages through GDB" + default n + +config KGDB_SYSRQ + bool "Allow SysRq 'G' to enter KGDB" + default y + +config KGDB_KERNEL_ASSERTS + bool "Include KGDB kernel assertions" + default n + +comment "Serial port setup" + +config KGDB_DEFPORT + int "Port number (ttySCn)" + default "1" + +config KGDB_DEFBAUD + int "Baud rate" + default "115200" + +choice + prompt "Parity" + depends on KGDB + default KGDB_DEFPARITY_N + +config KGDB_DEFPARITY_N + bool "None" + +config KGDB_DEFPARITY_E + bool "Even" + +config KGDB_DEFPARITY_O + bool "Odd" + +endchoice + +choice + prompt "Data bits" + depends on KGDB + default KGDB_DEFBITS_8 + +config KGDB_DEFBITS_8 + bool "8" + +config KGDB_DEFBITS_7 + bool "7" + +endchoice + +endmenu + +config FRAME_POINTER + bool "Compile the kernel with frame pointers" + default y if KGDB + help + If you say Y here the resulting kernel image will be slightly larger + and slower, but it will give very useful debugging information. + If you don't debug the kernel, you can say N, but we may not be able + to solve problems without frame pointers. + +endmenu diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 7e0087146eb2..5d2c028d9efc 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -31,7 +31,7 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml cflags-$(CONFIG_CPU_SH2) += -m2 cflags-$(CONFIG_CPU_SH3) += -m3 cflags-$(CONFIG_CPU_SH4) += -m4 \ - $(call check_gcc,-mno-implicit-fp,-m4-nofpu) + $(call cc-option,-mno-implicit-fp,-m4-nofpu) cflags-$(CONFIG_SH_DSP) += -Wa,-dsp cflags-$(CONFIG_SH_KGDB) += -g @@ -122,7 +122,7 @@ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ boot := arch/sh/boot -AFLAGS_vmlinux.lds.o := -traditional +CPPFLAGS_vmlinux.lds := -traditional prepare: target_links diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 05ca14dfafb8..75a6876bf6c6 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile @@ -22,7 +22,7 @@ CONFIG_MEMORY_START ?= 0x0c000000 CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) -LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds.s +LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(call if_changed,ld) diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index d36bd9410146..8b819698df14 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the Linux/SuperH kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o signal.o entry.o traps.o irq.o \ ptrace.o setup.o time.o sys_sh.o semaphore.o \ diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig index 0ac5d418ece0..551ba9a20543 100644 --- a/arch/sh64/Kconfig +++ b/arch/sh64/Kconfig @@ -263,58 +263,10 @@ source "fs/Kconfig" source "arch/sh64/oprofile/Kconfig" -menu "Kernel hacking" - -config MAGIC_SYSRQ - bool "Magic SysRq key" - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in Documentation/sysrq.txt. Don't say Y unless - you really know what this hack does. - -config EARLY_PRINTK - bool "Early SCIF console support" - -config DEBUG_KERNEL_WITH_GDB_STUB - bool "GDB Stub kernel debug" - -config SH64_PROC_TLB - bool "Debug: report TLB fill/purge activity through /proc/tlb" - depends on PROC_FS - -config SH64_PROC_ASIDS - bool "Debug: report ASIDs through /proc/asids" - depends on PROC_FS - -config SH64_SR_WATCH - bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" - -config SH_ALPHANUMERIC - bool "Enable debug outputs to on-board alphanumeric display" - -config SH_NO_BSS_INIT - bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)" - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - default y if KGDB - help - If you say Y here the resulting kernel image will be slightly larger - and slower, but it will give very useful debugging information. - If you don't debug the kernel, you can say N, but we may not be able - to solve problems without frame pointers. - -endmenu +source "arch/sh64/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/sh64/Kconfig.debug b/arch/sh64/Kconfig.debug new file mode 100644 index 000000000000..530b3c650e86 --- /dev/null +++ b/arch/sh64/Kconfig.debug @@ -0,0 +1,37 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config EARLY_PRINTK + bool "Early SCIF console support" + +config DEBUG_KERNEL_WITH_GDB_STUB + bool "GDB Stub kernel debug" + +config SH64_PROC_TLB + bool "Debug: report TLB fill/purge activity through /proc/tlb" + depends on PROC_FS + +config SH64_PROC_ASIDS + bool "Debug: report ASIDs through /proc/asids" + depends on PROC_FS + +config SH64_SR_WATCH + bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" + +config SH_ALPHANUMERIC + bool "Enable debug outputs to on-board alphanumeric display" + +config SH_NO_BSS_INIT + bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)" + +config FRAME_POINTER + bool "Compile the kernel with frame pointers" + default y if KGDB + help + If you say Y here the resulting kernel image will be slightly larger + and slower, but it will give very useful debugging information. + If you don't debug the kernel, you can say N, but we may not be able + to solve problems without frame pointers. + +endmenu diff --git a/arch/sh64/boot/compressed/Makefile b/arch/sh64/boot/compressed/Makefile index 3f6cbf017337..9cd216718856 100644 --- a/arch/sh64/boot/compressed/Makefile +++ b/arch/sh64/boot/compressed/Makefile @@ -12,7 +12,7 @@ # targets := vmlinux vmlinux.bin vmlinux.bin.gz \ - head.o misc.o cache.o piggy.o vmlinux.lds.o + head.o misc.o cache.o piggy.o vmlinux.lds EXTRA_AFLAGS := -traditional @@ -25,7 +25,7 @@ OBJECTS := $(obj)/head.o $(obj)/misc.o $(obj)/cache.o ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000]) LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ - -T $(obj)/../../kernel/vmlinux.lds.s \ + -T $(obj)/../../kernel/vmlinux.lds \ --no-warn-mismatch $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE @@ -41,6 +41,6 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T OBJCOPYFLAGS += -R .empty_zero_page -$(obj)/piggy.o: $(obj)/vmlinux.lds.s $(obj)/vmlinux.bin.gz FORCE +$(obj)/piggy.o: $(obj)/vmlinux.lds $(obj)/vmlinux.bin.gz FORCE $(call if_changed,ld) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 7d0688aa6833..268ba79c53ce 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -23,7 +23,6 @@ config GENERIC_ISA_DMA source "init/Kconfig" - menu "General setup" config VT @@ -217,8 +216,8 @@ config SUN_PM bool default y help - Enable power management and CPU standby features on supported - SPARC platforms. + Enable power management and CPU standby features on supported + SPARC platforms. config SUN4 bool "Support for SUN4 machines (disables SUN4[CDM] support)" @@ -380,81 +379,10 @@ source "drivers/usb/Kconfig" source "drivers/char/watchdog/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_STACK_USAGE - bool "Enable stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_HIGHMEM - bool "Highmem debugging" - depends on DEBUG_KERNEL && HIGHMEM - help - This options enables additional error checking for high memory - systems. Disable for production systems. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - depends on DEBUG_KERNEL - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config DEBUG_BUGVERBOSE - bool "Verbose BUG() reporting (adds 70K)" - depends on DEBUG_KERNEL - help - Say Y here to make BUG() panics output the file name and line number - of the BUG call as well as the EIP and oops trace. This aids - debugging but costs about 70-100K of memory. - -endmenu +source "arch/sparc/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/sparc/Kconfig.debug b/arch/sparc/Kconfig.debug new file mode 100644 index 000000000000..120f6b529348 --- /dev/null +++ b/arch/sparc/Kconfig.debug @@ -0,0 +1,14 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config DEBUG_STACK_USAGE + bool "Enable stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +endmenu diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index 15fcf89e1402..8852935b4f8b 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile @@ -13,7 +13,7 @@ AS := $(AS) -32 LDFLAGS := -m elf32_sparc -CHECK := $(CHECK) -D__sparc__=1 +CHECKFLAGS += -D__sparc__=1 #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index b19cc8689c37..b365084316ac 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile @@ -7,28 +7,52 @@ ROOT_IMG := /usr/src/root.img ELFTOAOUT := elftoaout -host-progs := piggyback btfixupprep -targets := tftpboot.img btfix.o btfix.s image +hostprogs-y := piggyback btfixupprep +targets := tftpboot.img btfix.o btfix.S image quiet_cmd_elftoaout = ELFTOAOUT $@ cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@ -quiet_cmd_piggy = PIGGY $@ +quiet_cmd_piggy = PIGGY $@ cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG) -quiet_cmd_btfix = BTFIX $@ +quiet_cmd_btfix = BTFIX $@ cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ +quiet_cmd_sysmap = SYSMAP $(obj)/System.map + cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap +quiet_cmd_image = LD $@ + cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@ + +define rule_image + $(if $($(quiet)cmd_image), \ + echo ' $($(quiet)cmd_image)' &&) \ + $(cmd_image); \ + $(if $($(quiet)cmd_sysmap), \ + echo ' $($(quiet)cmd_sysmap)' &&) \ + $(cmd_sysmap) $@ $(obj)/System.map; \ + if [ $$? -ne 0 ]; then \ + rm -f $@; \ + /bin/false; \ + fi; \ + echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd +endef BTOBJS := $(HEAD_Y) $(INIT_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) -LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) +LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ + --start-group $(BTLIBS) --end-group \ + $(kallsyms.o) $(obj)/btfix.o -# Actual linking +# Link the final image including btfixup'ed symbols. +# This is a replacement for the link done in the top-level Makefile. +# Note: No dependency on the prerequisite files since that would require +# make to try check if they are updated - and due to changes +# in gcc options (path for example) this would result in +# these files being recompiled for each build. $(obj)/image: $(obj)/btfix.o FORCE - $(call if_changed,ld) - $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(obj)/System.map + $(call if_changed_rule,image) $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE $(call if_changed,elftoaout) $(call if_changed,piggy) -$(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE +$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE $(call if_changed,btfix) diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index fcf149e00237..3d22ba2af01c 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds EXTRA_AFLAGS := -ansi diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index 604428879bdc..d9e8b6589843 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig @@ -14,8 +14,7 @@ config MMU source "init/Kconfig" - -menu "General setup" +menu "General machine setup" config BBC_I2C tristate "UltraSPARC-III bootbus i2c controller driver" @@ -549,7 +548,6 @@ config UNIX98_PTY_COUNT endmenu - menu "XFree86 DRI support" config DRM @@ -604,113 +602,10 @@ source "drivers/char/watchdog/Kconfig" source "arch/sparc64/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_STACK_USAGE - bool "Enable stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -config DEBUG_SPINLOCK_SLEEP - bool "Sleep-inside-spinlock checking" - depends DEBUG_KERNEL - help - If you say Y here, various routines which may sleep will become very - noisy if they are called with a spinlock held. - -config DEBUG_BUGVERBOSE - bool "Verbose BUG() reporting (adds 70K)" - depends on DEBUG_KERNEL - help - Say Y here to make BUG() panics output the file name and line number - of the BUG call as well as the EIP and oops trace. This aids - debugging but costs about 70-100K of memory. - -config DEBUG_DCFLUSH - bool "D-cache flush debugging" - depends on DEBUG_KERNEL - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config STACK_DEBUG - depends on DEBUG_KERNEL - bool "Stack Overflow Detection Support" - -config DEBUG_BOOTMEM - depends on DEBUG_KERNEL - bool "Debug BOOTMEM initialization" - -# We have a custom atomic_dec_and_lock() implementation but it's not -# compatible with spinlock debugging so we need to fall back on -# the generic version in that case. -config HAVE_DEC_LOCK - bool - depends on SMP && !DEBUG_SPINLOCK - default y - -config MCOUNT - bool - depends on STACK_DEBUG - default y - -config FRAME_POINTER - bool - depends on MCOUNT - default y - -endmenu +source "arch/sparc64/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug new file mode 100644 index 000000000000..c3f79c0afc34 --- /dev/null +++ b/arch/sparc64/Kconfig.debug @@ -0,0 +1,44 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config DEBUG_STACK_USAGE + bool "Enable stack utilization instrumentation" + depends on DEBUG_KERNEL + help + Enables the display of the minimum amount of free stack which each + task has ever had available in the sysrq-T and sysrq-P debug output. + + This option will slow down process creation somewhat. + +config DEBUG_DCFLUSH + bool "D-cache flush debugging" + depends on DEBUG_KERNEL + +config STACK_DEBUG + depends on DEBUG_KERNEL + bool "Stack Overflow Detection Support" + +config DEBUG_BOOTMEM + depends on DEBUG_KERNEL + bool "Debug BOOTMEM initialization" + +# We have a custom atomic_dec_and_lock() implementation but it's not +# compatible with spinlock debugging so we need to fall back on +# the generic version in that case. +config HAVE_DEC_LOCK + bool + depends on SMP && !DEBUG_SPINLOCK + default y + +config MCOUNT + bool + depends on STACK_DEBUG + default y + +config FRAME_POINTER + bool + depends on MCOUNT + default y + +endmenu diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile index fc57c40c28f0..789eeaf34c2f 100644 --- a/arch/sparc64/Makefile +++ b/arch/sparc64/Makefile @@ -8,16 +8,16 @@ # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) # -CHECK := $(CHECK) -D__sparc__=1 -D__sparc_v9__=1 +CHECKFLAGS += -D__sparc__=1 -D__sparc_v9__=1 -AFLAGS_vmlinux.lds.o += -Usparc +CPPFLAGS_vmlinux.lds += -Usparc CC := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi ) -NEW_GCC := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) +NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow) NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | grep undeclared-regs > /dev/null; then echo y; else echo n; fi; ) -INLINE_LIMIT := $(shell if $(CC) -m64 -finline-limit=100000 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) +INLINE_LIMIT := $(call cc-option-yn, -m64 -finline-limit=100000) export NEW_GCC diff --git a/arch/sparc64/boot/Makefile b/arch/sparc64/boot/Makefile index 5eb14ff1c518..6968a6da57da 100644 --- a/arch/sparc64/boot/Makefile +++ b/arch/sparc64/boot/Makefile @@ -7,7 +7,7 @@ ROOT_IMG := /usr/src/root.img ELFTOAOUT := elftoaout -host-progs := piggyback +hostprogs-y := piggyback targets := image tftpboot.img vmlinux.aout quiet_cmd_elftoaout = ELF2AOUT $@ diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 2caca47d8658..5c53e0026932 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile @@ -5,7 +5,7 @@ EXTRA_AFLAGS := -ansi EXTRA_CFLAGS := -Werror -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o setup.o cpu.o idprom.o \ traps.o devices.o auxio.o \ diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 47fbaf3f4b63..3fa8b154bf66 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig @@ -34,7 +34,7 @@ config MODE_TT help This option controls whether tracing thread support is compiled into UML. Normally, this should be set to Y. If you intend to - use only skas mode (and the host has the skas patch applied to it), + use only skas mode (and the host has the skas patch applied to it), then it is OK to say N here. config STATIC_LINK @@ -45,7 +45,7 @@ config STATIC_LINK If CONFIG_MODE_TT is disabled, then this option gives you the ability to force a static link of UML. Normally, if only skas mode is built in to UML, it will be linked as a shared binary. This is inconvenient - for use in a chroot jail. So, if you intend to run UML inside a + for use in a chroot jail. So, if you intend to run UML inside a chroot, and you disable CONFIG_MODE_TT, you probably want to say Y here. @@ -82,7 +82,7 @@ config HOSTFS For more information, see <http://user-mode-linux.sourceforge.net/hostfs.html>. - If you'd like to be able to work with files stored on the host, + If you'd like to be able to work with files stored on the host, say Y or M here; otherwise say N. @@ -102,10 +102,6 @@ config MCONSOLE It is safe to say 'Y' here. -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on MCONSOLE - config HOST_2G_2G bool "2G/2G host address space split" @@ -140,11 +136,11 @@ config NEST_LEVEL in. Normally, this is zero, meaning that it will run directly on the host. Setting it to one will build a UML that can run inside a UML that is running on the host. Generally, if you intend this UML to run - inside another UML, set CONFIG_NEST_LEVEL to one more than the host + inside another UML, set CONFIG_NEST_LEVEL to one more than the host UML. - Note that if the hosting UML has its CONFIG_KERNEL_HALF_GIGS set to - greater than one, then the guest UML should have its CONFIG_NEST_LEVEL + Note that if the hosting UML has its CONFIG_KERNEL_HALF_GIGS set to + greater than one, then the guest UML should have its CONFIG_NEST_LEVEL set to the host's CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS. Only change this if you are running nested UMLs. @@ -213,59 +209,4 @@ source "drivers/md/Kconfig" source "drivers/mtd/Kconfig" - -menu "Kernel hacking" - -config DEBUG_SLAB - bool "Debug memory allocations" - -config DEBUG_SPINLOCK - bool "Debug spinlocks usage" - -config DEBUG_INFO - bool "Enable kernel debugging symbols" - help - When this is enabled, the User-Mode Linux binary will include - debugging symbols. This enlarges the binary by a few megabytes, - but aids in tracking down kernel problems in UML. It is required - if you intend to do any kernel development. - - If you're truly short on disk space or don't expect to report any - bugs back to the UML developers, say N, otherwise say Y. - -config FRAME_POINTER - bool - default y if DEBUG_INFO - -config PT_PROXY - bool "Enable ptrace proxy" - depends on XTERM_CHAN && DEBUG_INFO - -config GPROF - bool "Enable gprof support" - depends on DEBUG_INFO - help - This allows profiling of a User-Mode Linux kernel with the gprof - utility. - - See <http://user-mode-linux.sourceforge.net/gprof.html> for more - details. - - If you're involved in UML kernel development and want to use gprof, - say Y. If you're unsure, say N. - -config GCOV - bool "Enable gcov support" - depends on DEBUG_INFO - help - This option allows developers to retrieve coverage data from a UML - session. - - See <http://user-mode-linux.sourceforge.net/gprof.html> for more - details. - - If you're involved in UML kernel development and want to use gcov, - say Y. If you're unsure, say N. - -endmenu - +source "arch/um/Kconfig.debug" diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug new file mode 100644 index 000000000000..9cbe43f1c631 --- /dev/null +++ b/arch/um/Kconfig.debug @@ -0,0 +1,39 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config FRAME_POINTER + bool + default y if DEBUG_INFO + +config PT_PROXY + bool "Enable ptrace proxy" + depends on XTERM_CHAN && DEBUG_INFO + +config GPROF + bool "Enable gprof support" + depends on DEBUG_INFO + help + This allows profiling of a User-Mode Linux kernel with the gprof + utility. + + See <http://user-mode-linux.sourceforge.net/gprof.html> for more + details. + + If you're involved in UML kernel development and want to use gprof, + say Y. If you're unsure, say N. + +config GCOV + bool "Enable gcov support" + depends on DEBUG_INFO + help + This option allows developers to retrieve coverage data from a UML + session. + + See <http://user-mode-linux.sourceforge.net/gprof.html> for more + details. + + If you're involved in UML kernel development and want to use gcov, + say Y. If you're unsure, say N. + +endmenu diff --git a/arch/um/Makefile b/arch/um/Makefile index bb7d3f6baa95..fe9107b8a37e 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -77,7 +77,7 @@ vmlinux: $(ARCH_DIR)/main.o # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. LINK_TT = -static -LD_SCRIPT_TT := uml.lds.s +LD_SCRIPT_TT := uml.lds ifeq ($(CONFIG_STATIC_LINK),y) LINK-y += $(LINK_TT) @@ -98,12 +98,12 @@ CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT) CONFIG_KERNEL_STACK_ORDER ?= 2 STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) -AFLAGS_vmlinux.lds.o = -U$(SUBARCH) \ +CPPFLAGS_vmlinux.lds = -U$(SUBARCH) \ -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \ -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ -DKERNEL_STACK_SIZE=$(STACK_SIZE) -AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum +CPPFLAGS_$(LD_SCRIPT-y) = $(CPPFLAGS_vmlinux.lds) -P -C -Uum LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) @@ -122,7 +122,7 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ # To get a definition of F_SETSIG USER_CFLAGS += -D_GNU_SOURCE -CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ +CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds \ $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c diff --git a/arch/um/Makefile-skas b/arch/um/Makefile-skas index b9dfec5f7557..55cba5e998e3 100644 --- a/arch/um/Makefile-skas +++ b/arch/um/Makefile-skas @@ -12,7 +12,7 @@ LINK-$(CONFIG_GPROF) += $(PROFILE) MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include LINK_SKAS = -Wl,-rpath,/lib -LD_SCRIPT_SKAS = dyn.lds.s +LD_SCRIPT_SKAS = dyn.lds GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index 0f13dd4c7f4d..ccaa771204ea 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile @@ -3,7 +3,7 @@ # Licensed under the GPL # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ diff --git a/arch/um/sys-i386/util/Makefile b/arch/um/sys-i386/util/Makefile index a3eca5f22f08..1fd4926b9b5a 100644 --- a/arch/um/sys-i386/util/Makefile +++ b/arch/um/sys-i386/util/Makefile @@ -1,6 +1,6 @@ -host-progs := mk_sc -always := $(host-progs) mk_thread +hostprogs-y := mk_sc +always := $(hostprogs-y) mk_thread targets := mk_thread_kern.o mk_thread_user.o mk_sc-objs := mk_sc.o diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index 8665652e24e6..4bb7e51504b1 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig @@ -68,7 +68,6 @@ menu "Processor type and features" bool "Anna" endchoice - #### V850E processor-specific config # All CPUs currently supported use the v850e architecture @@ -153,7 +152,6 @@ menu "Processor type and features" bool default RTE_MB_A_PCI - #### Some feature-specific configs # Everything except for the GDB simulator uses the same interrupt controller @@ -181,7 +179,6 @@ menu "Processor type and features" bool default !V850E_CACHE && !V850E2_CACHE - #### Misc config config ROM_KERNEL @@ -305,34 +302,7 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - If you don't debug the kernel, you can say N. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - depends on DEBUG_KERNEL - help - Enables console device to interprent special characters as - commands to dump state information. - -config NO_KERNEL_MSG - bool "Suppress Kernel BUG Messages" - help - Do not output any debug BUG messages within the kernel. - -endmenu +source "arch/v850/Kconfig.debug" source "security/Kconfig" diff --git a/arch/v850/Kconfig.debug b/arch/v850/Kconfig.debug new file mode 100644 index 000000000000..4acfb9cca1ca --- /dev/null +++ b/arch/v850/Kconfig.debug @@ -0,0 +1,10 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +config NO_KERNEL_MSG + bool "Suppress Kernel BUG Messages" + help + Do not output any debug BUG messages within the kernel. + +endmenu diff --git a/arch/v850/kernel/Makefile b/arch/v850/kernel/Makefile index 117bcaaa0ae7..3930482bddc4 100644 --- a/arch/v850/kernel/Makefile +++ b/arch/v850/kernel/Makefile @@ -9,7 +9,7 @@ # for more details. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ signal.o irq.o mach.o ptrace.o bug.o diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 2122afc52301..a0cc03a9055b 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -4,7 +4,7 @@ # # Note: ISA is disabled and will hopefully never be enabled. # If you managed to buy an ISA x86-64 box you'll have to fix all the -# ISA drivers you need yourself. +# ISA drivers you need yourself. # mainmenu "Linux Kernel Configuration" @@ -57,7 +57,7 @@ config EARLY_PRINTK it is not recommended because it looks ugly and doesn't cooperate with klogd/syslogd or the X server. You should normally N here, unless you want to debug such a crash. - + config HPET_TIMER bool default y @@ -90,14 +90,14 @@ choice config MK8 bool "AMD-Opteron/Athlon64" help - Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. + Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. config MPSC - bool "Intel x86-64" + bool "Intel x86-64" help Optimize for Intel IA32 with 64bit extension CPUs (Prescott/Nocona/Potomac) - + config GENERIC_CPU bool "Generic-x86-64" help @@ -130,8 +130,8 @@ config MICROCODE tristate "/dev/cpu/microcode - Intel CPU microcode support" ---help--- If you say Y here the 'File systems' section, you will be - able to update the microcode on Intel processors. You will - obviously need the actual microcode binary data itself which is + able to update the microcode on Intel processors. You will + obviously need the actual microcode binary data itself which is not shipped with the Linux kernel. For latest news and information on obtaining all the required @@ -165,7 +165,7 @@ config X86_HT bool depends on SMP && !MK8 default y - + config MATH_EMULATION bool @@ -231,13 +231,13 @@ config PREEMPT be preempted even if it is in kernel mode executing a system call. This allows applications to run more reliably even when the system is under load. On contrary it may also break your drivers and add - priority inheritance problems to your system. Don't select it if + priority inheritance problems to your system. Don't select it if you rely on a stable system or have slightly obscure hardware. It's also not very well tested on x86-64 currently. You have been warned. - Say Y here if you are feeling brave and building a kernel for a - desktop, embedded or real-time system. Say N if you are unsure. + Say Y here if you are feeling brave and building a kernel for a + desktop, embedded or real-time system. Say N if you are unsure. config SCHED_SMT bool "SMT (Hyperthreading) scheduler support" @@ -297,7 +297,7 @@ config GART_IOMMU properly with 32-bit PCI devices that do not support DAC (Double Address Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter. Normally the kernel will take the right choice by itself. - If unsure say Y + If unsure, say Y. # need this always enabled with GART_IOMMU for the VIA workaround config SWIOTLB @@ -310,7 +310,7 @@ config DUMMY_IOMMU depends on !GART_IOMMU && !SWIOTLB default y help - Don't use IOMMU code. This will cause problems when you have more than 4GB + Don't use IOMMU code. This will cause problems when you have more than 4GB of memory and any 32-bit devices. Don't turn on unless you know what you are doing. @@ -336,14 +336,14 @@ menu "Bus options (PCI etc.)" config PCI bool "PCI support" -# x86-64 doesn't support PCI BIOS access from long mode so always go direct. +# x86-64 doesn't support PCI BIOS access from long mode so always go direct. config PCI_DIRECT bool depends on PCI default y -config PCI_MMCONFIG - bool "Support mmconfig PCI config space access" +config PCI_MMCONFIG + bool "Support mmconfig PCI config space access" depends on PCI select ACPI_BOOT @@ -398,110 +398,10 @@ source fs/Kconfig source "arch/x86_64/oprofile/Kconfig" -menu "Kernel hacking" - -config DEBUG_KERNEL - bool "Kernel debugging" - help - Say Y here if you are developing drivers or trying to debug and - identify kernel problems. - -config DEBUG_SLAB - bool "Debug memory allocations" - depends on DEBUG_KERNEL - help - Say Y here to have the kernel do limited verification on memory - allocation as well as poisoning memory on free to catch use of freed - memory. - -config MAGIC_SYSRQ - bool "Magic SysRq key" - help - If you say Y here, you will have some control over the system even - if the system crashes for example during kernel debugging (e.g., you - will be able to flush the buffer cache to disk, reboot the system - immediately or dump some status information). This is accomplished - by pressing various keys while holding SysRq (Alt+PrintScreen). It - also works on a serial console (on PC hardware at least), if you - send a BREAK and then within 5 seconds a command keypress. The - keys are documented in <file:Documentation/sysrq.txt>. Don't say Y - unless you really know what this hack does. - -config DEBUG_SPINLOCK - bool "Spinlock debugging" - depends on DEBUG_KERNEL - help - Say Y here and build SMP to catch missing spinlock initialization - and certain other kinds of spinlock errors commonly made. This is - best used in conjunction with the NMI watchdog so that spinlock - deadlocks are also debuggable. - -# !SMP for now because the context switch early causes GPF in segment reloading -# and the GS base checking does the wrong thing then, causing a hang. -config CHECKING - bool "Additional run-time checks" - depends on DEBUG_KERNEL && !SMP - help - Enables some internal consistency checks for kernel debugging. - You should normally say N. - -config INIT_DEBUG - bool "Debug __init statements" - depends on DEBUG_KERNEL - help - Fill __init and __initdata at the end of boot. This helps debugging - illegal uses of __init and __initdata after initialization. - -config DEBUG_INFO - bool "Compile the kernel with debug info" - depends on DEBUG_KERNEL - help - If you say Y here the resulting kernel image will include - debugging info resulting in a larger kernel image. - Say Y here only if you plan to use gdb to debug the kernel. - Please note that this option requires new binutils. - If you don't debug the kernel, you can say N. - -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - Compile the kernel with frame pointers. This may help for some - debugging with external debuggers. Note the standard oops backtracer - doesn't make use of this and the x86-64 kernel doesn't ensure an consistent - frame pointer through inline assembly (semaphores etc.) - Normally you should say N. - -config IOMMU_DEBUG - depends on GART_IOMMU && DEBUG_KERNEL - bool "Enable IOMMU debugging" - help - Force the IOMMU to on even when you have less than 4GB of - memory and add debugging code. On overflow always panic. And - allow to enable IOMMU leak tracing. Can be disabled at boot - time with iommu=noforce. This will also enable scatter gather - list merging. Currently not recommended for production - code. When you use it make sure you have a big enough - IOMMU/AGP aperture. Most of the options enabled by this can - be set more finegrained using the iommu= command line - options. See Documentation/x86_64/boot-options.txt for more - details. - -config IOMMU_LEAK - bool "IOMMU leak tracing" - depends on DEBUG_KERNEL - depends on IOMMU_DEBUG - help - Add a simple leak tracer to the IOMMU code. This is useful when you - are debugging a buggy device driver that leaks IOMMU mappings. - -#config X86_REMOTE_DEBUG -# bool "kgdb debugging stub" - -endmenu +source "arch/x86_64/Kconfig.debug" source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" - diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug new file mode 100644 index 000000000000..e238651107a3 --- /dev/null +++ b/arch/x86_64/Kconfig.debug @@ -0,0 +1,56 @@ +menu "Kernel hacking" + +source "lib/Kconfig.debug" + +# !SMP for now because the context switch early causes GPF in segment reloading +# and the GS base checking does the wrong thing then, causing a hang. +config CHECKING + bool "Additional run-time checks" + depends on DEBUG_KERNEL && !SMP + help + Enables some internal consistency checks for kernel debugging. + You should normally say N. + +config INIT_DEBUG + bool "Debug __init statements" + depends on DEBUG_KERNEL + help + Fill __init and __initdata at the end of boot. This helps debugging + illegal uses of __init and __initdata after initialization. + +config FRAME_POINTER + bool "Compile the kernel with frame pointers" + help + Compile the kernel with frame pointers. This may help for some + debugging with external debuggers. Note the standard oops backtracer + doesn't make use of this and the x86-64 kernel doesn't ensure a + consistent frame pointer through inline assembly (semaphores etc.) + Normally you should say N. + +config IOMMU_DEBUG + depends on GART_IOMMU && DEBUG_KERNEL + bool "Enable IOMMU debugging" + help + Force the IOMMU to on even when you have less than 4GB of + memory and add debugging code. On overflow always panic. And + allow to enable IOMMU leak tracing. Can be disabled at boot + time with iommu=noforce. This will also enable scatter gather + list merging. Currently not recommended for production + code. When you use it make sure you have a big enough + IOMMU/AGP aperture. Most of the options enabled by this can + be set more finegrained using the iommu= command line + options. See Documentation/x86_64/boot-options.txt for more + details. + +config IOMMU_LEAK + bool "IOMMU leak tracing" + depends on DEBUG_KERNEL + depends on IOMMU_DEBUG + help + Add a simple leak tracer to the IOMMU code. This is useful when you + are debugging a buggy device driver that leaks IOMMU mappings. + +#config X86_REMOTE_DEBUG +# bool "kgdb debugging stub" + +endmenu diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 9b9a504efa55..34aa2cebf16c 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -37,10 +37,10 @@ LDFLAGS := -m elf_x86_64 OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -e stext -CHECK := $(CHECK) -D__x86_64__=1 +CHECKFLAGS += -D__x86_64__=1 -cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,) -cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=nocona,) +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) +cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) CFLAGS += $(cflags-y) CFLAGS += -mno-red-zone @@ -54,11 +54,11 @@ ifneq ($(CONFIG_DEBUG_INFO),y) CFLAGS += -fno-asynchronous-unwind-tables # -fweb shrinks the kernel a bit, but the difference is very small # it also messes up debugging, so don't use it for now. -#CFLAGS += $(call check_gcc,-fweb,) +#CFLAGS += $(call cc-option,-fweb) endif # -funit-at-a-time shrinks the kernel .text considerably # unfortunately it makes reading oopses harder. -CFLAGS += $(call check_gcc,-funit-at-a-time,) +CFLAGS += $(call cc-option,-funit-at-a-time) head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile index 1c2d3cbcae43..99b790439514 100644 --- a/arch/x86_64/boot/Makefile +++ b/arch/x86_64/boot/Makefile @@ -30,7 +30,7 @@ targets := vmlinux.bin bootsect bootsect.o \ EXTRA_CFLAGS := -m32 -host-progs := tools/build +hostprogs-y := tools/build subdir- := compressed/ #Let make clean descend in compressed/ # --------------------------------------------------------------------------- diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile index dc6f2695eca9..5ec45f513bd4 100644 --- a/arch/x86_64/kernel/Makefile +++ b/arch/x86_64/kernel/Makefile @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ diff --git a/arch/x86_64/kernel/Makefile-HEAD b/arch/x86_64/kernel/Makefile-HEAD index dc6f2695eca9..5ec45f513bd4 100644 --- a/arch/x86_64/kernel/Makefile-HEAD +++ b/arch/x86_64/kernel/Makefile-HEAD @@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile index bcd60fb8dae7..907c5933a30c 100644 --- a/drivers/atm/Makefile +++ b/drivers/atm/Makefile @@ -3,7 +3,7 @@ # fore_200e-objs := fore200e.o -host-progs := fore200e_mkfirm +hostprogs-y := fore200e_mkfirm # Files generated that shall be removed upon make clean clean-files := atmsar11.bin atmsar11.bin1 atmsar11.bin2 pca200e.bin \ diff --git a/drivers/md/Makefile b/drivers/md/Makefile index c8feb8346766..4f3ae7735fe6 100644 --- a/drivers/md/Makefile +++ b/drivers/md/Makefile @@ -10,7 +10,7 @@ raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \ raid6int1.o raid6int2.o raid6int4.o \ raid6int8.o raid6int16.o raid6int32.o \ raid6mmx.o raid6sse1.o raid6sse2.o -host-progs := mktables +hostprogs-y := mktables # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise diff --git a/drivers/media/dvb/ttpci/Makefile b/drivers/media/dvb/ttpci/Makefile index 2e8403b89f7b..043468a1d749 100644 --- a/drivers/media/dvb/ttpci/Makefile +++ b/drivers/media/dvb/ttpci/Makefile @@ -13,7 +13,7 @@ obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o ttpci-eeprom.o EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -host-progs := fdump +hostprogs-y := fdump ifdef CONFIG_DVB_AV7110_FIRMWARE $(obj)/av7110.o: $(obj)/fdump $(obj)/av7110_firm.h diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 377c7238c4cc..474eacd34741 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -35,7 +35,7 @@ ifndef CONFIG_X86 obj-y += syscall.o endif -host-progs := gen-devlist +hostprogs-y := gen-devlist # Dependencies on generated files need to be listed explicitly $(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h diff --git a/drivers/zorro/Makefile b/drivers/zorro/Makefile index 32f99d846edb..f62172603215 100644 --- a/drivers/zorro/Makefile +++ b/drivers/zorro/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o obj-$(CONFIG_PROC_FS) += proc.o -host-progs := gen-devlist +hostprogs-y := gen-devlist # Files generated that shall be removed upon make clean clean-files := devlist.h diff --git a/init/Kconfig b/init/Kconfig index 113a656f52f1..805320706a9d 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1,4 +1,3 @@ - menu "Code maturity level options" config EXPERIMENTAL @@ -53,7 +52,6 @@ config BROKEN_ON_SMP endmenu - menu "General setup" config SWAP @@ -287,7 +285,6 @@ config CC_OPTIMIZE_FOR_SIZE endmenu # General setup - menu "Loadable module support" config MODULES diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug new file mode 100644 index 000000000000..ff2bdc4bbd7c --- /dev/null +++ b/lib/Kconfig.debug @@ -0,0 +1,100 @@ + +config DEBUG_KERNEL + bool "Kernel debugging" + depends on (ALPHA || ARM || CRIS || H8300 || X86 || IA64 || M68K || M68KNOMMU || MIPS || PARISC || PPC32 || PPC64 || ARCH_S390 || SUPERH || SUPERH64 || SPARC32 || SPARC64 || USERMODE || V850 || X86_64) + help + Say Y here if you are developing drivers or trying to debug and + identify kernel problems. + +config MAGIC_SYSRQ + bool "Magic SysRq key" + depends on DEBUG_KERNEL && (ALPHA || ARM || X86 || IA64 || M68K || MIPS || PARISC || PPC32 || PPC64 || ARCH_S390 || SUPERH || SUPERH64 || SPARC32 || SPARC64 || X86_64) + help + If you say Y here, you will have some control over the system even + if the system crashes for example during kernel debugging (e.g., you + will be able to flush the buffer cache to disk, reboot the system + immediately or dump some status information). This is accomplished + by pressing various keys while holding SysRq (Alt+PrintScreen). It + also works on a serial console (on PC hardware at least), if you + send a BREAK and then within 5 seconds a command keypress. The + keys are documented in <file:Documentation/sysrq.txt>. Don't say Y + unless you really know what this hack does. + +config MAGIC_SYSRQ + bool "Magic SysRq key" + depends on DEBUG_KERNEL && (H8300 || M68KNOMMU || V850) + depends (USERMODE && MCONSOLE) + help + Enables console device to interpret special characters as + commands to dump state information. + +config DEBUG_SLAB + bool "Debug memory allocations" + depends on DEBUG_KERNEL && (ALPHA || ARM || X86 || IA64 || M68K || MIPS || PARISC || PPC32 || PPC64 || ARCH_S390 || SPARC32 || SPARC64 || USERMODE || X86_64) + help + Say Y here to have the kernel do limited verification on memory + allocation as well as poisoning memory on free to catch use of freed + memory. + +config DEBUG_SPINLOCK + bool "Spinlock debugging" + depends on DEBUG_KERNEL && (ALPHA || ARM || X86 || IA64 || MIPS || PPC32 || (SUPERH && !SUPERH64) || SPARC32 || SPARC64 || USERMODE || X86_64) + help + Say Y here and build SMP to catch missing spinlock initialization + and certain other kinds of spinlock errors commonly made. This is + best used in conjunction with the NMI watchdog so that spinlock + deadlocks are also debuggable. + +config DEBUG_SPINLOCK_SLEEP + bool "Sleep-inside-spinlock checking" + depends on DEBUG_KERNEL && (X86 || IA64 || MIPS || PPC32 || ARCH_S390 || SPARC32 || SPARC64) + help + If you say Y here, various routines which may sleep will become very + noisy if they are called with a spinlock held. + +config DEBUG_HIGHMEM + bool "Highmem debugging" + depends on DEBUG_KERNEL && HIGHMEM && (X86 || PPC32 || MIPS || SPARC32) + help + This options enables addition error checking for high memory systems. + Disable for production systems. + +config DEBUG_BUGVERBOSE + bool "Verbose BUG() reporting (adds 70K)" + depends on DEBUG_KERNEL && (ARM || ARM26 || M68K || SPARC32 || SPARC64) + help + Say Y here to make BUG() panics output the file name and line number + of the BUG call as well as the EIP and oops trace. This aids + debugging but costs about 70-100K of memory. + +config DEBUG_INFO + bool "Compile the kernel with debug info" + depends on DEBUG_KERNEL && (ALPHA || CRIS || X86 || IA64 || M68K || MIPS || PARISC || PPC32 || PPC64 || ARCH_S390 || (SUPERH && !SUPERH64) || SPARC64 || V850 || X86_64) + help + If you say Y here the resulting kernel image will include + debugging info resulting in a larger kernel image. + Say Y here only if you plan to use gdb to debug the kernel. + If you don't debug the kernel, you can say N. + +config DEBUG_INFO + bool "Enable kernel debugging symbols" + depends on DEBUG_KERNEL && USERMODE + help + When this is enabled, the User-Mode Linux binary will include + debugging symbols. This enlarges the binary by a few megabytes, + but aids in tracking down kernel problems in UML. It is required + if you intend to do any kernel development. + + If you're truly short on disk space or don't expect to report any + bugs back to the UML developers, say N, otherwise say Y. + +if !X86_64 +config FRAME_POINTER + bool "Compile the kernel with frame pointers" + depends on X86 || CRIS || M68KNOMMU || PARISC + help + If you say Y here the resulting kernel image will be slightly larger + and slower, but it will give very useful debugging information. + If you don't debug the kernel, you can say N, but we may not be able + to solve problems without frame pointers. +endif diff --git a/lib/Makefile b/lib/Makefile index 295e70bcd223..f80da4580059 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -25,7 +25,7 @@ obj-$(CONFIG_LIBCRC32C) += libcrc32c.o obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/ obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/ -host-progs := gen_crc32table +hostprogs-y := gen_crc32table clean-files := crc32table.h $(obj)/crc32.o: $(obj)/crc32table.h diff --git a/scripts/Makefile b/scripts/Makefile index 81c913c1ee3f..67763eeb8a3e 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -2,14 +2,21 @@ # scripts contains sources for various helper programs used throughout # the kernel for the build process. # --------------------------------------------------------------------------- -# docproc: Preprocess .tmpl file in order to generate .sgml docs +# kallsyms: Find all symbols in vmlinux +# pnmttologo: Convert pnm files to logo files +# conmakehash: Create chartable # conmakehash: Create arrays for initializing the kernel console tables -host-progs := conmakehash kallsyms pnmtologo bin2c -always := $(host-progs) +hostprogs-$(CONFIG_KALLSYMS) += kallsyms +hostprogs-$(CONFIG_LOGO) += pnmtologo +hostprogs-$(CONFIG_VT) += conmakehash +hostprogs-$(CONFIG_PROM_CONSOLE) += conmakehash +hostprogs-$(CONFIG_IKCONFIG) += bin2c -subdir-$(CONFIG_MODVERSIONS) += genksyms -subdir-y += mod +always := $(hostprogs-y) + +subdir-$(CONFIG_MODVERSIONS) += genksyms +subdir-$(CONFIG_MODULES) += mod # Let clean descend into subdirs subdir- += basic lxdialog kconfig package diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 008ac6cfd405..21cb20586b47 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -14,6 +14,18 @@ include $(obj)/Makefile include scripts/Makefile.lib +ifdef host-progs +ifneq ($(hostprogs-y),$(host-progs)) +$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!) +hostprogs-y += $(host-progs) +endif +endif + +# Do not include host rules unles needed +ifneq ($(hostprogs-y)$(hostprogs-m),) +include scripts/Makefile.host +endif + ifneq ($(KBUILD_SRC),) # Create output directory if not already present _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) @@ -71,8 +83,13 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ # Linus' kernel sanity checking tool ifneq ($(KBUILD_CHECKSRC),0) -quiet_cmd_checksrc = CHECK $< - cmd_checksrc = $(CHECK) $(c_flags) $< ; + ifeq ($(KBUILD_CHECKSRC),2) + quiet_cmd_force_checksrc = CHECK $< + cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; + else + quiet_cmd_checksrc = CHECK $< + cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; + endif endif @@ -170,11 +187,13 @@ endef # Built-in and composite module parts %.o: %.c FORCE + $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) # Single-part modules are special since we need to mark them in $(MODVERDIR) $(single-used-m): %.o: %.c FORCE + $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c) @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) @@ -209,6 +228,14 @@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< targets += $(real-objs-y) $(real-objs-m) $(lib-y) targets += $(extra-y) $(MAKECMDGOALS) $(always) +# Linker scripts preprocessor (.lds.S -> .lds) +# --------------------------------------------------------------------------- +quiet_cmd_cpp_lds_S = LDS $@ + cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< + +%.lds: %.lds.S FORCE + $(call if_changed_dep,cpp_lds_S) + # Build the compiled-in targets # --------------------------------------------------------------------------- @@ -275,90 +302,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE targets += $(multi-used-y) $(multi-used-m) -# Compile programs on the host -# =========================================================================== -# host-progs := bin2hex -# Will compile bin2hex.c and create an executable named bin2hex -# -# host-progs := lxdialog -# lxdialog-objs := checklist.o lxdialog.o -# Will compile lxdialog.c and checklist.c, and then link the executable -# lxdialog, based on checklist.o and lxdialog.o -# -# host-progs := qconf -# qconf-cxxobjs := qconf.o -# qconf-objs := menu.o -# Will compile qconf as a C++ program, and menu as a C program. -# They are linked as C++ code to the executable qconf - -# host-progs := conf -# conf-objs := conf.o libkconfig.so -# libkconfig-objs := expr.o type.o -# Will create a shared library named libkconfig.so that consist of -# expr.o and type.o (they are both compiled as C code and the object file -# are made as position independent code). -# conf.c is compiled as a c program, and conf.o is linked together with -# libkconfig.so as the executable conf. -# Note: Shared libraries consisting of C++ files are not supported -# - -# Create executable from a single .c file -# host-csingle -> Executable -quiet_cmd_host-csingle = HOSTCC $@ - cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $< -$(host-csingle): %: %.c FORCE - $(call if_changed_dep,host-csingle) - -# Link an executable based on list of .o files, all plain c -# host-cmulti -> executable -quiet_cmd_host-cmulti = HOSTLD $@ - cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ - $(addprefix $(obj)/,$($(@F)-objs)) \ - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE - $(call if_changed,host-cmulti) - -# Create .o file from a single .c file -# host-cobjs -> .o -quiet_cmd_host-cobjs = HOSTCC $@ - cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $< -$(host-cobjs): %.o: %.c FORCE - $(call if_changed_dep,host-cobjs) - -# Link an executable based on list of .o files, a mixture of .c and .cc -# host-cxxmulti -> executable -quiet_cmd_host-cxxmulti = HOSTLD $@ - cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ - $(foreach o,objs cxxobjs,\ - $(addprefix $(obj)/,$($(@F)-$(o)))) \ - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE - $(call if_changed,host-cxxmulti) - -# Create .o file from a single .cc (C++) file -quiet_cmd_host-cxxobjs = HOSTCXX $@ - cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $< -$(host-cxxobjs): %.o: %.cc FORCE - $(call if_changed_dep,host-cxxobjs) - -# Compile .c file, create position independent .o file -# host-cshobjs -> .o -quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ - cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $< -$(host-cshobjs): %.o: %.c FORCE - $(call if_changed_dep,host-cshobjs) - -# Link a shared library, based on position independent .o files -# *.o -> .so shared library (host-cshlib) -quiet_cmd_host-cshlib = HOSTLLD -shared $@ - cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ - $(addprefix $(obj)/,$($(@F:.so=-objs))) \ - $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) -$(host-cshlib): %: $(host-cshobjs) FORCE - $(call if_changed,host-cshlib) - -targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ - $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) # Descending # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 7277dd208ead..b02ab1fb28e3 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -29,21 +29,49 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) # Add subdir path subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) -__clean-files := $(wildcard $(addprefix $(obj)/, \ - $(extra-y) $(EXTRA_TARGETS) $(always) $(host-progs) \ - $(targets) $(clean-files))) + +# build a list of files to remove, usually releative to the current +# directory + +__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) \ + $(targets) $(clean-files) \ + $(host-progs) \ + $(hostprogs-y) $(hostprogs-m) $(hostprogs-) + +# as clean-files is given relative to the current directory, this adds +# a $(obj) prefix, except for absolute paths + +__clean-files := $(wildcard \ + $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \ + $(filter /%, $(__clean-files))) + +# as clean-dirs is given relative to the current directory, this adds +# a $(obj) prefix, except for absolute paths + +__clean-dirs := $(wildcard \ + $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \ + $(filter /%, $(clean-dirs))) # ========================================================================== -quiet_cmd_clean = CLEAN $(obj) - cmd_clean = rm -f $(__clean-files); $(clean-rule) +quiet_cmd_clean = CLEAN $(obj) + cmd_clean = rm -f $(__clean-files) +quiet_cmd_cleandir = CLEAN $(__clean-dirs) + cmd_cleandir = rm -rf $(__clean-dirs) + __clean: $(subdir-ymn) -ifneq ($(strip $(__clean-files) $(clean-rule)),) +ifneq ($(strip $(__clean-files)),) +$(call cmd,clean) -else - @: endif +ifneq ($(strip $(__clean-dirs)),) + +$(call cmd,cleandir) +endif +ifneq ($(strip $(clean-rule)),) + +$(clean-rule) +endif + @: + # =========================================================================== # Generic stuff diff --git a/scripts/Makefile.host b/scripts/Makefile.host new file mode 100644 index 000000000000..0a5d8cafa135 --- /dev/null +++ b/scripts/Makefile.host @@ -0,0 +1,154 @@ +# ========================================================================== +# Building binaries on the host system +# Binaries are used during the compilation of the kernel, for example +# to preprocess a data file. +# +# Both C and C++ is supported, but preferred language is C for such utilities. +# +# Samle syntax (see Documentation/kbuild/makefile.txt for reference) +# hostprogs-y := bin2hex +# Will compile bin2hex.c and create an executable named bin2hex +# +# hostprogs-y := lxdialog +# lxdialog-objs := checklist.o lxdialog.o +# Will compile lxdialog.c and checklist.c, and then link the executable +# lxdialog, based on checklist.o and lxdialog.o +# +# hostprogs-y := qconf +# qconf-cxxobjs := qconf.o +# qconf-objs := menu.o +# Will compile qconf as a C++ program, and menu as a C program. +# They are linked as C++ code to the executable qconf + +# hostprogs-y := conf +# conf-objs := conf.o libkconfig.so +# libkconfig-objs := expr.o type.o +# Will create a shared library named libkconfig.so that consist of +# expr.o and type.o (they are both compiled as C code and the object file +# are made as position independent code). +# conf.c is compiled as a c program, and conf.o is linked together with +# libkconfig.so as the executable conf. +# Note: Shared libraries consisting of C++ files are not supported + +__hostprogs := $(sort $(hostprogs-y)$(hostprogs-m)) + +# hostprogs-y := tools/build may have been specified. Retreive directory +obj-dirs += $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) +obj-dirs := $(strip $(sort $(filter-out ./,$(obj-dirs)))) + + +# C code +# Executables compiled from a single .c file +host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) + +# C executables linked based on several .o files +host-cmulti := $(foreach m,$(__hostprogs),\ + $(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m)))) + +# Object (.o) files compiled from .c files +host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs))) + +# C++ code +# C++ executables compiled from at least on .cc file +# and zero or more .c files +host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m))) + +# C++ Object (.o) files compiled from .cc files +host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) + +# Shared libaries (only .c supported) +# Shared libraries (.so) - all .so files referenced in "xxx-objs" +host-cshlib := $(sort $(filter %.so, $(host-cobjs))) +# Remove .so files from "xxx-objs" +host-cobjs := $(filter-out %.so,$(host-cobjs)) + +#Object (.o) files used by the shared libaries +host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) + +__hostprogs := $(addprefix $(obj)/,$(__hostprogs)) +host-csingle := $(addprefix $(obj)/,$(host-csingle)) +host-cmulti := $(addprefix $(obj)/,$(host-cmulti)) +host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) +host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti)) +host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) +host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) +host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) + +##### +# Handle options to gcc. Support building with separate output directory + +_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) +_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) + +ifeq ($(KBUILD_SRC),) +__hostc_flags = $(_hostc_flags) +__hostcxx_flags = $(_hostcxx_flags) +else +__hostc_flags = -I$(obj) $(call flags,_hostc_flags) +__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) +endif + +hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) +hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) + +##### +# Compile programs on the host + +# Create executable from a single .c file +# host-csingle -> Executable +quiet_cmd_host-csingle = HOSTCC $@ + cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $< +$(host-csingle): %: %.c FORCE + $(call if_changed_dep,host-csingle) + +# Link an executable based on list of .o files, all plain c +# host-cmulti -> executable +quiet_cmd_host-cmulti = HOSTLD $@ + cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ + $(addprefix $(obj)/,$($(@F)-objs)) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) +$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE + $(call if_changed,host-cmulti) + +# Create .o file from a single .c file +# host-cobjs -> .o +quiet_cmd_host-cobjs = HOSTCC $@ + cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $< +$(host-cobjs): %.o: %.c FORCE + $(call if_changed_dep,host-cobjs) + +# Link an executable based on list of .o files, a mixture of .c and .cc +# host-cxxmulti -> executable +quiet_cmd_host-cxxmulti = HOSTLD $@ + cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ + $(foreach o,objs cxxobjs,\ + $(addprefix $(obj)/,$($(@F)-$(o)))) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) +$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE + $(call if_changed,host-cxxmulti) + +# Create .o file from a single .cc (C++) file +quiet_cmd_host-cxxobjs = HOSTCXX $@ + cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $< +$(host-cxxobjs): %.o: %.cc FORCE + $(call if_changed_dep,host-cxxobjs) + +# Compile .c file, create position independent .o file +# host-cshobjs -> .o +quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ + cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $< +$(host-cshobjs): %.o: %.c FORCE + $(call if_changed_dep,host-cshobjs) + +# Link a shared library, based on position independent .o files +# *.o -> .so shared library (host-cshlib) +quiet_cmd_host-cshlib = HOSTLLD -shared $@ + cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ + $(addprefix $(obj)/,$($(@F:.so=-objs))) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) +$(host-cshlib): %: $(host-cshobjs) FORCE + $(call if_changed,host-cshlib) + +targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ + $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) + diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index a47abc8af0a6..3a7663b901f0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -60,41 +60,11 @@ subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o) # $(obj-dirs) is a list of directories that contain object files obj-dirs := $(dir $(multi-objs) $(subdir-obj-y)) -obj-dirs += $(foreach f,$(host-progs), $(if $(dir $(f)),$(dir $(f)))) -obj-dirs := $(strip $(sort $(filter-out ./,$(obj-dirs)))) # Replace multi-part objects by their individual parts, look at local dir only real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) -# C code -# Executables compiled from a single .c file -host-csingle := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m))) - -# C executables linked based on several .o files -host-cmulti := $(foreach m,$(host-progs),\ - $(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m)))) - -# Object (.o) files compiled from .c files -host-cobjs := $(sort $(foreach m,$(host-progs),$($(m)-objs))) - -# C++ code -# C++ executables compiled from at least on .cc file -# and zero or more .c files -host-cxxmulti := $(foreach m,$(host-progs),$(if $($(m)-cxxobjs),$(m))) - -# C++ Object (.o) files compiled from .cc files -host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) - -# Shared libaries (only .c supported) -# Shared libraries (.so) - all .so files referenced in "xxx-objs" -host-cshlib := $(sort $(filter %.so, $(host-cobjs))) -# Remove .so files from "xxx-objs" -host-cobjs := $(filter-out %.so,$(host-cobjs)) - -#Object (.o) files used by the shared libaries -host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) - # Add subdir path extra-y := $(addprefix $(obj)/,$(extra-y)) @@ -113,14 +83,6 @@ multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) -host-progs := $(addprefix $(obj)/,$(host-progs)) -host-csingle := $(addprefix $(obj)/,$(host-csingle)) -host-cmulti := $(addprefix $(obj)/,$(host-cmulti)) -host-cobjs := $(addprefix $(obj)/,$(host-cobjs)) -host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti)) -host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) -host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) -host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) # The temporary file to save gcc -MD generated dependencies must not # contain a comma @@ -136,12 +98,9 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d) basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))) - _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) -_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) -_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) - +_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) # If building the kernel in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). @@ -149,8 +108,7 @@ _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) ifeq ($(KBUILD_SRC),) __c_flags = $(_c_flags) __a_flags = $(_a_flags) -__hostc_flags = $(_hostc_flags) -__hostcxx_flags = $(_hostcxx_flags) +__cpp_flags = $(_cpp_flags) else # Prefix -I with $(srctree) if it is not an absolute path @@ -164,8 +122,7 @@ flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) # FIXME: Replace both with specific CFLAGS* statements in the makefiles __c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) __a_flags = $(call flags,_a_flags) -__hostc_flags = -I$(obj) $(call flags,_hostc_flags) -__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) +__cpp_flags = $(call flags,_cpp_flags) endif c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ @@ -175,8 +132,7 @@ c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(__a_flags) $(modkern_aflags) -hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) -hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) +cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 19f5345279ac..c5d201f660c9 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -50,7 +50,8 @@ _modpost: $(modules) # Step 2), invoke modpost # Includes step 3,4 quiet_cmd_modpost = MODPOST - cmd_modpost = scripts/mod/modpost \ + cmd_modpost = scripts/mod/modpost \ + $(if $(CONFIG_MODVERSIONS),-m) \ $(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \ $(filter-out FORCE,$^) diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile index 3afb3bf4d12c..f22e94c3a2d1 100644 --- a/scripts/basic/Makefile +++ b/scripts/basic/Makefile @@ -11,8 +11,8 @@ # include/config/... # docproc: Used in Documentation/docbook -host-progs := fixdep split-include docproc -always := $(host-progs) +hostprogs-y := fixdep split-include docproc +always := $(hostprogs-y) # fixdep is needed to compile other host programs $(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8bd6442229cf..9c03a6673aad 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -104,7 +104,7 @@ #include <stdio.h> #include <limits.h> #include <ctype.h> -#include <netinet/in.h> +#include <arpa/inet.h> #define INT_CONF ntohl(0x434f4e46) #define INT_ONFI ntohl(0x4f4e4649) diff --git a/scripts/binoffset.c b/scripts/binoffset.c index 7b8100d8e106..591309d85518 100644 --- a/scripts/binoffset.c +++ b/scripts/binoffset.c @@ -41,7 +41,7 @@ char *progname; char *inputname; int inputfd; -int bix; /* buf index */ +unsigned int bix; /* buf index */ unsigned char patterns [PAT_SIZE] = {0}; /* byte-sized pattern array */ int pat_len; /* actual number of pattern bytes */ unsigned char *madr; /* mmap address */ @@ -58,7 +58,7 @@ void usage (void) exit (1); } -int get_pattern (int pat_count, char *pats []) +void get_pattern (int pat_count, char *pats []) { int ix, err, tmp; @@ -81,7 +81,7 @@ int get_pattern (int pat_count, char *pats []) pat_len = pat_count; } -int search_pattern (void) +void search_pattern (void) { for (bix = 0; bix < filesize; bix++) { if (madr[bix] == patterns[0]) { @@ -109,7 +109,7 @@ size_t get_filesize (int fd) struct stat stat; err = fstat (fd, &stat); - fprintf (stderr, "filesize: %d\n", err < 0 ? err : stat.st_size); + fprintf (stderr, "filesize: %ld\n", err < 0 ? (long)err : stat.st_size); if (err < 0) return err; return (size_t) stat.st_size; @@ -154,8 +154,8 @@ int main (int argc, char *argv []) fprintf (stderr, "number of pattern matches = %d\n", num_matches); if (num_matches == 0) firstloc = ~0; - printf ("%d\n", firstloc); - fprintf (stderr, "%d\n", firstloc); + printf ("%ld\n", firstloc); + fprintf (stderr, "%ld\n", firstloc); exit (num_matches ? 0 : 2); } diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index 76f1fd10e16f..5875f29a8602 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile @@ -1,6 +1,6 @@ -host-progs := genksyms -always := $(host-progs) +hostprogs-y := genksyms +always := $(hostprogs-y) genksyms-objs := genksyms.o parse.o lex.o diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 89b986abd753..6377641dd599 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -67,7 +67,7 @@ help: libkconfig-objs := zconf.tab.o -host-progs := conf mconf qconf gconf +hostprogs-y := conf mconf qconf gconf conf-objs := conf.o libkconfig.so mconf-objs := mconf.o libkconfig.so diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 90247d2e88ce..7b6285e7c8f9 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <unistd.h> #define LKC_DIRECT_LINK @@ -268,6 +269,7 @@ int conf_write(const char *name) char dirname[128], tmpname[128], newname[128]; int type, l; const char *str; + time_t now; dirname[0] = 0; if (name && name[0]) { @@ -301,14 +303,25 @@ int conf_write(const char *name) if (!out_h) return 1; } + sym = sym_lookup("KERNELRELEASE", 0); + sym_calc_value(sym); + time(&now); fprintf(out, "#\n" "# Automatically generated make config: don't edit\n" - "#\n"); + "# Linux kernel version: %s\n" + "# %s" + "#\n", + sym_get_string_value(sym), + ctime(&now)); if (out_h) fprintf(out_h, "/*\n" " * Automatically generated C config: don't edit\n" + " * Linux kernel version: %s\n" + " * %s" " */\n" - "#define AUTOCONF_INCLUDED\n"); + "#define AUTOCONF_INCLUDED\n", + sym_get_string_value(sym), + ctime(&now)); if (!sym_change_count) sym_clear_all_valid(); diff --git a/scripts/lxdialog/Makefile b/scripts/lxdialog/Makefile index 2f22b2f69d8c..cdc4024a8830 100644 --- a/scripts/lxdialog/Makefile +++ b/scripts/lxdialog/Makefile @@ -15,8 +15,8 @@ endif endif endif -host-progs := lxdialog -always := ncurses $(host-progs) +hostprogs-y := lxdialog +always := ncurses $(hostprogs-y) lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ util.o lxdialog.o msgbox.o diff --git a/scripts/mksysmap b/scripts/mksysmap new file mode 100644 index 000000000000..2904d3b383ed --- /dev/null +++ b/scripts/mksysmap @@ -0,0 +1,44 @@ +#!/bin/sh -x +# Based on the vmlinux file create the System.map file +# System.map is used by module-init tools and some debugging +# tools to retreive the actual addresses of symbols in the kernel. +# +# Usage +# mksysmap vmlinux System.map + + +##### +# Generate System.map (actual filename passed as second argument) + +# $NM produces the following output: +# f0081e80 T alloc_vfsmnt + +# The second row specify the type of the symbol: +# A = Absolute +# B = Uninitialised data (.bss) +# C = Comon symbol +# D = Initialised data +# G = Initialised data for small objects +# I = Indirect reference to another symbol +# N = Debugging symbol +# R = Read only +# S = Uninitialised data for small objects +# T = Text code symbol +# U = Undefined symbol +# V = Weak symbol +# W = Weak symbol +# Corresponding small letters are local symbols + +# For System.map filter away: +# a - local absolute symbols +# U - undefined global symbols +# w - local weak symbols + +# readprofile starts reading symbols when _stext is found, and +# continue until it finds a symbol which is not either of 'T', 't', +# 'W' or 'w'. __crc_ are 'A' and placed in the middle +# so we just ignore them to let readprofile continue to work. +# (At least sparc64 has __crc_ in the middle). + +$NM -n $1 | grep -v '\( [aUw] \)\|\(__crc_\)' > $2 + diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index f66bf5262aae..11d69c35e5b4 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,5 +1,5 @@ -host-progs := modpost mk_elfconfig -always := $(host-progs) empty.o +hostprogs-y := modpost mk_elfconfig +always := $(hostprogs-y) empty.o modpost-objs := modpost.o file2alias.o sumversion.o diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 662e75b2f780..65072d76a101 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -343,7 +343,6 @@ handle_modversions(struct module *mod, struct elf_info *info, crc = (unsigned int) sym->st_value; add_exported_symbol(symname + strlen(CRC_PFX), mod, &crc); - modversions = 1; } break; case SHN_UNDEF: @@ -649,7 +648,6 @@ read_dump(const char *fname) if (!(mod = find_module(modname))) { if (is_vmlinux(modname)) { - modversions = 1; have_vmlinux = 1; } mod = new_module(NOFAIL(strdup(modname))); @@ -696,11 +694,14 @@ main(int argc, char **argv) char *dump_read = NULL, *dump_write = NULL; int opt; - while ((opt = getopt(argc, argv, "i:o:")) != -1) { + while ((opt = getopt(argc, argv, "i:mo:")) != -1) { switch(opt) { case 'i': dump_read = optarg; break; + case 'm': + modversions = 1; + break; case 'o': dump_write = optarg; break; diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index b41b718edffe..631430d09e4d 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -1,4 +1,4 @@ -#include <netinet/in.h> +#include <arpa/inet.h> #include <stdint.h> #include <ctype.h> #include <errno.h> diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 48f89e17a3cf..3b1f2eff2584 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -51,7 +51,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec $(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz rm ../$(KERNELPATH).tar.gz -clean-rule += rm -f $(objtree)/kernel.spec +clean-files := $(objtree)/kernel.spec # binrpm-pkg .PHONY: binrpm-pkg @@ -67,7 +67,7 @@ binrpm-pkg: $(objtree)/binkernel.spec $(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $< -clean-rule += rm -f $(objtree)/binkernel.spec +clean-files += $(objtree)/binkernel.spec # Deb target # --------------------------------------------------------------------------- @@ -77,7 +77,7 @@ deb-pkg: $(MAKE) $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb -clean-rule += && rm -rf $(objtree)/debian/ +clean-dirs += $(objtree)/debian/ # Help text displayed when executing 'make help' diff --git a/scripts/patch-kernel b/scripts/patch-kernel index 3f316b6c4d9c..43af01075612 100755 --- a/scripts/patch-kernel +++ b/scripts/patch-kernel @@ -40,17 +40,24 @@ # # Added -ac option, use -ac or -ac9 (say) to stop at a particular version # Dave Gilbert <linux@treblig.org>, 29th September 2001. +# +# Add support for (use of) EXTRAVERSION (to support 2.6.8.x, e.g.); +# update usage message; +# fix some whitespace damage; +# be smarter about stopping when current version is larger than requested; +# Randy Dunlap <rddunlap@osdl.org>, 2004-AUG-18. # Set directories from arguments, or use defaults. sourcedir=${1-/usr/src/linux} patchdir=${2-.} -stopvers=${3-imnotaversion} +stopvers=${3-default} -if [ "$1" = -h -o "$1" = --help -o ! -r "$sourcedir/Makefile" ]; then +if [ "$1" == -h -o "$1" == --help -o ! -r "$sourcedir/Makefile" ]; then cat << USAGE usage: patch-kernel [-h] [ sourcedir [ patchdir [ stopversion ] [ -acxx ] ] ] - The source directory defaults to /usr/src/linux, and - the patch directory defaults to the current directory. + source directory defaults to /usr/src/linux, + patch directory defaults to the current directory, + stopversion defaults to <all in patchdir>. USAGE exit 1 fi @@ -77,7 +84,7 @@ findFile () { uncomp="gunzip -dc" elif [ -r ${filebase}.bz ]; then ext=".bz" - name="bzip" + name="bzip" uncomp="bunzip -dc" elif [ -r ${filebase}.bz2 ]; then ext=".bz2" @@ -96,8 +103,8 @@ findFile () { name="plaintext" uncomp="cat" else - return 1; - fi + return 1; + fi return 0; } @@ -126,48 +133,100 @@ applyPatch () { return 0; } -# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTERVERSION -eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $sourcedir/Makefile` +# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION +TMPFILE=`mktemp .tmpver.XXXXXX` || { echo "cannot make temp file" ; exit 1; } +grep -E "^(VERSION|PATCHLEVEL|SUBLEVEL|EXTRAVERSION)" $sourcedir/Makefile > $TMPFILE +tr -d [:blank:] < $TMPFILE > $TMPFILE.1 +source $TMPFILE.1 +rm -f $TMPFILE* if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ] then echo "unable to determine current kernel version" >&2 exit 1 fi -echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}" +NAME=`grep ^NAME $sourcedir/Makefile` +NAME=${NAME##*=} +echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} ($NAME)" + +# strip EXTRAVERSION to just a number (drop leading '.' and trailing additions) +EXTRAVER= if [ x$EXTRAVERSION != "x" ] then - echo "I'm sorry but patch-kernel can't work with a kernel source tree that is not a base version" - exit 1; + if [ ${EXTRAVERSION:0:1} == "." ]; then + EXTRAVER=${EXTRAVERSION:1} + else + EXTRAVER=$EXTRAVERSION + fi + EXTRAVER=${EXTRAVER%%[[:punct:]]*} + #echo "patch-kernel: changing EXTRAVERSION from $EXTRAVERSION to $EXTRAVER" +fi + +#echo "stopvers=$stopvers" +if [ $stopvers != "default" ]; then + STOPSUBLEVEL=`echo $stopvers | cut -d. -f3` + STOPEXTRA=`echo $stopvers | cut -d. -f4` + #echo "STOPSUBLEVEL=$STOPSUBLEVEL, STOPEXTRA=$STOPEXTRA" +else + STOPSUBLEVEL=9999 + STOPEXTRA=9999 fi -while : +while : # incrementing SUBLEVEL (s in v.p.s) do - CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" - if [ $stopvers = $CURRENTFULLVERSION ] - then - echo "Stoping at $CURRENTFULLVERSION base as requested." + if [ x$EXTRAVER != "x" ]; then + CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL.$EXTRAVER" + else + CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" + fi + + if [ $stopvers == $CURRENTFULLVERSION ]; then + echo "Stopping at $CURRENTFULLVERSION base as requested." break fi - SUBLEVEL=`expr $SUBLEVEL + 1` + while : # incrementing EXTRAVER (x in v.p.s.x) + do + EXTRAVER=$((EXTRAVER + 1)) + FULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL.$EXTRAVER" + #echo "... trying $FULLVERSION ..." + + patch=patch-$FULLVERSION + + # See if the file exists and find extension + findFile $patchdir/${patch} || break + + # Apply the patch and check all is OK + applyPatch $patch || break + + continue 2 + done + + EXTRAVER= + SUBLEVEL=$((SUBLEVEL + 1)) FULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" + #echo "___ trying $FULLVERSION ___" + + if [ $((SUBLEVEL)) -gt $((STOPSUBLEVEL)) ]; then + echo "Stopping since sublevel ($SUBLEVEL) is beyond stop-sublevel ($STOPSUBLEVEL)" + exit 1 + fi patch=patch-$FULLVERSION - # See if the file exists and find extension - findFile $patchdir/${patch} || break + # See if the file exists and find extension + findFile $patchdir/${patch} || break # Apply the patch and check all is OK applyPatch $patch || break done +#echo "base all done" if [ x$gotac != x ]; then # Out great user wants the -ac patches # They could have done -ac (get latest) or -acxx where xx=version they want - if [ $gotac == "-ac" ] - then + if [ $gotac == "-ac" ]; then # They want the latest version HIGHESTPATCH=0 for PATCHNAMES in $patchdir/patch-${CURRENTFULLVERSION}-ac*\.* @@ -176,18 +235,16 @@ if [ x$gotac != x ]; then # Check it is actually a recognised patch type findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${ACVALUE} || break - if [ $ACVALUE -gt $HIGHESTPATCH ] - then + if [ $ACVALUE -gt $HIGHESTPATCH ]; then HIGHESTPATCH=$ACVALUE fi done - if [ $HIGHESTPATCH -ne 0 ] - then + if [ $HIGHESTPATCH -ne 0 ]; then findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH} || break applyPatch patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH} else - echo "No ac patches found" + echo "No -ac patches found" fi else # They want an exact version @@ -198,5 +255,3 @@ if [ x$gotac != x ]; then applyPatch patch-${CURRENTFULLVERSION}${gotac} fi fi - - diff --git a/sound/oss/Makefile b/sound/oss/Makefile index 6fc30dc7fe27..226b395bbe4c 100644 --- a/sound/oss/Makefile +++ b/sound/oss/Makefile @@ -103,7 +103,7 @@ sb_lib-objs := sb_common.o sb_audio.o sb_midi.o sb_mixer.o sb_ess.o vidc_mod-objs := vidc.o vidc_fill.o wavefront-objs := wavfront.o wf_midi.o yss225.o -host-progs := bin2hex hex2hex +hostprogs-y := bin2hex hex2hex # Files generated that shall be removed upon make clean clean-files := maui_boot.h msndperm.c msndinit.c pndsperm.c pndspini.c \ diff --git a/usr/Makefile b/usr/Makefile index fe62659ff483..965759fc16ad 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -1,7 +1,7 @@ obj-y := initramfs_data.o -host-progs := gen_init_cpio +hostprogs-y := gen_init_cpio clean-files := initramfs_data.cpio.gz |
