diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-31 12:25:55 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-09-06 10:46:52 -0400 |
commit | e27128db62834c5b906585c2d97f0ddd431fa28f (patch) | |
tree | 14ce5ad32429d3364d18ed760c2efce3abaa2e8f | |
parent | 64a91907c896247c19f8314add2c9baa573fbd3c (diff) |
kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
KBUILD_ENABLE_EXTRA_GCC_CHECKS started as a switch to add extra warning
options for GCC, but now it is a historical misnomer since we use it
also for Clang, DTC, and even kernel-doc.
Rename it to more sensible, shorter KBUILD_EXTRA_WARN.
For the backward compatibility, KBUILD_ENABLE_EXTRA_GCC_CHECKS is still
supported (but not advertised in the documentation).
I also fixed up 'make help', and updated the documentation.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
-rw-r--r-- | Documentation/kbuild/kbuild.rst | 14 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | scripts/Makefile.build | 2 | ||||
-rw-r--r-- | scripts/Makefile.extrawarn | 13 | ||||
-rw-r--r-- | scripts/Makefile.lib | 4 | ||||
-rw-r--r-- | scripts/genksyms/Makefile | 2 |
6 files changed, 23 insertions, 14 deletions
diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst index 62f9d86c082c..f1e5dce86af7 100644 --- a/Documentation/kbuild/kbuild.rst +++ b/Documentation/kbuild/kbuild.rst | |||
@@ -105,6 +105,15 @@ The output directory can also be specified using "O=...". | |||
105 | 105 | ||
106 | Setting "O=..." takes precedence over KBUILD_OUTPUT. | 106 | Setting "O=..." takes precedence over KBUILD_OUTPUT. |
107 | 107 | ||
108 | KBUILD_EXTRA_WARN | ||
109 | ----------------- | ||
110 | Specify the extra build checks. The same value can be assigned by passing | ||
111 | W=... from the command line. | ||
112 | |||
113 | See `make help` for the list of the supported values. | ||
114 | |||
115 | Setting "W=..." takes precedence over KBUILD_EXTRA_WARN. | ||
116 | |||
108 | KBUILD_DEBARCH | 117 | KBUILD_DEBARCH |
109 | -------------- | 118 | -------------- |
110 | For the deb-pkg target, allows overriding the normal heuristics deployed by | 119 | For the deb-pkg target, allows overriding the normal heuristics deployed by |
@@ -241,11 +250,6 @@ To get all available archs you can also specify all. E.g.:: | |||
241 | 250 | ||
242 | $ make ALLSOURCE_ARCHS=all tags | 251 | $ make ALLSOURCE_ARCHS=all tags |
243 | 252 | ||
244 | KBUILD_ENABLE_EXTRA_GCC_CHECKS | ||
245 | ------------------------------ | ||
246 | If enabled over the make command line with "W=1", it turns on additional | ||
247 | gcc -W... options for more extensive build-time checking. | ||
248 | |||
249 | KBUILD_BUILD_TIMESTAMP | 253 | KBUILD_BUILD_TIMESTAMP |
250 | ---------------------- | 254 | ---------------------- |
251 | Setting this to a date string overrides the timestamp used in the | 255 | Setting this to a date string overrides the timestamp used in the |
@@ -1538,7 +1538,7 @@ help: | |||
1538 | @echo ' make C=1 [targets] Check re-compiled c source with $$CHECK (sparse by default)' | 1538 | @echo ' make C=1 [targets] Check re-compiled c source with $$CHECK (sparse by default)' |
1539 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' | 1539 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' |
1540 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' | 1540 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' |
1541 | @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where' | 1541 | @echo ' make W=n [targets] Enable extra build checks, n=1,2,3 where' |
1542 | @echo ' 1: warnings which may be relevant and do not occur too often' | 1542 | @echo ' 1: warnings which may be relevant and do not occur too often' |
1543 | @echo ' 2: warnings which occur quite often but may still be relevant' | 1543 | @echo ' 2: warnings which occur quite often but may still be relevant' |
1544 | @echo ' 3: more obscure warnings, can most likely be ignored' | 1544 | @echo ' 3: more obscure warnings, can most likely be ignored' |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2a21ca86b720..f72aba64d611 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -85,7 +85,7 @@ else ifeq ($(KBUILD_CHECKSRC),2) | |||
85 | cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< | 85 | cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< |
86 | endif | 86 | endif |
87 | 87 | ||
88 | ifneq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) | 88 | ifneq ($(KBUILD_EXTRA_WARN),) |
89 | cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< | 89 | cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< |
90 | endif | 90 | endif |
91 | 91 | ||
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index d226c5fb13e2..53eb7e0c6a5a 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn | |||
@@ -8,14 +8,19 @@ | |||
8 | 8 | ||
9 | KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) | 9 | KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) |
10 | 10 | ||
11 | # backward compatibility | ||
12 | KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS) | ||
13 | |||
11 | ifeq ("$(origin W)", "command line") | 14 | ifeq ("$(origin W)", "command line") |
12 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) | 15 | KBUILD_EXTRA_WARN := $(W) |
13 | endif | 16 | endif |
14 | 17 | ||
18 | export KBUILD_EXTRA_WARN | ||
19 | |||
15 | # | 20 | # |
16 | # W=1 - warnings which may be relevant and do not occur too often | 21 | # W=1 - warnings which may be relevant and do not occur too often |
17 | # | 22 | # |
18 | ifneq ($(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 23 | ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) |
19 | 24 | ||
20 | KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter | 25 | KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter |
21 | KBUILD_CFLAGS += -Wmissing-declarations | 26 | KBUILD_CFLAGS += -Wmissing-declarations |
@@ -48,7 +53,7 @@ endif | |||
48 | # | 53 | # |
49 | # W=2 - warnings which occur quite often but may still be relevant | 54 | # W=2 - warnings which occur quite often but may still be relevant |
50 | # | 55 | # |
51 | ifneq ($(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 56 | ifneq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) |
52 | 57 | ||
53 | KBUILD_CFLAGS += -Wcast-align | 58 | KBUILD_CFLAGS += -Wcast-align |
54 | KBUILD_CFLAGS += -Wdisabled-optimization | 59 | KBUILD_CFLAGS += -Wdisabled-optimization |
@@ -65,7 +70,7 @@ endif | |||
65 | # | 70 | # |
66 | # W=3 - more obscure warnings, can most likely be ignored | 71 | # W=3 - more obscure warnings, can most likely be ignored |
67 | # | 72 | # |
68 | ifneq ($(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 73 | ifneq ($(findstring 3, $(KBUILD_EXTRA_WARN)),) |
69 | 74 | ||
70 | KBUILD_CFLAGS += -Wbad-function-cast | 75 | KBUILD_CFLAGS += -Wbad-function-cast |
71 | KBUILD_CFLAGS += -Wcast-qual | 76 | KBUILD_CFLAGS += -Wcast-qual |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 380a7d11a573..4a0cdd6f5909 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -251,7 +251,7 @@ quiet_cmd_gzip = GZIP $@ | |||
251 | DTC ?= $(objtree)/scripts/dtc/dtc | 251 | DTC ?= $(objtree)/scripts/dtc/dtc |
252 | 252 | ||
253 | # Disable noisy checks by default | 253 | # Disable noisy checks by default |
254 | ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 254 | ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) |
255 | DTC_FLAGS += -Wno-unit_address_vs_reg \ | 255 | DTC_FLAGS += -Wno-unit_address_vs_reg \ |
256 | -Wno-unit_address_format \ | 256 | -Wno-unit_address_format \ |
257 | -Wno-avoid_unnecessary_addr_size \ | 257 | -Wno-avoid_unnecessary_addr_size \ |
@@ -262,7 +262,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ | |||
262 | -Wno-pci_device_reg | 262 | -Wno-pci_device_reg |
263 | endif | 263 | endif |
264 | 264 | ||
265 | ifneq ($(findstring 2,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 265 | ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),) |
266 | DTC_FLAGS += -Wnode_name_chars_strict \ | 266 | DTC_FLAGS += -Wnode_name_chars_strict \ |
267 | -Wproperty_name_chars_strict | 267 | -Wproperty_name_chars_strict |
268 | endif | 268 | endif |
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index baf44ed0a93a..78629f515e78 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile | |||
@@ -12,7 +12,7 @@ genksyms-objs := genksyms.o parse.tab.o lex.lex.o | |||
12 | # | 12 | # |
13 | # Just in case, run "$(YACC) --version" without suppressing stderr | 13 | # Just in case, run "$(YACC) --version" without suppressing stderr |
14 | # so that 'bison: not found' will be displayed if it is missing. | 14 | # so that 'bison: not found' will be displayed if it is missing. |
15 | ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 15 | ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) |
16 | 16 | ||
17 | quiet_cmd_bison_no_warn = $(quiet_cmd_bison) | 17 | quiet_cmd_bison_no_warn = $(quiet_cmd_bison) |
18 | cmd_bison_no_warn = $(YACC) --version >/dev/null; \ | 18 | cmd_bison_no_warn = $(YACC) --version >/dev/null; \ |