From eed380f3f5933edb8f4c055ba34ae7908ed38565 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Mon, 23 Sep 2013 15:23:54 +0930 Subject: modpost: Optionally ignore secondary errors seen if a single module build fails Commit ea4054a23 (modpost: handle huge numbers of modules) added support for building a large number of modules. Unfortunately, the commit changed the semantics of the makefile: Instead of passing only existing object files to modpost, make now passes all expected object files. If make was started with option -i, this results in a modpost error if a single file failed to build. Example with the current btrfs build falure on m68k: fs/btrfs/btrfs.o: No such file or directory make[1]: [__modpost] Error 1 (ignored) This error is followed by lots of errors such as: m68k-linux-gcc: error: arch/m68k/emu/nfcon.mod.c: No such file or directory m68k-linux-gcc: fatal error: no input files compilation terminated. make[1]: [arch/m68k/emu/nfcon.mod.o] Error 1 (ignored) This doesn't matter much for normal builds, but it is annoying for builds started with "make -i" due to the large number of secondary errors. Those errors unnececessarily clog any error log and make it difficult to find the real errors in the build. Fix the problem by adding a new parameter '-n' to modpost. If this parameter is specified, modpost reports but ignores missing object files. With this patch, error output from above problem is (with make -i): m68k-linux-ld: cannot find fs/btrfs/ioctl.o: No such file or directory make[2]: [fs/btrfs/btrfs.o] Error 1 (ignored) ... fs/btrfs/btrfs.o: No such file or directory (ignored) Cc: Rusty Russell Cc: Michael Marek Signed-off-by: Guenter Roeck Signed-off-by: Rusty Russell --- scripts/Makefile.modpost | 4 +++- scripts/mod/modpost.c | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 8dcdca2..69f0a14 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -79,9 +79,11 @@ modpost = scripts/mod/modpost \ $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) +MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS))) + # We can go over command line length here, so be careful. quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules - cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) -s -T - + cmd_modpost = $(MODLISTCMD) | sed 's/\.ko$$/.o/' | $(modpost) $(MODPOST_OPT) -s -T - PHONY += __modpost __modpost: $(modules:.ko=.o) FORCE diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 8247979..393706b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "modpost.h" #include "../../include/generated/autoconf.h" #include "../../include/linux/license.h" @@ -37,6 +38,8 @@ static int warn_unresolved = 0; /* How a symbol is exported */ static int sec_mismatch_count = 0; static int sec_mismatch_verbose = 1; +/* ignore missing files */ +static int ignore_missing_files; enum export { export_plain, export_unused, export_gpl, @@ -407,6 +410,11 @@ static int parse_elf(struct elf_info *info, const char *filename) hdr = grab_file(filename, &info->size); if (!hdr) { + if (ignore_missing_files) { + fprintf(stderr, "%s: %s (ignored)\n", filename, + strerror(errno)); + return 0; + } perror(filename); exit(1); } @@ -2119,7 +2127,7 @@ int main(int argc, char **argv) struct ext_sym_list *extsym_iter; struct ext_sym_list *extsym_start = NULL; - while ((opt = getopt(argc, argv, "i:I:e:msST:o:awM:K:")) != -1) { + while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:")) != -1) { switch (opt) { case 'i': kernel_read = optarg; @@ -2139,6 +2147,9 @@ int main(int argc, char **argv) case 'm': modversions = 1; break; + case 'n': + ignore_missing_files = 1; + break; case 'o': dump_write = optarg; break; -- cgit v1.1 From d1d85780dd30e137d8ff505c1c2e79eaf729853d Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 24 Sep 2013 15:27:46 -0700 Subject: checkpatch: make extern in .h prototypes quieter The use of extern in .h files is a bit contentious. Make the warning be emitted only when --strict is used on the command line. Signed-off-by: Joe Perches Cc: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 47016c3..66cad50 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3975,8 +3975,8 @@ sub string_find_replace { # check for new externs in .h files. if ($realfile =~ /\.h$/ && $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { - if (WARN("AVOID_EXTERNS", - "extern prototypes should be avoided in .h files\n" . $herecurr) && + if (CHK("AVOID_EXTERNS", + "extern prototypes should be avoided in .h files\n" . $herecurr) && $fix) { $fixed[$linenr - 1] =~ s/(.*)\bextern\b\s*(.*)/$1$2/; } -- cgit v1.1 From eb8948a03704f3dbbfc7e83090e20e93c6c476d2 Mon Sep 17 00:00:00 2001 From: Antonio Alecrim Jr Date: Mon, 16 Sep 2013 11:04:54 -0300 Subject: X.509: remove possible code fragility: enumeration values not handled Signed-off-by: Antonio Alecrim Jr Signed-off-by: David Howells --- scripts/asn1_compiler.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index db0e5cd..91c4117 100644 --- a/scripts/asn1_compiler.c +++ b/scripts/asn1_compiler.c @@ -1353,6 +1353,8 @@ static void render_out_of_line_list(FILE *out) render_opcode(out, "ASN1_OP_END_SET_OF%s,\n", act); render_opcode(out, "_jump_target(%u),\n", entry); break; + default: + break; } if (e->action) render_opcode(out, "_action(ACT_%s),\n", -- cgit v1.1 From 31bfb10820301b26debeb26465d5bff7b1f11a37 Mon Sep 17 00:00:00 2001 From: Martin Walch Date: Thu, 3 Oct 2013 17:21:23 +0200 Subject: kconfig: add short explanation to SYMBOL_WRITE replace the question mark in the comment after SYMBOL_WRITE with an explanation Signed-off-by: Martin Walch Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/expr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index df198a5..ba663e1 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -93,7 +93,7 @@ struct symbol { #define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */ #define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */ #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ -#define SYMBOL_WRITE 0x0200 /* ? */ +#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ #define SYMBOL_CHANGED 0x0400 /* ? */ #define SYMBOL_AUTO 0x1000 /* value from environment variable */ #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ -- cgit v1.1 From 8d9dfe8276750aaf30ca1b59b4c3f9349377cb6e Mon Sep 17 00:00:00 2001 From: Martin Walch Date: Thu, 3 Oct 2013 17:28:14 +0200 Subject: kconfig: fix trivial typos and update mconf documentation This fixes lots of typos in comments and strings. It also updates the documentation strings in mconf to reflect the changes in the user interface from the two commits 6364fd0cb1e4c7f72b974613e0cf5744ae4d2cb2 menuconfig: Add Save/Load buttons 1bdbac478a858d2aa73a6784c7c2e09de0f6d06b menuconfig: Get rid of the top-level entries for "Load an Alternate/Save an Alternate" And it updates the layout of the example search result, i. e. moves down the "Defined at" and "Depends on" lines and adds a symbol state ([=n]) to the symbol in the "Selected by" line. Furthermore, the help texts now should fit in 80 columns again when viewed in mconf. Signed-off-by: Martin Walch Reviewed-by: Jean Delvare Reviewed-by: Wang YanQing Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/mconf.c | 60 +++++++++++++++++++++++------------------------- scripts/kconfig/menu.c | 2 +- scripts/kconfig/symbol.c | 2 +- 3 files changed, 31 insertions(+), 33 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 2c39631..59184bb 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -25,7 +25,7 @@ static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"This interface let you select features and parameters for the build.\n" +"This interface lets you select features and parameters for the build.\n" "Features can either be built-in, modularized, or ignored. Parameters\n" "must be entered in as decimal or hexadecimal numbers or text.\n" "\n" @@ -39,15 +39,15 @@ static const char mconf_readme[] = N_( "\n" "To change any of these features, highlight it with the cursor\n" "keys and press to build it in, to make it a module or\n" -" to removed it. You may also press the to cycle\n" -"through the available options (ie. Y->N->M->Y).\n" +" to remove it. You may also press the to cycle\n" +"through the available options (i.e. Y->N->M->Y).\n" "\n" "Some additional keyboard hints:\n" "\n" "Menus\n" "----------\n" -"o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" -" you wish to change or submenu wish to select and press .\n" +"o Use the Up/Down arrow keys (cursor keys) to highlight the item you\n" +" wish to change or the submenu you wish to select and press .\n" " Submenus are designated by \"--->\", empty ones by \"----\".\n" "\n" " Shortcut: Press the option's highlighted letter (hotkey).\n" @@ -65,7 +65,7 @@ static const char mconf_readme[] = N_( " there is a delayed response which you may find annoying.\n" "\n" " Also, the and cursor keys will cycle between