Commit a8c1914f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-sam.bkbits.net/kbuild

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents c3adda81 a2c665b0
...@@ -185,9 +185,7 @@ clean-files := $(DOCBOOKS) \ ...@@ -185,9 +185,7 @@ clean-files := $(DOCBOOKS) \
$(patsubst %.sgml, %.9, $(DOCBOOKS)) \ $(patsubst %.sgml, %.9, $(DOCBOOKS)) \
$(C-procfs-example) $(C-procfs-example)
ifneq ($(wildcard $(patsubst %.html,%,$(HTML))),) clean-dirs := $(patsubst %.sgml,%,$(DOCBOOKS))
clean-rule := rm -rf $(wildcard $(patsubst %.html,%,$(HTML)))
endif
#man put files in man subdir - traverse down #man put files in man subdir - traverse down
subdir- := man/ subdir- := man/
...@@ -25,6 +25,7 @@ This document describes the Linux kernel Makefiles. ...@@ -25,6 +25,7 @@ This document describes the Linux kernel Makefiles.
--- 4.4 Using C++ for host programs --- 4.4 Using C++ for host programs
--- 4.5 Controlling compiler options for host programs --- 4.5 Controlling compiler options for host programs
--- 4.6 When host programs are actually built --- 4.6 When host programs are actually built
--- 4.7 Using hostprogs-$(CONFIG_FOO)
=== 5 Kbuild clean infrastructure === 5 Kbuild clean infrastructure
...@@ -36,6 +37,8 @@ This document describes the Linux kernel Makefiles. ...@@ -36,6 +37,8 @@ This document describes the Linux kernel Makefiles.
--- 6.5 Building non-kbuild targets --- 6.5 Building non-kbuild targets
--- 6.6 Commands useful for building a boot image --- 6.6 Commands useful for building a boot image
--- 6.7 Custom kbuild commands --- 6.7 Custom kbuild commands
--- 6.8 Preprocessing linker scripts
--- 6.9 $(CC) support functions
=== 7 Kbuild Variables === 7 Kbuild Variables
=== 8 Makefile language === 8 Makefile language
...@@ -387,7 +390,7 @@ compilation stage. ...@@ -387,7 +390,7 @@ compilation stage.
Two steps are required in order to use a host executable. 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 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. 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, 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. ...@@ -402,7 +405,7 @@ Both possibilities are described in the following.
built on the build host. built on the build host.
Example: Example:
host-progs := bin2hex hostprogs-y := bin2hex
Kbuild assumes in the above example that bin2hex is made from a single 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 c-source file named bin2hex.c located in the same directory as
...@@ -418,7 +421,7 @@ Both possibilities are described in the following. ...@@ -418,7 +421,7 @@ Both possibilities are described in the following.
Example: Example:
#scripts/lxdialog/Makefile #scripts/lxdialog/Makefile
host-progs := lxdialog hostprogs-y := lxdialog
lxdialog-objs := checklist.o lxdialog.o lxdialog-objs := checklist.o lxdialog.o
Objects with extension .o are compiled from the corresponding .c Objects with extension .o are compiled from the corresponding .c
...@@ -438,7 +441,7 @@ Both possibilities are described in the following. ...@@ -438,7 +441,7 @@ Both possibilities are described in the following.
Example: Example:
#scripts/kconfig/Makefile #scripts/kconfig/Makefile
host-progs := conf hostprogs-y := conf
conf-objs := conf.o libkconfig.so conf-objs := conf.o libkconfig.so
libkconfig-objs := expr.o type.o libkconfig-objs := expr.o type.o
...@@ -457,7 +460,7 @@ Both possibilities are described in the following. ...@@ -457,7 +460,7 @@ Both possibilities are described in the following.
Example: Example:
#scripts/kconfig/Makefile #scripts/kconfig/Makefile
host-progs := qconf hostprogs-y := qconf
qconf-cxxobjs := qconf.o qconf-cxxobjs := qconf.o
In the example above the executable is composed of the C++ file In the example above the executable is composed of the C++ file
...@@ -468,7 +471,7 @@ Both possibilities are described in the following. ...@@ -468,7 +471,7 @@ Both possibilities are described in the following.
Example: Example:
#scripts/kconfig/Makefile #scripts/kconfig/Makefile
host-progs := qconf hostprogs-y := qconf
qconf-cxxobjs := qconf.o qconf-cxxobjs := qconf.o
qconf-objs := check.o qconf-objs := check.o
...@@ -509,7 +512,7 @@ Both possibilities are described in the following. ...@@ -509,7 +512,7 @@ Both possibilities are described in the following.
Example: Example:
#drivers/pci/Makefile #drivers/pci/Makefile
host-progs := gen-devlist hostprogs-y := gen-devlist
$(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist
( cd $(obj); ./gen-devlist ) < $< ( cd $(obj); ./gen-devlist ) < $<
...@@ -524,18 +527,32 @@ Both possibilities are described in the following. ...@@ -524,18 +527,32 @@ Both possibilities are described in the following.
Example: Example:
#scripts/lxdialog/Makefile #scripts/lxdialog/Makefile
host-progs := lxdialog hostprogs-y := lxdialog
always := $(host-progs) always := $(hostprogs-y)
This will tell kbuild to build lxdialog even if not referenced in This will tell kbuild to build lxdialog even if not referenced in
any rule. 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 === 5 Kbuild clean infrastructure
"make clean" deletes most generated files in the src tree where the kernel "make clean" deletes most generated files in the src tree where the kernel
is compiled. This includes generated files such as host programs. is compiled. This includes generated files such as host programs.
Kbuild knows targets listed in $(host-progs), $(always), $(extra-y) and Kbuild knows targets listed in $(hostprogs-y), $(hostprogs-m), $(always),
$(targets). They are all deleted during "make clean". $(extra-y) and $(targets). They are all deleted during "make clean".
Files matching the patterns "*.[oas]", "*.ko", plus some additional files Files matching the patterns "*.[oas]", "*.ko", plus some additional files
generated by kbuild are deleted all over the kernel src tree when generated by kbuild are deleted all over the kernel src tree when
"make clean" is executed. "make clean" is executed.
...@@ -547,8 +564,17 @@ Additional files can be specified in kbuild makefiles by use of $(clean-files). ...@@ -547,8 +564,17 @@ Additional files can be specified in kbuild makefiles by use of $(clean-files).
clean-files := devlist.h classlist.h clean-files := devlist.h classlist.h
When executing "make clean", the two files "devlist.h classlist.h" will When executing "make clean", the two files "devlist.h classlist.h" will
be deleted. Kbuild knows that files specified by $(clean-files) are be deleted. Kbuild will assume files to be in same relative directory as the
located in the same directory as the makefile. 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/", Usually kbuild descends down in subdirectories due to "obj-* := dir/",
but in the architecture makefiles where the kbuild infrastructure but in the architecture makefiles where the kbuild infrastructure
...@@ -914,6 +940,90 @@ When kbuild executes the following steps are followed (roughly): ...@@ -914,6 +940,90 @@ When kbuild executes the following steps are followed (roughly):
will be displayed with "make KBUILD_VERBOSE=0". 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 === 7 Kbuild Variables
The top Makefile exports the following variables: The top Makefile exports the following variables:
......
...@@ -102,7 +102,7 @@ ifneq ($(KBUILD_OUTPUT),) ...@@ -102,7 +102,7 @@ ifneq ($(KBUILD_OUTPUT),)
# check that the output directory actually exists # check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT) saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(wildcard $(KBUILD_OUTPUT)),, \ $(if $(KBUILD_OUTPUT),, \
$(error output directory "$(saved-output)" does not exist)) $(error output directory "$(saved-output)" does not exist))
.PHONY: $(MAKECMDGOALS) .PHONY: $(MAKECMDGOALS)
...@@ -256,9 +256,32 @@ ifneq ($(findstring s,$(MAKEFLAGS)),) ...@@ -256,9 +256,32 @@ ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet=silent_ quiet=silent_
endif 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 # Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir=$(srctree) MAKEFLAGS += --include-dir=$(srctree)
...@@ -285,6 +308,7 @@ DEPMOD = /sbin/depmod ...@@ -285,6 +308,7 @@ DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms KALLSYMS = scripts/kallsyms
PERL = perl PERL = perl
CHECK = sparse CHECK = sparse
CHECKFLAGS :=
MODFLAGS = -DMODULE MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS) CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS)
...@@ -294,9 +318,13 @@ AFLAGS_KERNEL = ...@@ -294,9 +318,13 @@ AFLAGS_KERNEL =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude \ # 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) $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ AFLAGS := -D__ASSEMBLY__
...@@ -304,9 +332,9 @@ AFLAGS := -D__ASSEMBLY__ ...@@ -304,9 +332,9 @@ AFLAGS := -D__ASSEMBLY__
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ 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 CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
...@@ -458,7 +486,7 @@ CFLAGS += -g ...@@ -458,7 +486,7 @@ CFLAGS += -g
endif endif
# warn about C99 declaration after statement # 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 # INSTALL_PATH specifies where to place the updated kernel and system map
...@@ -506,7 +534,6 @@ libs-y := $(libs-y1) $(libs-y2) ...@@ -506,7 +534,6 @@ libs-y := $(libs-y1) $(libs-y2)
# normal descending-into-subdirs phase, since at that time # normal descending-into-subdirs phase, since at that time
# we cannot yet know if we will need to relink vmlinux. # we cannot yet know if we will need to relink vmlinux.
# So we descend into init/ inside the rule for vmlinux again. # 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) vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y)
quiet_cmd_vmlinux__ = LD $@ quiet_cmd_vmlinux__ = LD $@
...@@ -538,9 +565,10 @@ define rule_vmlinux__ ...@@ -538,9 +565,10 @@ define rule_vmlinux__
echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
endef endef
do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) quiet_cmd_sysmap = SYSMAP
cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds
# Generate section listing all symbols and add it into vmlinux # Generate section listing all symbols and add it into vmlinux
# It's a three stage process: # It's a three stage process:
...@@ -570,8 +598,10 @@ endif ...@@ -570,8 +598,10 @@ endif
kallsyms.o := .tmp_kallsyms$(last_kallsyms).o kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
define rule_verify_kallsyms define rule_verify_kallsyms
@$(call do_system_map, .tmp_vmlinux$(last_kallsyms), .tmp_System.map) $(Q)$(if $($(quiet)cmd_sysmap), \
@cmp -s System.map .tmp_System.map || \ 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) (echo Inconsistent kallsyms data, try setting CONFIG_KALLSYMS_EXTRA_PASS ; rm .tmp_kallsyms* ; false)
endef endef
...@@ -581,35 +611,46 @@ cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--al ...@@ -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 .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
$(call if_changed_dep,as_o_S) $(call if_changed_dep,as_o_S)
.tmp_kallsyms%.S: .tmp_vmlinux% .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS)
$(call cmd,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__) $(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__) $(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__) $(call if_changed_rule,vmlinux__)
# Needs to visit scripts/ before $(KALLSYMS) can be used.
$(KALLSYMS): scripts ;
endif 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 define rule_vmlinux
$(rule_vmlinux__); \ $(rule_vmlinux__);
$(call do_system_map, $@, System.map) $(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) $(rule_verify_kallsyms)
endef 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) $(call if_changed_rule,vmlinux)
# The actual objects are generated when descending, # The actual objects are generated when descending,
# make sure no implicit rule kicks in # 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) # Handle descending into subdirectories listed in $(vmlinux-dirs)
# Preset locale variables to speed up the build process. Limit locale # Preset locale variables to speed up the build process. Limit locale
...@@ -667,7 +708,7 @@ prepare-all: prepare0 prepare ...@@ -667,7 +708,7 @@ prepare-all: prepare0 prepare
# Leave this as default for preprocessing vmlinux.lds.S, which is now # Leave this as default for preprocessing vmlinux.lds.S, which is now
# done in arch/$(ARCH)/kernel/Makefile # 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 # Single targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -940,7 +981,8 @@ help: ...@@ -940,7 +981,8 @@ help:
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @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 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 ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README file' @echo 'For further info see the ./README file'
......
...@@ -462,11 +462,6 @@ config ALPHA_SRM ...@@ -462,11 +462,6 @@ config ALPHA_SRM
If unsure, say N. If unsure, say N.
config EARLY_PRINTK
bool
depends on ALPHA_GENERIC || ALPHA_SRM
default y
config EISA config EISA
bool bool
depends on ALPHA_GENERIC || ALPHA_JENSEN || ALPHA_ALCOR || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_RAWHIDE 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" ...@@ -593,104 +588,7 @@ source "fs/Kconfig"
source "arch/alpha/oprofile/Kconfig" source "arch/alpha/oprofile/Kconfig"
menu "Kernel hacking" source "arch/alpha/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
NM := $(NM) -B NM := $(NM) -B
LDFLAGS_vmlinux := -static -N #-relax LDFLAGS_vmlinux := -static -N #-relax
CHECK := $(CHECK) -D__alpha__=1 CHECKFLAGS += -D__alpha__=1
cflags-y := -pipe -mno-fp-regs -ffixed-8 cflags-y := -pipe -mno-fp-regs -ffixed-8
# Determine if we can use the BWX instructions with GAS. # Determine if we can use the BWX instructions with GAS.
...@@ -22,15 +22,11 @@ $(error The assembler '$(AS)' does not support the BWX instruction) ...@@ -22,15 +22,11 @@ $(error The assembler '$(AS)' does not support the BWX instruction)
endif endif
# Determine if GCC understands the -mcpu= option. # 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 := $(call cc-option-yn, -mcpu=ev5)
have_mcpu_pca56 := $(call cc-option-yn, -mcpu=pca56)
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 := $(call cc-option-yn, -mcpu=ev6)
have_mcpu_ev67 := $(call cc-option-yn, -mcpu=ev67)
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_msmall_data := $(call cc-option-yn, -msmall-data)
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)
cflags-$(have_msmall_data) += -msmall-data cflags-$(have_msmall_data) += -msmall-data
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# Copyright (C) 1994 by Linus Torvalds # Copyright (C) 1994 by Linus Torvalds
# #
host-progs := tools/mkbb tools/objstrip hostprogs-y := tools/mkbb tools/objstrip
targets := vmlinux.gz vmlinux \ targets := vmlinux.gz vmlinux \
vmlinux.nh tools/lxboot tools/bootlx tools/bootph \ vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
tools/bootpzh bootloader bootpheader bootpzheader tools/bootpzh bootloader bootpheader bootpzheader
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
extra-y := head.o vmlinux.lds.s extra-y := head.o vmlinux.lds
EXTRA_AFLAGS := $(CFLAGS) EXTRA_AFLAGS := $(CFLAGS)
EXTRA_CFLAGS := -Werror -Wno-sign-compare EXTRA_CFLAGS := -Werror -Wno-sign-compare
......
...@@ -65,7 +65,6 @@ config GENERIC_ISA_DMA ...@@ -65,7 +65,6 @@ config GENERIC_ISA_DMA
source "init/Kconfig" source "init/Kconfig"
menu "System Type" menu "System Type"
choice choice
...@@ -252,7 +251,6 @@ config XSCALE_PMU ...@@ -252,7 +251,6 @@ config XSCALE_PMU
endmenu endmenu
menu "General setup" menu "General setup"
# Select various configuration options depending on the machine type # Select various configuration options depending on the machine type
...@@ -666,169 +664,10 @@ source "drivers/misc/Kconfig" ...@@ -666,169 +664,10 @@ source "drivers/misc/Kconfig"
source "drivers/usb/Kconfig" source "drivers/usb/Kconfig"
source "arch/arm/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
LDFLAGS_vmlinux :=-p --no-undefined -X LDFLAGS_vmlinux :=-p --no-undefined -X
LDFLAGS_BLOB :=--format binary 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 OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
GZFLAGS :=-9 GZFLAGS :=-9
#CFLAGS +=-pipe #CFLAGS +=-pipe
...@@ -36,8 +36,8 @@ comma = , ...@@ -36,8 +36,8 @@ comma = ,
# Note that GCC does not numerically define an architecture version # Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes # macro, but instead defines a whole series of macros which makes
# testing for a specific architecture or later rather impossible. # 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_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 check_gcc,-march=armv5te,-march=armv4) 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_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
...@@ -51,14 +51,14 @@ tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi ...@@ -51,14 +51,14 @@ tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 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 tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
# Need -Uarm for gcc < 3.x # 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 AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu
CHECK := $(CHECK) -D__arm__=1 CHECKFLAGS += -D__arm__=1
#Default value #Default value
DATAADDR := . DATAADDR := .
......
...@@ -29,7 +29,7 @@ endif ...@@ -29,7 +29,7 @@ endif
head-y := head.o head-y := head.o
obj-$(CONFIG_DEBUG_LL) += debug.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 # Spell out some dependencies that aren't automatically figured out
$(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h
......
...@@ -214,118 +214,7 @@ source "drivers/misc/Kconfig" ...@@ -214,118 +214,7 @@ source "drivers/misc/Kconfig"
source "drivers/usb/Kconfig" source "drivers/usb/Kconfig"
menu "Kernel hacking" source "arch/arm26/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_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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
LDFLAGS_vmlinux :=-p -X LDFLAGS_vmlinux :=-p -X
LDFLAGS_BLOB :=--format binary 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 OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
GZFLAGS :=-9 GZFLAGS :=-9
......
...@@ -14,5 +14,5 @@ obj-y := compat.o dma.o entry.o irq.o \ ...@@ -14,5 +14,5 @@ obj-y := compat.o dma.o entry.o irq.o \
obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_FIQ) += fiq.o
obj-$(CONFIG_MODULES) += armksyms.o obj-$(CONFIG_MODULES) += armksyms.o
extra-y := init_task.o vmlinux.lds.s extra-y := init_task.o vmlinux.lds
...@@ -20,8 +20,11 @@ config RWSEM_GENERIC_SPINLOCK ...@@ -20,8 +20,11 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM config RWSEM_XCHGADD_ALGORITHM
bool bool
source "init/Kconfig" config CRIS
bool
default y
source "init/Kconfig"
menu "General setup" menu "General setup"
...@@ -69,7 +72,6 @@ config PREEMPT ...@@ -69,7 +72,6 @@ config PREEMPT
endmenu endmenu
menu "Hardware setup" menu "Hardware setup"
choice choice
...@@ -165,54 +167,10 @@ source "sound/Kconfig" ...@@ -165,54 +167,10 @@ source "sound/Kconfig"
source "drivers/usb/Kconfig" source "drivers/usb/Kconfig"
source "arch/cris/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -29,7 +29,7 @@ LDFLAGS_BLOB := --format binary --oformat elf32-cris \ ...@@ -29,7 +29,7 @@ LDFLAGS_BLOB := --format binary --oformat elf32-cris \
OBJCOPYFLAGS := -O binary -R .note -R .comment -S 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 AFLAGS += -mlinux
CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
...@@ -39,7 +39,7 @@ CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g ...@@ -39,7 +39,7 @@ CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
CFLAGS += -fno-omit-frame-pointer CFLAGS += -fno-omit-frame-pointer
endif 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) LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Makefile for the linux kernel. # 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 \ obj-y := process.o traps.o irq.o ptrace.o setup.o \
time.o sys_cris.o semaphore.o time.o sys_cris.o semaphore.o
......
...@@ -181,81 +181,10 @@ endmenu ...@@ -181,81 +181,10 @@ endmenu
source "fs/Kconfig" source "fs/Kconfig"
menu "Kernel hacking" source "arch/h8300/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
extra-y := vmlinux.lds.s extra-y := vmlinux.lds
obj-y := process.o traps.o ptrace.o ints.o \ obj-y := process.o traps.o ptrace.o ints.o \
sys_h8300.o time.o semaphore.o signal.o \ sys_h8300.o time.o semaphore.o signal.o \
......
...@@ -31,7 +31,6 @@ config GENERIC_ISA_DMA ...@@ -31,7 +31,6 @@ config GENERIC_ISA_DMA
source "init/Kconfig" source "init/Kconfig"
menu "Processor type and features" menu "Processor type and features"
choice choice
...@@ -55,13 +54,13 @@ config X86_ELAN ...@@ -55,13 +54,13 @@ config X86_ELAN
config X86_VOYAGER config X86_VOYAGER
bool "Voyager (NCR)" bool "Voyager (NCR)"
help help
Voyager is a MCA based 32 way capable SMP architecture proprietary Voyager is an MCA-based 32-way capable SMP architecture proprietary
to NCR Corp. Machine classes 345x/35xx/4100/51xx are voyager based. to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
*** WARNING *** *** WARNING ***
If you do not specifically know you have a Voyager based machine, 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 config X86_NUMAQ
bool "NUMAQ (IBM/Sequent)" bool "NUMAQ (IBM/Sequent)"
...@@ -1027,7 +1026,6 @@ source "arch/i386/kernel/cpu/cpufreq/Kconfig" ...@@ -1027,7 +1026,6 @@ source "arch/i386/kernel/cpu/cpufreq/Kconfig"
endmenu endmenu
menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
config X86_VISWS_APIC config X86_VISWS_APIC
...@@ -1172,7 +1170,6 @@ source "drivers/pci/hotplug/Kconfig" ...@@ -1172,7 +1170,6 @@ source "drivers/pci/hotplug/Kconfig"
endmenu endmenu
menu "Executable file formats" menu "Executable file formats"
source "fs/Kconfig.binfmt" source "fs/Kconfig.binfmt"
...@@ -1185,130 +1182,7 @@ source "fs/Kconfig" ...@@ -1185,130 +1182,7 @@ source "fs/Kconfig"
source "arch/i386/oprofile/Kconfig" source "arch/i386/oprofile/Kconfig"
source "arch/i386/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -18,48 +18,47 @@ ...@@ -18,48 +18,47 @@
LDFLAGS := -m elf_i386 LDFLAGS := -m elf_i386
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux := LDFLAGS_vmlinux :=
CHECK := $(CHECK) -D__i386__=1 CHECKFLAGS += -D__i386__=1
CFLAGS += -pipe -msoft-float CFLAGS += -pipe -msoft-float
# prevent gcc from keeping the stack 16 byte aligned # prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0))
align := $(subst -functions=0,,$(call cc-option,-falign-functions=0,-malign-functions=0))
cflags-$(CONFIG_M386) += -march=i386 cflags-$(CONFIG_M386) += -march=i386
cflags-$(CONFIG_M486) += -march=i486 cflags-$(CONFIG_M486) += -march=i486
cflags-$(CONFIG_M586) += -march=i586 cflags-$(CONFIG_M586) += -march=i586
cflags-$(CONFIG_M586TSC) += -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_M686) += -march=i686
cflags-$(CONFIG_MPENTIUMII) += $(call check_gcc,-march=pentium2,-march=i686) cflags-$(CONFIG_MPENTIUMII) += $(call cc-option,-march=pentium2,-march=i686)
cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686) cflags-$(CONFIG_MPENTIUMIII) += $(call cc-option,-march=pentium3,-march=i686)
cflags-$(CONFIG_MPENTIUMM) += $(call check_gcc,-march=pentium3,-march=i686) cflags-$(CONFIG_MPENTIUMM) += $(call cc-option,-march=pentium3,-march=i686)
cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686) cflags-$(CONFIG_MPENTIUM4) += $(call cc-option,-march=pentium4,-march=i686)
cflags-$(CONFIG_MK6) += -march=k6 cflags-$(CONFIG_MK6) += -march=k6
# Please note, that patches that add -march=athlon-xp and friends are pointless. # Please note, that patches that add -march=athlon-xp and friends are pointless.
# They make zero difference whatsosever to performance at this time. # 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_MK7) += $(call cc-option,-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_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_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_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586) cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586)
cflags-$(CONFIG_MWINCHIP3D) += $(call check_gcc,-march=winchip2,-march=i586) cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-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_MCYRIXIII) += $(call cc-option,-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_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
# AMD Elan support # AMD Elan support
cflags-$(CONFIG_X86_ELAN) += -march=i486 cflags-$(CONFIG_X86_ELAN) += -march=i486
# -mregparm=3 works ok on gcc-3.0 and later # -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 ;) 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 # Disable unit-at-a-time mode, it makes gcc use a lot more stack
# due to the lack of sharing of stacklots. # 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) CFLAGS += $(cflags-y)
......
...@@ -29,9 +29,9 @@ targets := vmlinux.bin bootsect bootsect.o setup setup.o \ ...@@ -29,9 +29,9 @@ targets := vmlinux.bin bootsect bootsect.o setup setup.o \
zImage bzImage zImage bzImage
subdir- := compressed subdir- := compressed
host-progs := tools/build hostprogs-y := tools/build
HOSTCFLAGS_build.o := -Iinclude HOSTCFLAGS_build.o := $(LINUXINCLUDE)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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 \ 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 \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
......
...@@ -372,119 +372,7 @@ source "arch/ia64/hp/sim/Kconfig" ...@@ -372,119 +372,7 @@ source "arch/ia64/hp/sim/Kconfig"
source "arch/ia64/oprofile/Kconfig" source "arch/ia64/oprofile/Kconfig"
menu "Kernel hacking" source "arch/ia64/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 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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -23,9 +23,7 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ ...@@ -23,9 +23,7 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
-falign-functions=32 -frename-registers -falign-functions=32 -frename-registers
CFLAGS_KERNEL := -mconstant-gp CFLAGS_KERNEL := -mconstant-gp
GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') GCC_VERSION := $(call cc-version)
GCC_MINOR_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f2 -d'.')
GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) $(OBJDUMP)) GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) $(OBJDUMP))
CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags $(CC) $(OBJDUMP) $(READELF)) 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 ...@@ -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) ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
endif 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.) $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad code.)
endif endif
ifeq ($(GCC_VERSION),3) ifeq ($(GCC_VERSION),0304)
ifeq ($(GCC_MINOR_VERSION),4)
# Workaround Itanium 1 bugs in gcc 3.4. # Workaround Itanium 1 bugs in gcc 3.4.
# cflags-$(CONFIG_ITANIUM) += -mtune=merced # cflags-$(CONFIG_ITANIUM) += -mtune=merced
cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
endif
endif endif
cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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 \ 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 \ 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 ...@@ -21,25 +21,25 @@ obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
# The gate DSO image is built using a special linker script. # The gate DSO image is built using a special linker script.
targets += gate.so gate-syms.o 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. # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 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 $@ quiet_cmd_gate = GATE $@
cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 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) $(call if_changed,gate)
$(obj)/built-in.o: $(obj)/gate-syms.o $(obj)/built-in.o: $(obj)/gate-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o
GATECFLAGS_gate-syms.o = -r 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) $(call if_changed,gate)
# gate-data.o contains the gate DSO image as data in section .data.gate. # gate-data.o contains the gate DSO image as data in section .data.gate.
......
...@@ -21,12 +21,10 @@ config RWSEM_GENERIC_SPINLOCK ...@@ -21,12 +21,10 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM config RWSEM_XCHGADD_ALGORITHM
bool bool
mainmenu "Linux/68k Kernel Configuration" mainmenu "Linux/68k Kernel Configuration"
source "init/Kconfig" source "init/Kconfig"
menu "Platform dependent setup" menu "Platform dependent setup"
config EISA config EISA
...@@ -355,7 +353,6 @@ config 060_WRITETHROUGH ...@@ -355,7 +353,6 @@ config 060_WRITETHROUGH
endmenu endmenu
menu "General setup" menu "General setup"
source "fs/Kconfig.binfmt" source "fs/Kconfig.binfmt"
...@@ -447,7 +444,6 @@ endmenu ...@@ -447,7 +444,6 @@ endmenu
source "drivers/Kconfig" source "drivers/Kconfig"
menu "Character devices" menu "Character devices"
config ATARI_MFPSER config ATARI_MFPSER
...@@ -652,47 +648,10 @@ endmenu ...@@ -652,47 +648,10 @@ endmenu
source "fs/Kconfig" source "fs/Kconfig"
menu "Kernel hacking" source "arch/m68k/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu
...@@ -28,7 +28,7 @@ ifdef CONFIG_SUN3 ...@@ -28,7 +28,7 @@ ifdef CONFIG_SUN3
LDFLAGS_vmlinux = -N LDFLAGS_vmlinux = -N
endif 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 ;-( # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
CFLAGS += -pipe -fno-strength-reduce -ffixed-a2 CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
......
...@@ -7,7 +7,7 @@ ifndef CONFIG_SUN3 ...@@ -7,7 +7,7 @@ ifndef CONFIG_SUN3
else else
extra-y := sun3-head.o extra-y := sun3-head.o
endif endif
extra-y += vmlinux.lds.s extra-y += vmlinux.lds
obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ 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 sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
mainmenu "uClinux/68k (w/o MMU) Kernel Configuration" mainmenu "uClinux/68k (w/o MMU) Kernel Configuration"
config M68KNOMMU
bool
default y
config MMU config MMU
bool bool
default n default n
...@@ -25,7 +29,6 @@ config RWSEM_XCHGADD_ALGORITHM ...@@ -25,7 +29,6 @@ config RWSEM_XCHGADD_ALGORITHM
bool bool
default n default n
source "init/Kconfig" source "init/Kconfig"
menu "Processor type and features" menu "Processor type and features"
...@@ -472,7 +475,6 @@ endchoice ...@@ -472,7 +475,6 @@ endchoice
endmenu endmenu
menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
config PCI config PCI
...@@ -511,64 +513,10 @@ source "drivers/Kconfig" ...@@ -511,64 +513,10 @@ source "drivers/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
menu "Kernel hacking" source "arch/m68knommu/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for arch/m68knommu/kernel. # 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 \ 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 setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
......
...@@ -1091,7 +1091,6 @@ config TANBAC_TB0219 ...@@ -1091,7 +1091,6 @@ config TANBAC_TB0219
endmenu endmenu
menu "CPU selection" menu "CPU selection"
choice choice
...@@ -1382,21 +1381,6 @@ config PREEMPT ...@@ -1382,21 +1381,6 @@ config PREEMPT
This allows applications to run more reliably even when the system is This allows applications to run more reliably even when the system is
under load. 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 config RTC_DS1742
bool "DS1742 BRAM/RTC support" bool "DS1742 BRAM/RTC support"
depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927
...@@ -1572,119 +1556,7 @@ source "drivers/Kconfig" ...@@ -1572,119 +1556,7 @@ source "drivers/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
menu "Kernel hacking" source "arch/mips/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_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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -56,14 +56,12 @@ endif ...@@ -56,14 +56,12 @@ endif
# #
cflags-y := -I $(TOPDIR)/include/asm/gcc cflags-y := -I $(TOPDIR)/include/asm/gcc
cflags-y += -G 0 -mno-abicalls -fno-pic -pipe 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 LDFLAGS_vmlinux += -G 0 -static -n
MODFLAGS += -mlong-calls MODFLAGS += -mlong-calls
cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer 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>) # Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>)
# #
...@@ -162,7 +160,7 @@ cflags-$(CONFIG_CPU_R5432) += \ ...@@ -162,7 +160,7 @@ cflags-$(CONFIG_CPU_R5432) += \
cflags-$(CONFIG_CPU_NEVADA) += \ cflags-$(CONFIG_CPU_NEVADA) += \
$(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \ $(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \
-Wa,--trap -Wa,--trap
# $(call check_gcc,-mmad,) # $(call cc-option,-mmad)
cflags-$(CONFIG_CPU_RM7000) += \ cflags-$(CONFIG_CPU_RM7000) += \
$(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \ $(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \
...@@ -643,7 +641,7 @@ endif ...@@ -643,7 +641,7 @@ endif
# none has been choosen above. # none has been choosen above.
# #
AFLAGS_vmlinux.lds.o := \ CPPFLAGS_vmlinux.lds := \
-D"LOADADDR=$(load-y)" \ -D"LOADADDR=$(load-y)" \
-D"JIFFIES=$(JIFFIES)" \ -D"JIFFIES=$(JIFFIES)" \
-imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h -imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the Linux/MIPS kernel. # 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 \ 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 \ ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
......
...@@ -188,76 +188,10 @@ source "fs/Kconfig" ...@@ -188,76 +188,10 @@ source "fs/Kconfig"
source "arch/parisc/oprofile/Kconfig" source "arch/parisc/oprofile/Kconfig"
menu "Kernel hacking" source "arch/parisc/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
head-y := head.o head-y := head.o
head-$(CONFIG_PARISC64) := head64.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_entry.o := -traditional
AFLAGS_pacache.o := -traditional AFLAGS_pacache.o := -traditional
......
...@@ -1228,128 +1228,7 @@ source "lib/Kconfig" ...@@ -1228,128 +1228,7 @@ source "lib/Kconfig"
source "arch/ppc/oprofile/Kconfig" source "arch/ppc/oprofile/Kconfig"
menu "Kernel hacking" source "arch/ppc/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# This must match PAGE_OFFSET in include/asm-ppc/page.h. # This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD := $(CONFIG_KERNEL_START) 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) ifeq ($(HAS_BIARCH),y)
AS := $(AS) -a32 AS := $(AS) -a32
LD := $(LD) -m elf32ppc LD := $(LD) -m elf32ppc
...@@ -27,7 +27,7 @@ CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \ ...@@ -27,7 +27,7 @@ CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
-ffixed-r2 -Wno-uninitialized -mmultiple -ffixed-r2 -Wno-uninitialized -mmultiple
CPP = $(CC) -E $(CFLAGS) CPP = $(CC) -E $(CFLAGS)
CHECK := $(CHECK) -D__powerpc__=1 CHECKFLAGS += -D__powerpc__=1
ifndef CONFIG_E500 ifndef CONFIG_E500
CFLAGS += -mstring CFLAGS += -mstring
...@@ -70,7 +70,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm ...@@ -70,7 +70,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
all: zImage all: zImage
AFLAGS_vmlinux.lds.o := -Upowerpc CPPFLAGS_vmlinux.lds := -Upowerpc
# All the instructions talk about "make bzImage". # All the instructions talk about "make bzImage".
bzImage: zImage bzImage: zImage
...@@ -112,7 +112,7 @@ else ...@@ -112,7 +112,7 @@ else
NEW_AS := 0 NEW_AS := 0
endif endif
# gcc-3.4 and binutils-2.14 are a fatal combination. # 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) BAD_GCC_AS := $(shell echo mftb 5 | $(AS) -mppc -many -o /dev/null >/dev/null 2>&1 && echo 0 || echo 1)
checkbin: checkbin:
......
...@@ -23,12 +23,12 @@ subdir-$(CONFIG_PPC_OF) += of1275 ...@@ -23,12 +23,12 @@ subdir-$(CONFIG_PPC_OF) += of1275
# for cleaning # for cleaning
subdir- += simple openfirmware 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) .PHONY: $(BOOT_TARGETS) $(bootdir-y)
$(BOOT_TARGETS): $(bootdir-y) $(BOOT_TARGETS): $(bootdir-y)
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
$(addprefix $(obj)/,$(host-progs)) $(addprefix $(obj)/,$(hostprogs-y))
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
...@@ -9,7 +9,7 @@ extra-$(CONFIG_E500) := head_e500.o ...@@ -9,7 +9,7 @@ extra-$(CONFIG_E500) := head_e500.o
extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_8xx) := head_8xx.o
extra-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_6xx) += idle_6xx.o
extra-$(CONFIG_POWER4) += idle_power4.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 \ obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \ process.o signal.o ptrace.o align.o \
......
...@@ -343,102 +343,10 @@ config VIOPATH ...@@ -343,102 +343,10 @@ config VIOPATH
source "arch/ppc64/oprofile/Kconfig" source "arch/ppc64/oprofile/Kconfig"
menu "Kernel hacking" source "arch/ppc64/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
KERNELLOAD := 0xc000000000000000 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) ifeq ($(HAS_BIARCH),y)
AS := $(AS) -a64 AS := $(AS) -a64
LD := $(LD) -m elf64ppc LD := $(LD) -m elf64ppc
CC := $(CC) -m64 CC := $(CC) -m64
endif endif
CHECK := $(CHECK) -m64 -D__powerpc__=1 CHECKFLAGS += -m64 -D__powerpc__=1
LDFLAGS := -m elf64ppc LDFLAGS := -m elf64ppc
LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
...@@ -30,14 +30,14 @@ CFLAGS += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \ ...@@ -30,14 +30,14 @@ CFLAGS += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
-mtraceback=none -mtraceback=none
ifeq ($(CONFIG_POWER4_ONLY),y) ifeq ($(CONFIG_POWER4_ONLY),y)
CFLAGS += $(call check_gcc,-mcpu=power4,) CFLAGS += $(call cc-option,-mcpu=power4)
else else
CFLAGS += $(call check_gcc,-mtune=power4,) CFLAGS += $(call cc-option,-mtune=power4)
endif endif
# Enable unit-at-a-time mode when possible. It shrinks the # Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably. # 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 head-y := arch/ppc64/kernel/head.o
......
...@@ -25,7 +25,7 @@ CROSS32_COMPILE ?= ...@@ -25,7 +25,7 @@ CROSS32_COMPILE ?=
BOOTCC := $(CROSS32_COMPILE)gcc BOOTCC := $(CROSS32_COMPILE)gcc
HOSTCC := gcc HOSTCC := gcc
BOOTCFLAGS := $(HOSTCFLAGS) -Iinclude -fno-builtin BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin
BOOTAS := $(CROSS32_COMPILE)as BOOTAS := $(CROSS32_COMPILE)as
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional
BOOTLD := $(CROSS32_COMPILE)ld BOOTLD := $(CROSS32_COMPILE)ld
...@@ -58,7 +58,7 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section))) ...@@ -58,7 +58,7 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section)))
src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(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 \ targets += zImage zImage.initrd imagesize.c \
$(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
$(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
EXTRA_CFLAGS += -mno-minimal-toc 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 \ 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 \ time.o process.o signal.o syscalls.o misc.o ptrace.o \
......
...@@ -75,7 +75,6 @@ config MARCH_Z990 ...@@ -75,7 +75,6 @@ config MARCH_Z990
endchoice endchoice
config SMP config SMP
bool "Symmetric multi-processing support" bool "Symmetric multi-processing support"
---help--- ---help---
...@@ -388,64 +387,10 @@ source "fs/Kconfig" ...@@ -388,64 +387,10 @@ source "fs/Kconfig"
source "arch/s390/oprofile/Kconfig" source "arch/s390/oprofile/Kconfig"
menu "Kernel hacking" source "arch/s390/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
menu "Kernel hacking"
source "lib/Kconfig.debug"
endmenu
...@@ -28,12 +28,12 @@ AFLAGS += -m64 ...@@ -28,12 +28,12 @@ AFLAGS += -m64
UTS_MACHINE := s390x UTS_MACHINE := s390x
endif endif
cflags-$(CONFIG_MARCH_G5) += $(call check_gcc,-march=g5,) cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
cflags-$(CONFIG_MARCH_Z900) += $(call check_gcc,-march=z900,) cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
cflags-$(CONFIG_MARCH_Z990) += $(call check_gcc,-march=z990,) cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
CFLAGS += $(cflags-y) 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 += -pipe -fno-strength-reduce -Wno-sign-compare
CFLAGS += -mbackchain CFLAGS += -mbackchain
......
...@@ -10,7 +10,7 @@ obj-y := bitmap.o traps.o time.o process.o \ ...@@ -10,7 +10,7 @@ obj-y := bitmap.o traps.o time.o process.o \
extra-$(CONFIG_ARCH_S390_31) += head.o extra-$(CONFIG_ARCH_S390_31) += head.o
extra-$(CONFIG_ARCH_S390X) += head64.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_MODULES) += s390_ksyms.o module.o
obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SMP) += smp.o
......
...@@ -711,7 +711,6 @@ source "drivers/pci/hotplug/Kconfig" ...@@ -711,7 +711,6 @@ source "drivers/pci/hotplug/Kconfig"
endmenu endmenu
menu "Executable file formats" menu "Executable file formats"
source "fs/Kconfig.binfmt" source "fs/Kconfig.binfmt"
...@@ -742,161 +741,10 @@ source "fs/Kconfig" ...@@ -742,161 +741,10 @@ source "fs/Kconfig"
source "arch/sh/oprofile/Kconfig" source "arch/sh/oprofile/Kconfig"
menu "Kernel hacking" source "arch/sh/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -31,7 +31,7 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml ...@@ -31,7 +31,7 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
cflags-$(CONFIG_CPU_SH2) += -m2 cflags-$(CONFIG_CPU_SH2) += -m2
cflags-$(CONFIG_CPU_SH3) += -m3 cflags-$(CONFIG_CPU_SH3) += -m3
cflags-$(CONFIG_CPU_SH4) += -m4 \ 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_DSP) += -Wa,-dsp
cflags-$(CONFIG_SH_KGDB) += -g cflags-$(CONFIG_SH_KGDB) += -g
...@@ -122,7 +122,7 @@ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ ...@@ -122,7 +122,7 @@ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
boot := arch/sh/boot boot := arch/sh/boot
AFLAGS_vmlinux.lds.o := -traditional CPPFLAGS_vmlinux.lds := -traditional
prepare: target_links prepare: target_links
......
...@@ -22,7 +22,7 @@ CONFIG_MEMORY_START ?= 0x0c000000 ...@@ -22,7 +22,7 @@ CONFIG_MEMORY_START ?= 0x0c000000
CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) 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 $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
$(call if_changed,ld) $(call if_changed,ld)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the Linux/SuperH kernel. # 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 \ obj-y := process.o signal.o entry.o traps.o irq.o \
ptrace.o setup.o time.o sys_sh.o semaphore.o \ ptrace.o setup.o time.o sys_sh.o semaphore.o \
......
...@@ -263,58 +263,10 @@ source "fs/Kconfig" ...@@ -263,58 +263,10 @@ source "fs/Kconfig"
source "arch/sh64/oprofile/Kconfig" source "arch/sh64/oprofile/Kconfig"
menu "Kernel hacking" source "arch/sh64/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
targets := vmlinux vmlinux.bin vmlinux.bin.gz \ 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 EXTRA_AFLAGS := -traditional
...@@ -25,7 +25,7 @@ OBJECTS := $(obj)/head.o $(obj)/misc.o $(obj)/cache.o ...@@ -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]) ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000])
LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds.s \ -T $(obj)/../../kernel/vmlinux.lds \
--no-warn-mismatch --no-warn-mismatch
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
...@@ -41,6 +41,6 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE ...@@ -41,6 +41,6 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T
OBJCOPYFLAGS += -R .empty_zero_page 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) $(call if_changed,ld)
...@@ -23,7 +23,6 @@ config GENERIC_ISA_DMA ...@@ -23,7 +23,6 @@ config GENERIC_ISA_DMA
source "init/Kconfig" source "init/Kconfig"
menu "General setup" menu "General setup"
config VT config VT
...@@ -380,81 +379,10 @@ source "drivers/usb/Kconfig" ...@@ -380,81 +379,10 @@ source "drivers/usb/Kconfig"
source "drivers/char/watchdog/Kconfig" source "drivers/char/watchdog/Kconfig"
menu "Kernel hacking" source "arch/sparc/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
AS := $(AS) -32 AS := $(AS) -32
LDFLAGS := -m elf32_sparc 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) -g -pipe -fcall-used-g5 -fcall-used-g7
CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
ROOT_IMG := /usr/src/root.img ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout ELFTOAOUT := elftoaout
host-progs := piggyback btfixupprep hostprogs-y := piggyback btfixupprep
targets := tftpboot.img btfix.o btfix.s image targets := tftpboot.img btfix.o btfix.S image
quiet_cmd_elftoaout = ELFTOAOUT $@ quiet_cmd_elftoaout = ELFTOAOUT $@
cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@ cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
...@@ -16,19 +16,43 @@ quiet_cmd_piggy = PIGGY $@ ...@@ -16,19 +16,43 @@ quiet_cmd_piggy = PIGGY $@
cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG) cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG)
quiet_cmd_btfix = BTFIX $@ quiet_cmd_btfix = BTFIX $@
cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ 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) BTOBJS := $(HEAD_Y) $(INIT_Y)
BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_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 $(obj)/image: $(obj)/btfix.o FORCE
$(call if_changed,ld) $(call if_changed_rule,image)
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(obj)/System.map
$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
$(call if_changed,elftoaout) $(call if_changed,elftoaout)
$(call if_changed,piggy) $(call if_changed,piggy)
$(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE $(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE
$(call if_changed,btfix) $(call if_changed,btfix)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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 EXTRA_AFLAGS := -ansi
......
...@@ -14,8 +14,7 @@ config MMU ...@@ -14,8 +14,7 @@ config MMU
source "init/Kconfig" source "init/Kconfig"
menu "General machine setup"
menu "General setup"
config BBC_I2C config BBC_I2C
tristate "UltraSPARC-III bootbus i2c controller driver" tristate "UltraSPARC-III bootbus i2c controller driver"
...@@ -549,7 +548,6 @@ config UNIX98_PTY_COUNT ...@@ -549,7 +548,6 @@ config UNIX98_PTY_COUNT
endmenu endmenu
menu "XFree86 DRI support" menu "XFree86 DRI support"
config DRM config DRM
...@@ -604,113 +602,10 @@ source "drivers/char/watchdog/Kconfig" ...@@ -604,113 +602,10 @@ source "drivers/char/watchdog/Kconfig"
source "arch/sparc64/oprofile/Kconfig" source "arch/sparc64/oprofile/Kconfig"
menu "Kernel hacking" source "arch/sparc64/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
# Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) # 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 ) 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) 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; ) 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 export NEW_GCC
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
ROOT_IMG := /usr/src/root.img ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout ELFTOAOUT := elftoaout
host-progs := piggyback hostprogs-y := piggyback
targets := image tftpboot.img vmlinux.aout targets := image tftpboot.img vmlinux.aout
quiet_cmd_elftoaout = ELF2AOUT $@ quiet_cmd_elftoaout = ELF2AOUT $@
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
EXTRA_AFLAGS := -ansi EXTRA_AFLAGS := -ansi
EXTRA_CFLAGS := -Werror 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 \ obj-y := process.o setup.o cpu.o idprom.o \
traps.o devices.o auxio.o \ traps.o devices.o auxio.o \
......
...@@ -102,10 +102,6 @@ config MCONSOLE ...@@ -102,10 +102,6 @@ config MCONSOLE
It is safe to say 'Y' here. It is safe to say 'Y' here.
config MAGIC_SYSRQ
bool "Magic SysRq key"
depends on MCONSOLE
config HOST_2G_2G config HOST_2G_2G
bool "2G/2G host address space split" bool "2G/2G host address space split"
...@@ -213,59 +209,4 @@ source "drivers/md/Kconfig" ...@@ -213,59 +209,4 @@ source "drivers/md/Kconfig"
source "drivers/mtd/Kconfig" source "drivers/mtd/Kconfig"
source "arch/um/Kconfig.debug"
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
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
...@@ -77,7 +77,7 @@ vmlinux: $(ARCH_DIR)/main.o ...@@ -77,7 +77,7 @@ vmlinux: $(ARCH_DIR)/main.o
# CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case.
LINK_TT = -static LINK_TT = -static
LD_SCRIPT_TT := uml.lds.s LD_SCRIPT_TT := uml.lds
ifeq ($(CONFIG_STATIC_LINK),y) ifeq ($(CONFIG_STATIC_LINK),y)
LINK-y += $(LINK_TT) LINK-y += $(LINK_TT)
...@@ -98,12 +98,12 @@ CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT) ...@@ -98,12 +98,12 @@ CPP_MODE_TT := $(shell [ "$(CONFIG_MODE_TT)" = "y" ] && echo -DMODE_TT)
CONFIG_KERNEL_STACK_ORDER ?= 2 CONFIG_KERNEL_STACK_ORDER ?= 2
STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) 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) \ -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \
-DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \
-DKERNEL_STACK_SIZE=$(STACK_SIZE) -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) LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y)
...@@ -122,7 +122,7 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ ...@@ -122,7 +122,7 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
# To get a definition of F_SETSIG # To get a definition of F_SETSIG
USER_CFLAGS += -D_GNU_SOURCE 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)/dyn_link.ld.s $(GEN_HEADERS)
$(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c
......
...@@ -12,7 +12,7 @@ LINK-$(CONFIG_GPROF) += $(PROFILE) ...@@ -12,7 +12,7 @@ LINK-$(CONFIG_GPROF) += $(PROFILE)
MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include MODE_INCLUDE += -I$(TOPDIR)/$(ARCH_DIR)/kernel/skas/include
LINK_SKAS = -Wl,-rpath,/lib 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 GEN_HEADERS += $(ARCH_DIR)/kernel/skas/include/skas_ptregs.h
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Licensed under the GPL # 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 \ 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 \ helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
......
host-progs := mk_sc hostprogs-y := mk_sc
always := $(host-progs) mk_thread always := $(hostprogs-y) mk_thread
targets := mk_thread_kern.o mk_thread_user.o targets := mk_thread_kern.o mk_thread_user.o
mk_sc-objs := mk_sc.o mk_sc-objs := mk_sc.o
......
...@@ -68,7 +68,6 @@ menu "Processor type and features" ...@@ -68,7 +68,6 @@ menu "Processor type and features"
bool "Anna" bool "Anna"
endchoice endchoice
#### V850E processor-specific config #### V850E processor-specific config
# All CPUs currently supported use the v850e architecture # All CPUs currently supported use the v850e architecture
...@@ -153,7 +152,6 @@ menu "Processor type and features" ...@@ -153,7 +152,6 @@ menu "Processor type and features"
bool bool
default RTE_MB_A_PCI default RTE_MB_A_PCI
#### Some feature-specific configs #### Some feature-specific configs
# Everything except for the GDB simulator uses the same interrupt controller # Everything except for the GDB simulator uses the same interrupt controller
...@@ -181,7 +179,6 @@ menu "Processor type and features" ...@@ -181,7 +179,6 @@ menu "Processor type and features"
bool bool
default !V850E_CACHE && !V850E2_CACHE default !V850E_CACHE && !V850E2_CACHE
#### Misc config #### Misc config
config ROM_KERNEL config ROM_KERNEL
...@@ -305,34 +302,7 @@ source "sound/Kconfig" ...@@ -305,34 +302,7 @@ source "sound/Kconfig"
source "drivers/usb/Kconfig" source "drivers/usb/Kconfig"
source "arch/v850/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
......
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
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# for more details. # 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 \ 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 signal.o irq.o mach.o ptrace.o bug.o
......
...@@ -297,7 +297,7 @@ config GART_IOMMU ...@@ -297,7 +297,7 @@ config GART_IOMMU
properly with 32-bit PCI devices that do not support DAC (Double Address 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. Cycle). The IOMMU can be turned off at runtime with the iommu=off parameter.
Normally the kernel will take the right choice by itself. 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 # need this always enabled with GART_IOMMU for the VIA workaround
config SWIOTLB config SWIOTLB
...@@ -398,110 +398,10 @@ source fs/Kconfig ...@@ -398,110 +398,10 @@ source fs/Kconfig
source "arch/x86_64/oprofile/Kconfig" source "arch/x86_64/oprofile/Kconfig"
menu "Kernel hacking" source "arch/x86_64/Kconfig.debug"
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 "security/Kconfig" source "security/Kconfig"
source "crypto/Kconfig" source "crypto/Kconfig"
source "lib/Kconfig" source "lib/Kconfig"
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
...@@ -37,10 +37,10 @@ LDFLAGS := -m elf_x86_64 ...@@ -37,10 +37,10 @@ LDFLAGS := -m elf_x86_64
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux := -e stext 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_MK8) += $(call cc-option,-march=k8)
cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=nocona,) cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
CFLAGS += $(cflags-y) CFLAGS += $(cflags-y)
CFLAGS += -mno-red-zone CFLAGS += -mno-red-zone
...@@ -54,11 +54,11 @@ ifneq ($(CONFIG_DEBUG_INFO),y) ...@@ -54,11 +54,11 @@ ifneq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -fno-asynchronous-unwind-tables CFLAGS += -fno-asynchronous-unwind-tables
# -fweb shrinks the kernel a bit, but the difference is very small # -fweb shrinks the kernel a bit, but the difference is very small
# it also messes up debugging, so don't use it for now. # it also messes up debugging, so don't use it for now.
#CFLAGS += $(call check_gcc,-fweb,) #CFLAGS += $(call cc-option,-fweb)
endif endif
# -funit-at-a-time shrinks the kernel .text considerably # -funit-at-a-time shrinks the kernel .text considerably
# unfortunately it makes reading oopses harder. # 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 head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
......
...@@ -30,7 +30,7 @@ targets := vmlinux.bin bootsect bootsect.o \ ...@@ -30,7 +30,7 @@ targets := vmlinux.bin bootsect bootsect.o \
EXTRA_CFLAGS := -m32 EXTRA_CFLAGS := -m32
host-progs := tools/build hostprogs-y := tools/build
subdir- := compressed/ #Let make clean descend in compressed/ subdir- := compressed/ #Let make clean descend in compressed/
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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 EXTRA_AFLAGS := -traditional
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 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 \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the linux kernel. # 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 EXTRA_AFLAGS := -traditional
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ 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 \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
fore_200e-objs := fore200e.o fore_200e-objs := fore200e.o
host-progs := fore200e_mkfirm hostprogs-y := fore200e_mkfirm
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := atmsar11.bin atmsar11.bin1 atmsar11.bin2 pca200e.bin \ clean-files := atmsar11.bin atmsar11.bin1 atmsar11.bin2 pca200e.bin \
......
...@@ -10,7 +10,7 @@ raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \ ...@@ -10,7 +10,7 @@ raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \
raid6int1.o raid6int2.o raid6int4.o \ raid6int1.o raid6int2.o raid6int4.o \
raid6int8.o raid6int16.o raid6int32.o \ raid6int8.o raid6int16.o raid6int32.o \
raid6mmx.o raid6sse1.o raid6sse2.o raid6mmx.o raid6sse1.o raid6sse2.o
host-progs := mktables hostprogs-y := mktables
# Note: link order is important. All raid personalities # Note: link order is important. All raid personalities
# and xor.o must come before md.o, as they each initialise # and xor.o must come before md.o, as they each initialise
......
...@@ -13,7 +13,7 @@ obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o ttpci-eeprom.o ...@@ -13,7 +13,7 @@ obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o ttpci-eeprom.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
host-progs := fdump hostprogs-y := fdump
ifdef CONFIG_DVB_AV7110_FIRMWARE ifdef CONFIG_DVB_AV7110_FIRMWARE
$(obj)/av7110.o: $(obj)/fdump $(obj)/av7110_firm.h $(obj)/av7110.o: $(obj)/fdump $(obj)/av7110_firm.h
......
...@@ -35,7 +35,7 @@ ifndef CONFIG_X86 ...@@ -35,7 +35,7 @@ ifndef CONFIG_X86
obj-y += syscall.o obj-y += syscall.o
endif endif
host-progs := gen-devlist hostprogs-y := gen-devlist
# Dependencies on generated files need to be listed explicitly # Dependencies on generated files need to be listed explicitly
$(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h $(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o
obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_PROC_FS) += proc.o
host-progs := gen-devlist hostprogs-y := gen-devlist
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := devlist.h clean-files := devlist.h
......
menu "Code maturity level options" menu "Code maturity level options"
config EXPERIMENTAL config EXPERIMENTAL
...@@ -53,7 +52,6 @@ config BROKEN_ON_SMP ...@@ -53,7 +52,6 @@ config BROKEN_ON_SMP
endmenu endmenu
menu "General setup" menu "General setup"
config SWAP config SWAP
...@@ -287,7 +285,6 @@ config CC_OPTIMIZE_FOR_SIZE ...@@ -287,7 +285,6 @@ config CC_OPTIMIZE_FOR_SIZE
endmenu # General setup endmenu # General setup
menu "Loadable module support" menu "Loadable module support"
config MODULES config MODULES
......
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
...@@ -25,7 +25,7 @@ obj-$(CONFIG_LIBCRC32C) += libcrc32c.o ...@@ -25,7 +25,7 @@ obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/ obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/ obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
host-progs := gen_crc32table hostprogs-y := gen_crc32table
clean-files := crc32table.h clean-files := crc32table.h
$(obj)/crc32.o: $(obj)/crc32table.h $(obj)/crc32.o: $(obj)/crc32table.h
......
...@@ -2,14 +2,21 @@ ...@@ -2,14 +2,21 @@
# scripts contains sources for various helper programs used throughout # scripts contains sources for various helper programs used throughout
# the kernel for the build process. # 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 # conmakehash: Create arrays for initializing the kernel console tables
host-progs := conmakehash kallsyms pnmtologo bin2c hostprogs-$(CONFIG_KALLSYMS) += kallsyms
always := $(host-progs) hostprogs-$(CONFIG_LOGO) += pnmtologo
hostprogs-$(CONFIG_VT) += conmakehash
hostprogs-$(CONFIG_PROM_CONSOLE) += conmakehash
hostprogs-$(CONFIG_IKCONFIG) += bin2c
always := $(hostprogs-y)
subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-y += mod subdir-$(CONFIG_MODULES) += mod
# Let clean descend into subdirs # Let clean descend into subdirs
subdir- += basic lxdialog kconfig package subdir- += basic lxdialog kconfig package
...@@ -14,6 +14,18 @@ include $(obj)/Makefile ...@@ -14,6 +14,18 @@ include $(obj)/Makefile
include scripts/Makefile.lib 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),) ifneq ($(KBUILD_SRC),)
# Create output directory if not already present # Create output directory if not already present
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
...@@ -71,8 +83,13 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ ...@@ -71,8 +83,13 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
# Linus' kernel sanity checking tool # Linus' kernel sanity checking tool
ifneq ($(KBUILD_CHECKSRC),0) ifneq ($(KBUILD_CHECKSRC),0)
quiet_cmd_checksrc = CHECK $< ifeq ($(KBUILD_CHECKSRC),2)
cmd_checksrc = $(CHECK) $(c_flags) $< ; 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 endif
...@@ -170,11 +187,13 @@ endef ...@@ -170,11 +187,13 @@ endef
# Built-in and composite module parts # Built-in and composite module parts
%.o: %.c FORCE %.o: %.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c) $(call if_changed_rule,cc_o_c)
# Single-part modules are special since we need to mark them in $(MODVERDIR) # Single-part modules are special since we need to mark them in $(MODVERDIR)
$(single-used-m): %.o: %.c FORCE $(single-used-m): %.o: %.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c) $(call if_changed_rule,cc_o_c)
@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
...@@ -209,6 +228,14 @@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< ...@@ -209,6 +228,14 @@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
targets += $(real-objs-y) $(real-objs-m) $(lib-y) targets += $(real-objs-y) $(real-objs-m) $(lib-y)
targets += $(extra-y) $(MAKECMDGOALS) $(always) 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 # Build the compiled-in targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -275,90 +302,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE ...@@ -275,90 +302,6 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE
targets += $(multi-used-y) $(multi-used-m) 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 # Descending
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -29,21 +29,49 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) ...@@ -29,21 +29,49 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
# Add subdir path # Add subdir path
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
__clean-files := $(wildcard $(addprefix $(obj)/, \
$(extra-y) $(EXTRA_TARGETS) $(always) $(host-progs) \ # build a list of files to remove, usually releative to the current
$(targets) $(clean-files))) # 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) quiet_cmd_clean = CLEAN $(obj)
cmd_clean = rm -f $(__clean-files); $(clean-rule) cmd_clean = rm -f $(__clean-files)
quiet_cmd_cleandir = CLEAN $(__clean-dirs)
cmd_cleandir = rm -rf $(__clean-dirs)
__clean: $(subdir-ymn) __clean: $(subdir-ymn)
ifneq ($(strip $(__clean-files) $(clean-rule)),) ifneq ($(strip $(__clean-files)),)
+$(call cmd,clean) +$(call cmd,clean)
else
@:
endif endif
ifneq ($(strip $(__clean-dirs)),)
+$(call cmd,cleandir)
endif
ifneq ($(strip $(clean-rule)),)
+$(clean-rule)
endif
@:
# =========================================================================== # ===========================================================================
# Generic stuff # Generic stuff
......
# ==========================================================================
# 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)
...@@ -60,41 +60,11 @@ subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o) ...@@ -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) is a list of directories that contain object files
obj-dirs := $(dir $(multi-objs) $(subdir-obj-y)) 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 # 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-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))) 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 # Add subdir path
extra-y := $(addprefix $(obj)/,$(extra-y)) extra-y := $(addprefix $(obj)/,$(extra-y))
...@@ -113,14 +83,6 @@ multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) ...@@ -113,14 +83,6 @@ multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) 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 # The temporary file to save gcc -MD generated dependencies must not
# contain a comma # contain a comma
...@@ -136,12 +98,9 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d) ...@@ -136,12 +98,9 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F)))
modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))) modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname))))
_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) _cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
# If building the kernel in a separate objtree expand all occurrences # If building the kernel in a separate objtree expand all occurrences
# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
...@@ -149,8 +108,7 @@ _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) ...@@ -149,8 +108,7 @@ _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
ifeq ($(KBUILD_SRC),) ifeq ($(KBUILD_SRC),)
__c_flags = $(_c_flags) __c_flags = $(_c_flags)
__a_flags = $(_a_flags) __a_flags = $(_a_flags)
__hostc_flags = $(_hostc_flags) __cpp_flags = $(_cpp_flags)
__hostcxx_flags = $(_hostcxx_flags)
else else
# Prefix -I with $(srctree) if it is not an absolute path # 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))) ...@@ -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 # FIXME: Replace both with specific CFLAGS* statements in the makefiles
__c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) __c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags)
__a_flags = $(call flags,_a_flags) __a_flags = $(call flags,_a_flags)
__hostc_flags = -I$(obj) $(call flags,_hostc_flags) __cpp_flags = $(call flags,_cpp_flags)
__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags)
endif endif
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
...@@ -175,8 +132,7 @@ 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 = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
$(__a_flags) $(modkern_aflags) $(__a_flags) $(modkern_aflags)
hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
......
...@@ -51,6 +51,7 @@ _modpost: $(modules) ...@@ -51,6 +51,7 @@ _modpost: $(modules)
# Includes step 3,4 # Includes step 3,4
quiet_cmd_modpost = MODPOST quiet_cmd_modpost = MODPOST
cmd_modpost = scripts/mod/modpost \ cmd_modpost = scripts/mod/modpost \
$(if $(CONFIG_MODVERSIONS),-m) \
$(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \ $(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \
$(filter-out FORCE,$^) $(filter-out FORCE,$^)
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
# include/config/... # include/config/...
# docproc: Used in Documentation/docbook # docproc: Used in Documentation/docbook
host-progs := fixdep split-include docproc hostprogs-y := fixdep split-include docproc
always := $(host-progs) always := $(hostprogs-y)
# fixdep is needed to compile other host programs # fixdep is needed to compile other host programs
$(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep $(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <limits.h>
#include <ctype.h> #include <ctype.h>
#include <netinet/in.h> #include <arpa/inet.h>
#define INT_CONF ntohl(0x434f4e46) #define INT_CONF ntohl(0x434f4e46)
#define INT_ONFI ntohl(0x4f4e4649) #define INT_ONFI ntohl(0x4f4e4649)
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
char *progname; char *progname;
char *inputname; char *inputname;
int inputfd; int inputfd;
int bix; /* buf index */ unsigned int bix; /* buf index */
unsigned char patterns [PAT_SIZE] = {0}; /* byte-sized pattern array */ unsigned char patterns [PAT_SIZE] = {0}; /* byte-sized pattern array */
int pat_len; /* actual number of pattern bytes */ int pat_len; /* actual number of pattern bytes */
unsigned char *madr; /* mmap address */ unsigned char *madr; /* mmap address */
...@@ -58,7 +58,7 @@ void usage (void) ...@@ -58,7 +58,7 @@ void usage (void)
exit (1); exit (1);
} }
int get_pattern (int pat_count, char *pats []) void get_pattern (int pat_count, char *pats [])
{ {
int ix, err, tmp; int ix, err, tmp;
...@@ -81,7 +81,7 @@ int get_pattern (int pat_count, char *pats []) ...@@ -81,7 +81,7 @@ int get_pattern (int pat_count, char *pats [])
pat_len = pat_count; pat_len = pat_count;
} }
int search_pattern (void) void search_pattern (void)
{ {
for (bix = 0; bix < filesize; bix++) { for (bix = 0; bix < filesize; bix++) {
if (madr[bix] == patterns[0]) { if (madr[bix] == patterns[0]) {
...@@ -109,7 +109,7 @@ size_t get_filesize (int fd) ...@@ -109,7 +109,7 @@ size_t get_filesize (int fd)
struct stat stat; struct stat stat;
err = fstat (fd, &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) if (err < 0)
return err; return err;
return (size_t) stat.st_size; return (size_t) stat.st_size;
...@@ -154,8 +154,8 @@ int main (int argc, char *argv []) ...@@ -154,8 +154,8 @@ int main (int argc, char *argv [])
fprintf (stderr, "number of pattern matches = %d\n", num_matches); fprintf (stderr, "number of pattern matches = %d\n", num_matches);
if (num_matches == 0) if (num_matches == 0)
firstloc = ~0; firstloc = ~0;
printf ("%d\n", firstloc); printf ("%ld\n", firstloc);
fprintf (stderr, "%d\n", firstloc); fprintf (stderr, "%ld\n", firstloc);
exit (num_matches ? 0 : 2); exit (num_matches ? 0 : 2);
} }
......
host-progs := genksyms hostprogs-y := genksyms
always := $(host-progs) always := $(hostprogs-y)
genksyms-objs := genksyms.o parse.o lex.o genksyms-objs := genksyms.o parse.o lex.o
......
...@@ -67,7 +67,7 @@ help: ...@@ -67,7 +67,7 @@ help:
libkconfig-objs := zconf.tab.o libkconfig-objs := zconf.tab.o
host-progs := conf mconf qconf gconf hostprogs-y := conf mconf qconf gconf
conf-objs := conf.o libkconfig.so conf-objs := conf.o libkconfig.so
mconf-objs := mconf.o libkconfig.so mconf-objs := mconf.o libkconfig.so
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
...@@ -268,6 +269,7 @@ int conf_write(const char *name) ...@@ -268,6 +269,7 @@ int conf_write(const char *name)
char dirname[128], tmpname[128], newname[128]; char dirname[128], tmpname[128], newname[128];
int type, l; int type, l;
const char *str; const char *str;
time_t now;
dirname[0] = 0; dirname[0] = 0;
if (name && name[0]) { if (name && name[0]) {
...@@ -301,14 +303,25 @@ int conf_write(const char *name) ...@@ -301,14 +303,25 @@ int conf_write(const char *name)
if (!out_h) if (!out_h)
return 1; return 1;
} }
sym = sym_lookup("KERNELRELEASE", 0);
sym_calc_value(sym);
time(&now);
fprintf(out, "#\n" fprintf(out, "#\n"
"# Automatically generated make config: don't edit\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) if (out_h)
fprintf(out_h, "/*\n" fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n" " * Automatically generated C config: don't edit\n"
" * Linux kernel version: %s\n"
" * %s"
" */\n" " */\n"
"#define AUTOCONF_INCLUDED\n"); "#define AUTOCONF_INCLUDED\n",
sym_get_string_value(sym),
ctime(&now));
if (!sym_change_count) if (!sym_change_count)
sym_clear_all_valid(); sym_clear_all_valid();
......
...@@ -15,8 +15,8 @@ endif ...@@ -15,8 +15,8 @@ endif
endif endif
endif endif
host-progs := lxdialog hostprogs-y := lxdialog
always := ncurses $(host-progs) always := ncurses $(hostprogs-y)
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
util.o lxdialog.o msgbox.o util.o lxdialog.o msgbox.o
......
#!/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
host-progs := modpost mk_elfconfig hostprogs-y := modpost mk_elfconfig
always := $(host-progs) empty.o always := $(hostprogs-y) empty.o
modpost-objs := modpost.o file2alias.o sumversion.o modpost-objs := modpost.o file2alias.o sumversion.o
......
...@@ -343,7 +343,6 @@ handle_modversions(struct module *mod, struct elf_info *info, ...@@ -343,7 +343,6 @@ handle_modversions(struct module *mod, struct elf_info *info,
crc = (unsigned int) sym->st_value; crc = (unsigned int) sym->st_value;
add_exported_symbol(symname + strlen(CRC_PFX), add_exported_symbol(symname + strlen(CRC_PFX),
mod, &crc); mod, &crc);
modversions = 1;
} }
break; break;
case SHN_UNDEF: case SHN_UNDEF:
...@@ -649,7 +648,6 @@ read_dump(const char *fname) ...@@ -649,7 +648,6 @@ read_dump(const char *fname)
if (!(mod = find_module(modname))) { if (!(mod = find_module(modname))) {
if (is_vmlinux(modname)) { if (is_vmlinux(modname)) {
modversions = 1;
have_vmlinux = 1; have_vmlinux = 1;
} }
mod = new_module(NOFAIL(strdup(modname))); mod = new_module(NOFAIL(strdup(modname)));
...@@ -696,11 +694,14 @@ main(int argc, char **argv) ...@@ -696,11 +694,14 @@ main(int argc, char **argv)
char *dump_read = NULL, *dump_write = NULL; char *dump_read = NULL, *dump_write = NULL;
int opt; int opt;
while ((opt = getopt(argc, argv, "i:o:")) != -1) { while ((opt = getopt(argc, argv, "i:mo:")) != -1) {
switch(opt) { switch(opt) {
case 'i': case 'i':
dump_read = optarg; dump_read = optarg;
break; break;
case 'm':
modversions = 1;
break;
case 'o': case 'o':
dump_write = optarg; dump_write = optarg;
break; break;
......
#include <netinet/in.h> #include <arpa/inet.h>
#include <stdint.h> #include <stdint.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
......
...@@ -51,7 +51,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec ...@@ -51,7 +51,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec
$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz $(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
rm ../$(KERNELPATH).tar.gz rm ../$(KERNELPATH).tar.gz
clean-rule += rm -f $(objtree)/kernel.spec clean-files := $(objtree)/kernel.spec
# binrpm-pkg # binrpm-pkg
.PHONY: binrpm-pkg .PHONY: binrpm-pkg
...@@ -67,7 +67,7 @@ binrpm-pkg: $(objtree)/binkernel.spec ...@@ -67,7 +67,7 @@ binrpm-pkg: $(objtree)/binkernel.spec
$(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $< $(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $<
clean-rule += rm -f $(objtree)/binkernel.spec clean-files += $(objtree)/binkernel.spec
# Deb target # Deb target
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -77,7 +77,7 @@ deb-pkg: ...@@ -77,7 +77,7 @@ deb-pkg:
$(MAKE) $(MAKE)
$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
clean-rule += && rm -rf $(objtree)/debian/ clean-dirs += $(objtree)/debian/
# Help text displayed when executing 'make help' # Help text displayed when executing 'make help'
......
...@@ -40,17 +40,24 @@ ...@@ -40,17 +40,24 @@
# #
# Added -ac option, use -ac or -ac9 (say) to stop at a particular version # Added -ac option, use -ac or -ac9 (say) to stop at a particular version
# Dave Gilbert <linux@treblig.org>, 29th September 2001. # 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. # Set directories from arguments, or use defaults.
sourcedir=${1-/usr/src/linux} sourcedir=${1-/usr/src/linux}
patchdir=${2-.} 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 cat << USAGE
usage: patch-kernel [-h] [ sourcedir [ patchdir [ stopversion ] [ -acxx ] ] ] usage: patch-kernel [-h] [ sourcedir [ patchdir [ stopversion ] [ -acxx ] ] ]
The source directory defaults to /usr/src/linux, and source directory defaults to /usr/src/linux,
the patch directory defaults to the current directory. patch directory defaults to the current directory,
stopversion defaults to <all in patchdir>.
USAGE USAGE
exit 1 exit 1
fi fi
...@@ -126,33 +133,85 @@ applyPatch () { ...@@ -126,33 +133,85 @@ applyPatch () {
return 0; return 0;
} }
# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTERVERSION # set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $sourcedir/Makefile` 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" ] if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
then then
echo "unable to determine current kernel version" >&2 echo "unable to determine current kernel version" >&2
exit 1 exit 1
fi 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" ] if [ x$EXTRAVERSION != "x" ]
then then
echo "I'm sorry but patch-kernel can't work with a kernel source tree that is not a base version" if [ ${EXTRAVERSION:0:1} == "." ]; then
exit 1; EXTRAVER=${EXTRAVERSION:1}
else
EXTRAVER=$EXTRAVERSION
fi
EXTRAVER=${EXTRAVER%%[[:punct:]]*}
#echo "patch-kernel: changing EXTRAVERSION from $EXTRAVERSION to $EXTRAVER"
fi fi
while : #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 : # incrementing SUBLEVEL (s in v.p.s)
do do
if [ x$EXTRAVER != "x" ]; then
CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL.$EXTRAVER"
else
CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL"
if [ $stopvers = $CURRENTFULLVERSION ] fi
then
echo "Stoping at $CURRENTFULLVERSION base as requested." if [ $stopvers == $CURRENTFULLVERSION ]; then
echo "Stopping at $CURRENTFULLVERSION base as requested."
break break
fi 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" 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 patch=patch-$FULLVERSION
...@@ -162,12 +221,12 @@ do ...@@ -162,12 +221,12 @@ do
# Apply the patch and check all is OK # Apply the patch and check all is OK
applyPatch $patch || break applyPatch $patch || break
done done
#echo "base all done"
if [ x$gotac != x ]; then if [ x$gotac != x ]; then
# Out great user wants the -ac patches # Out great user wants the -ac patches
# They could have done -ac (get latest) or -acxx where xx=version they want # They could have done -ac (get latest) or -acxx where xx=version they want
if [ $gotac == "-ac" ] if [ $gotac == "-ac" ]; then
then
# They want the latest version # They want the latest version
HIGHESTPATCH=0 HIGHESTPATCH=0
for PATCHNAMES in $patchdir/patch-${CURRENTFULLVERSION}-ac*\.* for PATCHNAMES in $patchdir/patch-${CURRENTFULLVERSION}-ac*\.*
...@@ -176,18 +235,16 @@ if [ x$gotac != x ]; then ...@@ -176,18 +235,16 @@ if [ x$gotac != x ]; then
# Check it is actually a recognised patch type # Check it is actually a recognised patch type
findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${ACVALUE} || break findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${ACVALUE} || break
if [ $ACVALUE -gt $HIGHESTPATCH ] if [ $ACVALUE -gt $HIGHESTPATCH ]; then
then
HIGHESTPATCH=$ACVALUE HIGHESTPATCH=$ACVALUE
fi fi
done done
if [ $HIGHESTPATCH -ne 0 ] if [ $HIGHESTPATCH -ne 0 ]; then
then
findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH} || break findFile $patchdir/patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH} || break
applyPatch patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH} applyPatch patch-${CURRENTFULLVERSION}-ac${HIGHESTPATCH}
else else
echo "No ac patches found" echo "No -ac patches found"
fi fi
else else
# They want an exact version # They want an exact version
...@@ -198,5 +255,3 @@ if [ x$gotac != x ]; then ...@@ -198,5 +255,3 @@ if [ x$gotac != x ]; then
applyPatch patch-${CURRENTFULLVERSION}${gotac} applyPatch patch-${CURRENTFULLVERSION}${gotac}
fi fi
fi fi
...@@ -103,7 +103,7 @@ sb_lib-objs := sb_common.o sb_audio.o sb_midi.o sb_mixer.o sb_ess.o ...@@ -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 vidc_mod-objs := vidc.o vidc_fill.o
wavefront-objs := wavfront.o wf_midi.o yss225.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 # Files generated that shall be removed upon make clean
clean-files := maui_boot.h msndperm.c msndinit.c pndsperm.c pndspini.c \ clean-files := maui_boot.h msndperm.c msndinit.c pndsperm.c pndspini.c \
......
obj-y := initramfs_data.o obj-y := initramfs_data.o
host-progs := gen_init_cpio hostprogs-y := gen_init_cpio
clean-files := initramfs_data.cpio.gz clean-files := initramfs_data.cpio.gz
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment