aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:58:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:58:43 -0400
commitb4bc7b53ccfa0cb793591ba11af49db8f1bc5a4d (patch)
treebb0d32d8c8a9d558794dbda60542beace0d2bcbc /scripts
parent0cadaf45bd7c19f0bef49d1eebfff38a046b9ba4 (diff)
parent701842e3bdd7db09db6af43fc5906ee19b61338d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: kbuild: documentation change on allowing checkers besides sparse kbuild: warn when a moduled uses a symbol marked UNUSED kbuild: fix segv in modpost kconfig: enhancing accessibility of lxdialog kbuild: fix ia64 breakage after introducing make -rR
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include4
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.host6
-rw-r--r--scripts/Makefile.lib6
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/kconfig/lxdialog/checklist.c7
-rw-r--r--scripts/mod/modpost.c94
-rw-r--r--scripts/mod/modpost.h2
8 files changed, 88 insertions, 35 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index b0d067be7390..2180c88cfe89 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -13,6 +13,10 @@ space := $(empty) $(empty)
13depfile = $(subst $(comma),_,$(@D)/.$(@F).d) 13depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
14 14
15### 15###
16# filename of target with directory and extension stripped
17basetarget = $(basename $(notdir $@))
18
19###
16# Escape single quote for use in echo statements 20# Escape single quote for use in echo statements
17escsq = $(subst $(squote),'\$(squote)',$1) 21escsq = $(subst $(squote),'\$(squote)',$1)
18 22
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 02a7eea5fdbc..3cb445cc7432 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -117,7 +117,7 @@ $(real-objs-m:.o=.lst): quiet_modtag := [M]
117$(obj-m) : quiet_modtag := [M] 117$(obj-m) : quiet_modtag := [M]
118 118
119# Default for not multi-part modules 119# Default for not multi-part modules
120modname = $(*F) 120modname = $(basetarget)
121 121
122$(multi-objs-m) : modname = $(modname-multi) 122$(multi-objs-m) : modname = $(modname-multi)
123$(multi-objs-m:.o=.i) : modname = $(modname-multi) 123$(multi-objs-m:.o=.i) : modname = $(modname-multi)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2b066d12af2c..18ecd4d5df7f 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -80,8 +80,10 @@ obj-dirs += $(host-objdirs)
80##### 80#####
81# Handle options to gcc. Support building with separate output directory 81# Handle options to gcc. Support building with separate output directory
82 82
83_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) 83_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
84_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o) 84 $(HOSTCFLAGS_$(basetarget).o)
85_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
86 $(HOSTCXXFLAGS_$(basetarget).o)
85 87
86ifeq ($(KBUILD_SRC),) 88ifeq ($(KBUILD_SRC),)
87__hostc_flags = $(_hostc_flags) 89__hostc_flags = $(_hostc_flags)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 2cb4935e85d1..fc498fee68ed 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -82,12 +82,12 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
82# than one module. In that case KBUILD_MODNAME will be set to foo_bar, 82# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
83# where foo and bar are the name of the modules. 83# where foo and bar are the name of the modules.
84name-fix = $(subst $(comma),_,$(subst -,_,$1)) 84name-fix = $(subst $(comma),_,$(subst -,_,$1))
85basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))" 85basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
86modname_flags = $(if $(filter 1,$(words $(modname))),\ 86modname_flags = $(if $(filter 1,$(words $(modname))),\
87 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 87 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
88 88
89_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) 89_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
90_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) 90_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
91_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) 91_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
92 92
93# If building the kernel in a separate objtree expand all occurrences 93# If building the kernel in a separate objtree expand all occurrences
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 576cce5e387f..a49550205dcc 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -72,7 +72,7 @@ $(modules:.ko=.mod.c): __modpost ;
72# Step 5), compile all *.mod.c files 72# Step 5), compile all *.mod.c files
73 73
74# modname is set to make c_flags define KBUILD_MODNAME 74# modname is set to make c_flags define KBUILD_MODNAME
75modname = $(*F) 75modname = $(notdir $(@:.mod.o=))
76 76
77quiet_cmd_cc_o_c = CC $@ 77quiet_cmd_cc_o_c = CC $@
78 cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE) \ 78 cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE) \
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index be0200e9cdaf..79886413b6d5 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -187,9 +187,12 @@ int dialog_checklist(const char *title, const char *prompt, int height,
187 187
188 /* Print the list */ 188 /* Print the list */
189 for (i = 0; i < max_choice; i++) { 189 for (i = 0; i < max_choice; i++) {
190 print_item(list, items[(scroll + i) * 3 + 1], 190 if (i != choice)
191 status[i + scroll], i, i == choice); 191 print_item(list, items[(scroll + i) * 3 + 1],
192 status[i + scroll], i, 0);
192 } 193 }
194 print_item(list, items[(scroll + choice) * 3 + 1],
195 status[choice + scroll], choice, 1);
193 196
194 print_arrows(dialog, choice, item_no, scroll, 197 print_arrows(dialog, choice, item_no, scroll,
195 box_y, box_x + check_x + 5, list_height); 198 box_y, box_x + check_x + 5, list_height);
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0dd16177642d..dfde0e87a765 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -24,7 +24,10 @@ static int all_versions = 0;
24/* If we are modposting external module set to 1 */ 24/* If we are modposting external module set to 1 */
25static int external_module = 0; 25static int external_module = 0;
26/* How a symbol is exported */ 26/* How a symbol is exported */
27enum export {export_plain, export_gpl, export_gpl_future, export_unknown}; 27enum export {
28 export_plain, export_unused, export_gpl,
29 export_unused_gpl, export_gpl_future, export_unknown
30};
28 31
29void fatal(const char *fmt, ...) 32void fatal(const char *fmt, ...)
30{ 33{
@@ -191,7 +194,9 @@ static struct {
191 enum export export; 194 enum export export;
192} export_list[] = { 195} export_list[] = {
193 { .str = "EXPORT_SYMBOL", .export = export_plain }, 196 { .str = "EXPORT_SYMBOL", .export = export_plain },
197 { .str = "EXPORT_UNUSED_SYMBOL", .export = export_unused },
194 { .str = "EXPORT_SYMBOL_GPL", .export = export_gpl }, 198 { .str = "EXPORT_SYMBOL_GPL", .export = export_gpl },
199 { .str = "EXPORT_UNUSED_SYMBOL_GPL", .export = export_unused_gpl },
195 { .str = "EXPORT_SYMBOL_GPL_FUTURE", .export = export_gpl_future }, 200 { .str = "EXPORT_SYMBOL_GPL_FUTURE", .export = export_gpl_future },
196 { .str = "(unknown)", .export = export_unknown }, 201 { .str = "(unknown)", .export = export_unknown },
197}; 202};
@@ -205,6 +210,8 @@ static const char *export_str(enum export ex)
205static enum export export_no(const char * s) 210static enum export export_no(const char * s)
206{ 211{
207 int i; 212 int i;
213 if (!s)
214 return export_unknown;
208 for (i = 0; export_list[i].export != export_unknown; i++) { 215 for (i = 0; export_list[i].export != export_unknown; i++) {
209 if (strcmp(export_list[i].str, s) == 0) 216 if (strcmp(export_list[i].str, s) == 0)
210 return export_list[i].export; 217 return export_list[i].export;
@@ -216,8 +223,12 @@ static enum export export_from_sec(struct elf_info *elf, Elf_Section sec)
216{ 223{
217 if (sec == elf->export_sec) 224 if (sec == elf->export_sec)
218 return export_plain; 225 return export_plain;
226 else if (sec == elf->export_unused_sec)
227 return export_unused;
219 else if (sec == elf->export_gpl_sec) 228 else if (sec == elf->export_gpl_sec)
220 return export_gpl; 229 return export_gpl;
230 else if (sec == elf->export_unused_gpl_sec)
231 return export_unused_gpl;
221 else if (sec == elf->export_gpl_future_sec) 232 else if (sec == elf->export_gpl_future_sec)
222 return export_gpl_future; 233 return export_gpl_future;
223 else 234 else
@@ -366,8 +377,12 @@ static void parse_elf(struct elf_info *info, const char *filename)
366 info->modinfo_len = sechdrs[i].sh_size; 377 info->modinfo_len = sechdrs[i].sh_size;
367 } else if (strcmp(secname, "__ksymtab") == 0) 378 } else if (strcmp(secname, "__ksymtab") == 0)
368 info->export_sec = i; 379 info->export_sec = i;
380 else if (strcmp(secname, "__ksymtab_unused") == 0)
381 info->export_unused_sec = i;
369 else if (strcmp(secname, "__ksymtab_gpl") == 0) 382 else if (strcmp(secname, "__ksymtab_gpl") == 0)
370 info->export_gpl_sec = i; 383 info->export_gpl_sec = i;
384 else if (strcmp(secname, "__ksymtab_unused_gpl") == 0)
385 info->export_unused_gpl_sec = i;
371 else if (strcmp(secname, "__ksymtab_gpl_future") == 0) 386 else if (strcmp(secname, "__ksymtab_gpl_future") == 0)
372 info->export_gpl_future_sec = i; 387 info->export_gpl_future_sec = i;
373 388
@@ -1085,38 +1100,64 @@ void buf_write(struct buffer *buf, const char *s, int len)
1085 buf->pos += len; 1100 buf->pos += len;
1086} 1101}
1087