modpost: propagate W=1 build option to modpost
commit 20ff36856f upstream.
"No build warning" is a strong requirement these days, so you must fix
all issues before enabling a new warning flag.
We often add a new warning to W=1 first so that the kbuild test robot
blocks new breakages.
This commit allows modpost to show extra warnings only when W=1
(or KBUILD_EXTRA_WARN=1) is given.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Stable-dep-of: 846cfbeed09b ("um: Fix adding '-no-pie' for clang")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6286435cd0
commit
a5767decf7
@@ -44,6 +44,7 @@ modpost-args = \
|
|||||||
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
|
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
|
||||||
$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \
|
$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \
|
||||||
$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
|
$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
|
||||||
|
$(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \
|
||||||
-o $@
|
-o $@
|
||||||
|
|
||||||
# 'make -i -k' ignores compile errors, and builds as many modules as possible.
|
# 'make -i -k' ignores compile errors, and builds as many modules as possible.
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ static bool allow_missing_ns_imports;
|
|||||||
|
|
||||||
static bool error_occurred;
|
static bool error_occurred;
|
||||||
|
|
||||||
|
static bool extra_warn;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cut off the warnings when there are too many. This typically occurs when
|
* Cut off the warnings when there are too many. This typically occurs when
|
||||||
* vmlinux is missing. ('make modules' without building vmlinux.)
|
* vmlinux is missing. ('make modules' without building vmlinux.)
|
||||||
@@ -2290,7 +2292,7 @@ int main(int argc, char **argv)
|
|||||||
LIST_HEAD(dump_lists);
|
LIST_HEAD(dump_lists);
|
||||||
struct dump_list *dl, *dl2;
|
struct dump_list *dl, *dl2;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "ei:mnT:o:awENd:")) != -1) {
|
while ((opt = getopt(argc, argv, "ei:mnT:o:aWwENd:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'e':
|
case 'e':
|
||||||
external_module = true;
|
external_module = true;
|
||||||
@@ -2315,6 +2317,9 @@ int main(int argc, char **argv)
|
|||||||
case 'T':
|
case 'T':
|
||||||
files_source = optarg;
|
files_source = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'W':
|
||||||
|
extra_warn = true;
|
||||||
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
warn_unresolved = true;
|
warn_unresolved = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user