History

Merge tag 'kbuild-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada: "Build system: - add CONFIG_UNUSED_KSYMS_WHITELIST, which will be useful to define a fixed set of export symbols for Generic Kernel Image (GKI) - allow to run 'make dt_binding_check' without .config - use full schema for checking DT examples in *.yaml files - make modpost fail for missing MODULE_IMPORT_NS(), which makes more sense because we know the produced modules are never loadable - Remove unused 'AS' variable Kconfig: - sanitize DEFCONFIG_LIST, and remove ARCH_DEFCONFIG from Kconfig files - relax the 'imply' behavior so that symbols implied by 'y' can become 'm' - make 'imply' obey 'depends on' in order to make 'imply' really weak Misc: - add documentation on building the kernel with Clang/LLVM - revive __HAVE_ARCH_STRLEN for 32bit sparc to use optimized strlen() - fix warning from deb-pkg builds when CONFIG_DEBUG_INFO=n - various script and Makefile cleanups" * tag 'kbuild-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) Makefile: Update kselftest help information kbuild: deb-pkg: fix warning when CONFIG_DEBUG_INFO is unset kbuild: add outputmakefile to no-dot-config-targets kbuild: remove AS variable net: wan: wanxl: refactor the firmware rebuild rule net: wan: wanxl: use $(M68KCC) instead of $(M68KAS) for rebuilding firmware net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware kbuild: add comment about grouped target kbuild: add -Wall to KBUILD_HOSTCXXFLAGS kconfig: remove unused variable in qconf.cc sparc: revive __HAVE_ARCH_STRLEN for 32bit sparc kbuild: refactor Makefile.dtbinst more kbuild: compute the dtbs_install destination more simply Makefile: disallow data races on gcc-10 as well kconfig: make 'imply' obey the direct dependency kconfig: allow symbols implied by y to become m net: drop_monitor: use IS_REACHABLE() to guard net_dm_hw_report() modpost: return error if module is missing ns imports and MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=n modpost: rework and consolidate logging interface kbuild: allow to run dt_binding_check without kernel configuration ...

Linus Torvalds committed 6 years ago

Commit 5b67fbf2 parents a162984 e51d8da35 files · +356 −200Browse files

Showing the changes to scripts (15 of 35 files). Show all

Unified · Split

15 files
  1. scripts/Makefile.dtbinst +11 −15
  2. scripts/Makefile.lib +2 −1
  3. scripts/Makefile.modpost +8 −7
  4. scripts/adjust_autoksyms.sh +4 −20
  5. scripts/basic/fixdep.c +2 −8
  6. scripts/dtc/Makefile +3 −2
  7. scripts/gcc-plugins/Makefile +1 −1
  8. scripts/gen_autoksyms.sh +52 −0
  9. scripts/kconfig/Makefile +0 −4
  10. scripts/kconfig/qconf.cc +0 −2
  11. scripts/kconfig/symbol.c +4 −5
  12. scripts/mkcompile_h +0 −11
  13. scripts/mod/modpost.c +40 −43
  14. scripts/mod/modpost.h +11 −3
  15. scripts/package/mkdebian +5 −0
scripts/Makefile.dtbinst+11−15
@@ -13,28 +13,24 @@ src := $(obj) · 12 unmodified lines
1313 PHONY := __dtbs_install
1414 __dtbs_install:
1515
16−export dtbinst_root ?= $(obj)
17−
1816 include include/config/auto.conf
1917 include scripts/Kbuild.include
2018 include $(src)/Makefile
2119
22−dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))
23−dtbinst-dirs := $(subdir-y) $(subdir-m)
24−
25−# Helper targets for Installing DTBs into the boot directory
26−quiet_cmd_dtb_install = INSTALL $<
27− cmd_dtb_install = mkdir -p $(2); cp $< $(2)
20+dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
21+subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
2822
29−install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
23+__dtbs_install: $(dtbs) $(subdirs)
24+ @:
3025
31−$(dtbinst-files): %.dtb: $(obj)/%.dtb
32− $(call cmd,dtb_install,$(install-dir))
26+quiet_cmd_dtb_install = INSTALL $@
27+ cmd_dtb_install = install -D $< $@
3328
34−$(dtbinst-dirs):
35− $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
29+$(dst)/%.dtb: $(obj)/%.dtb
30+ $(call cmd,dtb_install)
3631
37−PHONY += $(dtbinst-files) $(dtbinst-dirs)
38−__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
32+PHONY += $(subdirs)
33+$(subdirs):
34+ $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
3935
4036 .PHONY: $(PHONY)
scripts/Makefile.lib+2−1
@@ -297,7 +297,8 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE · 296 unmodified lines
297297
298298 DT_CHECKER ?= dt-validate
299299 DT_BINDING_DIR := Documentation/devicetree/bindings
300−DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
300+# DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
301+DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
301302
302303 quiet_cmd_dtb_check = CHECK $@
303304 cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
scripts/Makefile.modpost+8−7
@@ -46,13 +46,14 @@ include scripts/Kbuild.include · 45 unmodified lines
4646 kernelsymfile := $(objtree)/Module.symvers
4747 modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
4848
49−MODPOST = scripts/mod/modpost \
50− $(if $(CONFIG_MODVERSIONS),-m) \
51− $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
52− $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
53− $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
54− $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
55− $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
49+MODPOST = scripts/mod/modpost \
50+ $(if $(CONFIG_MODVERSIONS),-m) \
51+ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
52+ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
53+ $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
54+ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
55+ $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
56+ $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
5657 $(if $(KBUILD_MODPOST_WARN),-w)
5758
5859 ifdef MODPOST_VMLINUX
scripts/adjust_autoksyms.sh+4−20
@@ -1,14 +1,13 @@
11 #!/bin/sh
22 # SPDX-License-Identifier: GPL-2.0-only
33
4−# Script to create/update include/generated/autoksyms.h and dependency files
4+# Script to update include/generated/autoksyms.h and dependency files
55 #
66 # Copyright: (C) 2016 Linaro Limited
77 # Created by: Nicolas Pitre, January 2016
88 #
99
10−# Create/update the include/generated/autoksyms.h file from the list
11−# of all module's needed symbols as recorded on the second line of *.mod files.
10+# Update the include/generated/autoksyms.h file.
1211 #
1312 # For each symbol being added or removed, the corresponding dependency
1413 # file's timestamp is updated to force a rebuild of the affected source
@@ -38,23 +37,8 @@ esac · 23 unmodified lines
3837 # We need access to CONFIG_ symbols
3938 . include/config/auto.conf
4039
41−# Generate a new ksym list file with symbols needed by the current
42−# set of modules.
43−cat > "$new_ksyms_file" << EOT
44−/*
45− * Automatically generated file; DO NOT EDIT.
46− */
47−
48−EOT
49−sed 's/ko$/mod/' modules.order |
50−xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
51−sort -u |
52−sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file"
53−
54−# Special case for modversions (see modpost.c)
55−if [ -n "$CONFIG_MODVERSIONS" ]; then
56− echo "#define __KSYM_module_layout 1" >> "$new_ksyms_file"
57−fi
40+# Generate a new symbol list file
41+$CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file"
5842
5943 # Extract changes between old and new list and touch corresponding
6044 # dependency files.
scripts/basic/fixdep.c+2−8
@@ -77,11 +77,6 @@ · 76 unmodified lines
7777 * dependencies on include/config/my/option.h for every
7878 * CONFIG_MY_OPTION encountered in any of the prerequisites.
7979 *
80− * It will also filter out all the dependencies on *.ver. We need
81− * to make sure that the generated version checksum are globally up
82− * to date before even starting the recursive build, so it's too late
83− * at this point anyway.
84− *
8580 * We don't even try to really parse the header files, but
8681 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will
8782 * be picked up as well. It's not a problem with respect to
@@ -251,7 +246,7 @@ static void parse_config_file(const char *p) · 163 unmodified lines
251246 }
252247 p += 7;
253248 q = p;
254− while (*q && (isalnum(*q) || *q == '_'))
249+ while (isalnum(*q) || *q == '_')
255250 q++;
256251 if (str_ends_with(p, q - p, "_MODULE"))
257252 r = q - 7;
@@ -299,8 +294,7 @@ static void *read_file(const char *filename) · 41 unmodified lines
299294 static int is_ignored_file(const char *s, int len)
300295 {
301296 return str_ends_with(s, len, "include/generated/autoconf.h") ||
302− str_ends_with(s, len, "include/generated/autoksyms.h") ||
303− str_ends_with(s, len, ".ver");
297+ str_ends_with(s, len, "include/generated/autoksyms.h");
304298 }
305299
306300 /*
scripts/dtc/Makefile+3−2
@@ -1,8 +1,9 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # scripts/dtc makefile
33
4−hostprogs := dtc
5−always-$(CONFIG_DTC) := $(hostprogs)
4+hostprogs := dtc
5+always-$(CONFIG_DTC) += $(hostprogs)
6+always-$(CHECK_DT_BINDING) += $(hostprogs)
67
78 dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
89 srcpos.o checks.o util.o
scripts/gcc-plugins/Makefile+1−1
@@ -10,7 +10,7 @@ else · 9 unmodified lines
1010 HOSTLIBS := hostcxxlibs
1111 HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
1212 HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
13− HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable
13+ HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
1414 export HOST_EXTRACXXFLAGS
1515 endif
1616
scripts/gen_autoksyms.sh+52−0
@@ -0,0 +1,52 @@
1+#!/bin/sh
2+# SPDX-License-Identifier: GPL-2.0-only
3+
4+# Create an autoksyms.h header file from the list of all module's needed symbols
5+# as recorded on the second line of *.mod files and the user-provided symbol
6+# whitelist.
7+
8+set -e
9+
10+output_file="$1"
11+
12+# Use "make V=1" to debug this script.
13+case "$KBUILD_VERBOSE" in
14+*1*)
15+ set -x
16+ ;;
17+esac
18+
19+# We need access to CONFIG_ symbols
20+. include/config/auto.conf
21+
22+ksym_wl=/dev/null
23+if [ -n "$CONFIG_UNUSED_KSYMS_WHITELIST" ]; then
24+ # Use 'eval' to expand the whitelist path and check if it is relative
25+ eval ksym_wl="$CONFIG_UNUSED_KSYMS_WHITELIST"
26+ [ "${ksym_wl}" != "${ksym_wl#/}" ] || ksym_wl="$abs_srctree/$ksym_wl"
27+ if [ ! -f "$ksym_wl" ] || [ ! -r "$ksym_wl" ]; then
28+ echo "ERROR: '$ksym_wl' whitelist file not found" >&2
29+ exit 1
30+ fi
31+fi
32+
33+# Generate a new ksym list file with symbols needed by the current
34+# set of modules.
35+cat > "$output_file" << EOT
36+/*
37+ * Automatically generated file; DO NOT EDIT.
38+ */
39+
40+EOT
41+
42+[ -f modules.order ] && modlist=modules.order || modlist=/dev/null
43+sed 's/ko$/mod/' $modlist |
44+xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
45+cat - "$ksym_wl" |
46+sort -u |
47+sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
48+
49+# Special case for modversions (see modpost.c)
50+if [ -n "$CONFIG_MODVERSIONS" ]; then
51+ echo "#define __KSYM_module_layout 1" >> "$output_file"
52+fi
scripts/kconfig/Makefile+0−4
@@ -12,10 +12,6 @@ else · 11 unmodified lines
1212 Kconfig := Kconfig
1313 endif
1414
15−ifndef KBUILD_DEFCONFIG
16−KBUILD_DEFCONFIG := defconfig
17−endif
18−
1915 ifeq ($(quiet),silent_)
2016 silent := -s
2117 endif
scripts/kconfig/qconf.cc+0−2
@@ -309,8 +309,6 @@ ConfigList::ConfigList(ConfigView* p, const char *name) · 308 unmodified lines
309309 showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
310310 rootEntry(0), headerPopup(0)
311311 {
312− int i;
313−
314312 setObjectName(name);
315313 setSortingEnabled(false);
316314 setRootIsDecorated(true);
scripts/kconfig/symbol.c+4−5
@@ -221,7 +221,7 @@ static void sym_calc_visibility(struct symbol *sym) · 220 unmodified lines
221221 sym_set_changed(sym);
222222 }
223223 tri = no;
224− if (sym->implied.expr && sym->dir_dep.tri != no)
224+ if (sym->implied.expr)
225225 tri = expr_calc_value(sym->implied.expr);
226226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
227227 tri = yes;
@@ -394,6 +394,8 @@ void sym_calc_value(struct symbol *sym) · 166 unmodified lines
394394 if (sym->implied.tri != no) {
395395 sym->flags |= SYMBOL_WRITE;
396396 newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
397+ newval.tri = EXPR_AND(newval.tri,
398+ sym->dir_dep.tri);
397399 }
398400 }
399401 calc_newval:
@@ -401,8 +403,7 @@ void sym_calc_value(struct symbol *sym) · 1 unmodified line
401403 sym_warn_unmet_dep(sym);
402404 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
403405 }
404− if (newval.tri == mod &&
405− (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes))
406+ if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
406407 newval.tri = yes;
407408 break;
408409 case S_STRING:
@@ -484,8 +485,6 @@ bool sym_tristate_within_range(struct symbol *sym, tristate val) · 75 unmodified lines
484485 return false;
485486 if (sym->visible <= sym->rev_dep.tri)
486487 return false;
487− if (sym->implied.tri == yes && val == mod)
488− return false;
489488 if (sym_is_choice_value(sym) && sym->visible == yes)
490489 return val == yes;
491490 return val >= sym->rev_dep.tri && val <= sym->visible;
scripts/mkcompile_h+0−11
@@ -10,17 +10,6 @@ CC=$6 · 9 unmodified lines
1010
1111 vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
1212
13−# If compile.h exists already and we don't own autoconf.h
14−# (i.e. we're not the same user who did make *config), don't
15−# modify compile.h
16−# So "sudo make install" won't change the "compiled by <user>"
17−# do "compiled by root"
18−
19−if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
20− vecho " SKIPPED $TARGET"
21− exit 0
22−fi
23−
2413 # Do not expand names
2514 set -f
2615
scripts/mod/modpost.c+40−43
@@ -39,6 +39,8 @@ static int sec_mismatch_count = 0; · 38 unmodified lines
3939 static int sec_mismatch_fatal = 0;
4040 /* ignore missing files */
4141 static int ignore_missing_files;
42+/* If set to 1, only warn (instead of error) about missing ns imports */
43+static int allow_missing_ns_imports;
4244
4345 enum export {
4446 export_plain, export_unused, export_gpl,
@@ -51,41 +53,33 @@ enum export { · 6 unmodified lines
5153
5254 #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
5355
54−#define PRINTF __attribute__ ((format (printf, 1, 2)))
55−
56−PRINTF void fatal(const char *fmt, ...)
56+void __attribute__((format(printf, 2, 3)))
57+modpost_log(enum loglevel loglevel, const char *fmt, ...)
5758 {
5859 va_list arglist;
5960
60− fprintf(stderr, "FATAL: ");
61−
62− va_start(arglist, fmt);
63− vfprintf(stderr, fmt, arglist);
64− va_end(arglist);
65−
66− exit(1);
67−}
68−
69−PRINTF void warn(const char *fmt, ...)
70−{
71− va_list arglist;
61+ switch (loglevel) {
62+ case LOG_WARN:
63+ fprintf(stderr, "WARNING: ");
64+ break;
65+ case LOG_ERROR:
66+ fprintf(stderr, "ERROR: ");
67+ break;
68+ case LOG_FATAL:
69+ fprintf(stderr, "FATAL: ");
70+ break;
71+ default: /* invalid loglevel, ignore */
72+ break;
73+ }
7274
73− fprintf(stderr, "WARNING: ");
75+ fprintf(stderr, "modpost: ");
7476
7577 va_start(arglist, fmt);
7678 vfprintf(stderr, fmt, arglist);
7779 va_end(arglist);
78−}
79−
80−PRINTF void merror(const char *fmt, ...)
81−{
82− va_list arglist;
8380
84− fprintf(stderr, "ERROR: ");
85−
86− va_start(arglist, fmt);
87− vfprintf(stderr, fmt, arglist);
88− va_end(arglist);
81+ if (loglevel == LOG_FATAL)
82+ exit(1);
8983 }
9084
9185 static inline bool strends(const char *str, const char *postfix)
@@ -113,7 +107,7 @@ static int is_vmlinux(const char *modname) · 21 unmodified lines
113107 void *do_nofail(void *ptr, const char *expr)
114108 {
115109 if (!ptr)
116− fatal("modpost: Memory allocation failure: %s.\n", expr);
110+ fatal("Memory allocation failure: %s.\n", expr);
117111
118112 return ptr;
119113 }
@@ -2022,7 +2016,7 @@ static void read_symbols(const char *modname) · 1902 unmodified lines
20222016
20232017 license = get_modinfo(&info, "license");
20242018 if (!license && !is_vmlinux(modname))
2025− warn("modpost: missing MODULE_LICENSE() in %s\n"
2019+ warn("missing MODULE_LICENSE() in %s\n"
20262020 "see include/linux/module.h for "
20272021 "more information\n", modname);
20282022 while (license) {
@@ -2153,15 +2147,15 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s) · 124 unmodified lines
21532147
21542148 switch (exp) {
21552149 case export_gpl:
2156− fatal("modpost: GPL-incompatible module %s%s "
2150+ fatal("GPL-incompatible module %s%s "
21572151 "uses GPL-only symbol '%s'\n", m, e, s);
21582152 break;
21592153 case export_unused_gpl:
2160− fatal("modpost: GPL-incompatible module %s%s "
2154+ fatal("GPL-incompatible module %s%s "
21612155 "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
21622156 break;
21632157 case export_gpl_future:
2164− warn("modpost: GPL-incompatible module %s%s "
2158+ warn("GPL-incompatible module %s%s "
21652159 "uses future GPL-only symbol '%s'\n", m, e, s);
21662160 break;
21672161 case export_plain:
@@ -2179,7 +2173,7 @@ static void check_for_unused(enum export exp, const char *m, const char *s) · 11 unmodified lines
21792173 switch (exp) {
21802174 case export_unused:
21812175 case export_unused_gpl:
2182− warn("modpost: module %s%s "
2176+ warn("module %s%s "
21832177 "uses symbol '%s' marked UNUSED\n", m, e, s);
21842178 break;
21852179 default:
@@ -2198,14 +2192,11 @@ static int check_exports(struct module *mod) · 12 unmodified lines
21982192 exp = find_symbol(s->name);
21992193 if (!exp || exp->module == mod) {
22002194 if (have_vmlinux && !s->weak) {
2201− if (warn_unresolved) {
2202− warn("\"%s\" [%s.ko] undefined!\n",
2203− s->name, mod->name);
2204− } else {
2205− merror("\"%s\" [%s.ko] undefined!\n",
2206− s->name, mod->name);
2195+ modpost_log(warn_unresolved ? LOG_WARN : LOG_ERROR,
2196+ "\"%s\" [%s.ko] undefined!\n",
2197+ s->name, mod->name);
2198+ if (!warn_unresolved)
22072199 err = 1;
2208− }
22092200 }
22102201 continue;
22112202 }
@@ -2217,8 +2208,11 @@ static int check_exports(struct module *mod) · 5 unmodified lines
22172208
22182209 if (exp->namespace &&
22192210 !module_imports_namespace(mod, exp->namespace)) {
2220− warn("module %s uses symbol %s from namespace %s, but does not import it.\n",
2221− basename, exp->name, exp->namespace);
2211+ modpost_log(allow_missing_ns_imports ? LOG_WARN : LOG_ERROR,
2212+ "module %s uses symbol %s from namespace %s, but does not import it.\n",
2213+ basename, exp->name, exp->namespace);
2214+ if (!allow_missing_ns_imports)
2215+ err = 1;
22222216 add_namespace(&mod->missing_namespaces, exp->namespace);
22232217 }
22242218
@@ -2565,7 +2559,7 @@ int main(int argc, char **argv) · 340 unmodified lines
25652559 struct ext_sym_list *extsym_iter;
25662560 struct ext_sym_list *extsym_start = NULL;
25672561
2568− while ((opt = getopt(argc, argv, "i:e:mnsT:o:awEd:")) != -1) {
2562+ while ((opt = getopt(argc, argv, "i:e:mnsT:o:awENd:")) != -1) {
25692563 switch (opt) {
25702564 case 'i':
25712565 kernel_read = optarg;
@@ -2603,6 +2597,9 @@ int main(int argc, char **argv) · 31 unmodified lines
26032597 case 'E':
26042598 sec_mismatch_fatal = 1;
26052599 break;
2600+ case 'N':
2601+ allow_missing_ns_imports = 1;
2602+ break;
26062603 case 'd':
26072604 missing_namespace_deps = optarg;
26082605 break;
@@ -2658,7 +2655,7 @@ int main(int argc, char **argv) · 49 unmodified lines
26582655 if (dump_write)
26592656 write_dump(dump_write);
26602657 if (sec_mismatch_count && sec_mismatch_fatal)
2661− fatal("modpost: Section mismatches detected.\n"
2658+ fatal("Section mismatches detected.\n"
26622659 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
26632660 for (n = 0; n < SYMBOL_HASH_SIZE; n++) {
26642661 struct symbol *s;
scripts/mod/modpost.h+11−3
@@ -198,6 +198,14 @@ void *grab_file(const char *filename, unsigned long *size); · 197 unmodified lines
198198 char* get_next_line(unsigned long *pos, void *file, unsigned long size);
199199 void release_file(void *file, unsigned long size);
200200
201−void fatal(const char *fmt, ...);
202−void warn(const char *fmt, ...);
203−void merror(const char *fmt, ...);
201+enum loglevel {
202+ LOG_WARN,
203+ LOG_ERROR,
204+ LOG_FATAL
205+};
206+
207+void modpost_log(enum loglevel loglevel, const char *fmt, ...);
208+
209+#define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args)
210+#define merror(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args)
211+#define fatal(fmt, args...) modpost_log(LOG_FATAL, fmt, ##args)
scripts/package/mkdebian+5−0
@@ -198,6 +198,10 @@ Description: Linux support headers for userspace development · 197 unmodified lines
198198 This package provides userspaces headers from the Linux kernel. These headers
199199 are used by the installed headers for GNU glibc and other system libraries.
200200 Multi-Arch: same
201+EOF
202+
203+if is_enabled CONFIG_DEBUG_INFO; then
204+cat <<EOF >> debian/control
201205
202206 Package: $dbg_packagename
203207 Section: debug
@@ -206,6 +210,7 @@ Description: Linux kernel debugging symbols for $version · 2 unmodified lines
206210 This package will come in handy if you need to debug the kernel. It provides
207211 all the necessary debug symbols for the kernel and its modules.
208212 EOF
213+fi
209214
210215 cat <<EOF > debian/rules
211216 #!$(command -v $MAKE) -f