Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/mmarek/kbuild-2.6

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kbuild: Make DEBUG_SECTION_MISMATCH selectable, but not on by default
  genksyms: Regenerate lexer and parser
  genksyms: Track changes to enum constants
  genksyms: simplify usage of find_symbol()
  genksyms: Add helpers for building string lists
  genksyms: Simplify printing of symbol types
  genksyms: Simplify lexer
  genksyms: Do not paste the bison header file to lex.c
  modpost: fix trailing comma
  KBuild: silence "'scripts/unifdef' is up to date."
  kbuild: Add extra gcc checks
  kbuild: reenable section mismatch analysis
  unifdef: update to upstream version 2.5
  • Loading branch information
torvalds committed Mar 21, 2011
2 parents 0bf8c86 + f2c23f6 commit eddecbb
Show file tree
Hide file tree
Showing 15 changed files with 1,237 additions and 941 deletions.
5 changes: 5 additions & 0 deletions Documentation/kbuild/kbuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,8 @@ to be included in the databases, separated by blank space. E.g.:
To get all available archs you can also specify all. E.g.:

$ make ALLSOURCE_ARCHS=all tags

KBUILD_ENABLE_EXTRA_GCC_CHECKS
--------------------------------------------------
If enabled over the make command line with "W=1", it turns on additional
gcc -W... options for more extensive build-time checking.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
endif

ifeq ("$(origin W)", "command line")
export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1
endif

# That's our default target when none is given on the command line
PHONY := _all
_all:
Expand Down Expand Up @@ -1018,7 +1022,7 @@ hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)

PHONY += __headers
__headers: include/linux/version.h scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
$(Q)$(MAKE) $(build)=scripts build_unifdef

PHONY += headers_install_all
headers_install_all:
Expand Down Expand Up @@ -1263,6 +1267,7 @@ help:
@echo ' make O=dir [targets] Locate all output files in "dir", including .config'
@echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
@echo ' make C=2 [targets] Force check of all c source with $$CHECK'
@echo ' make W=1 [targets] Enable extra gcc checks'
@echo ''
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README file'
Expand Down
5 changes: 0 additions & 5 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ config HEADERS_CHECK

config DEBUG_SECTION_MISMATCH
bool "Enable full Section mismatch analysis"
depends on UNDEFINED || (BLACKFIN)
default y
# This option is on purpose disabled for now.
# It will be enabled when we are down to a reasonable number
# of section mismatch warnings (< 10 for an allyesconfig build)
help
The section mismatch analysis checks if there are illegal
references from one section to another section.
Expand Down
5 changes: 5 additions & 0 deletions scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ always := $(hostprogs-y) $(hostprogs-m)
# The following hostprogs-y programs are only build on demand
hostprogs-y += unifdef

# This target is used internally to avoid "is up to date" messages
PHONY += build_unifdef
build_unifdef: scripts/unifdef FORCE
@:

subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-y += mod
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
Expand Down
35 changes: 34 additions & 1 deletion scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,40 @@ ifeq ($(KBUILD_NOPEDANTIC),)
$(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
endif
endif

#
# make W=1 settings
#
# $(call cc-option... ) handles gcc -W.. options which
# are not supported by all versions of the compiler
ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
KBUILD_EXTRA_WARNINGS := -Wextra
KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter
KBUILD_EXTRA_WARNINGS += -Waggregate-return
KBUILD_EXTRA_WARNINGS += -Wbad-function-cast
KBUILD_EXTRA_WARNINGS += -Wcast-qual
KBUILD_EXTRA_WARNINGS += -Wcast-align
KBUILD_EXTRA_WARNINGS += -Wconversion
KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization
KBUILD_EXTRA_WARNINGS += -Wlogical-op
KBUILD_EXTRA_WARNINGS += -Wmissing-declarations
KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,)
KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes
KBUILD_EXTRA_WARNINGS += -Wnested-externs
KBUILD_EXTRA_WARNINGS += -Wold-style-definition
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,)
KBUILD_EXTRA_WARNINGS += -Wpacked
KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat
KBUILD_EXTRA_WARNINGS += -Wpadded
KBUILD_EXTRA_WARNINGS += -Wpointer-arith
KBUILD_EXTRA_WARNINGS += -Wredundant-decls
KBUILD_EXTRA_WARNINGS += -Wshadow
KBUILD_EXTRA_WARNINGS += -Wswitch-default
KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,)
KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS)
endif

include scripts/Makefile.lib

ifdef host-progs
Expand Down Expand Up @@ -403,7 +437,6 @@ ifneq ($(cmd_files),)
include $(cmd_files)
endif


# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.

Expand Down
4 changes: 2 additions & 2 deletions scripts/genksyms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ $(obj)/keywords.c: $(obj)/keywords.gperf FORCE
# flex

quiet_cmd_lex.c = FLEX $@
cmd_lex.c = flex -o$@ -d $< $(obj)/parse.h
cmd_lex.c = flex -o$@ -d $<

$(obj)/lex.c: $(obj)/lex.l $(obj)/parse.h $(obj)/keywords.c FORCE
$(obj)/lex.c: $(obj)/lex.l $(obj)/keywords.c FORCE
$(call if_changed,lex.c)
cp $@ $@_shipped

Expand Down
Loading

0 comments on commit eddecbb

Please sign in to comment.