aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-09-23 01:53:54 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-09-23 02:15:03 -0400
commiteed380f3f5933edb8f4c055ba34ae7908ed38565 (patch)
treebf708f62f6ead022431cb79a65bea78889297a99 /scripts/mod
parent3f2b9c9cdf389e303b2273679af08aab5f153517 (diff)
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 <rusty@rustcorp.com.au> Cc: Michael Marek <mmarek@suse.cz> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8247979e8f64..393706b37774 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -17,6 +17,7 @@
17#include <string.h> 17#include <string.h>
18#include <limits.h> 18#include <limits.h>
19#include <stdbool.h> 19#include <stdbool.h>
20#include <errno.h>
20#include "modpost.h" 21#include "modpost.h"
21#include "../../include/generated/autoconf.h" 22#include "../../include/generated/autoconf.h"
22#include "../../include/linux/license.h" 23#include "../../include/linux/license.h"
@@ -37,6 +38,8 @@ static int warn_unresolved = 0;
37/* How a symbol is exported */ 38/* How a symbol is exported */
38static int sec_mismatch_count = 0; 39static int sec_mismatch_count = 0;
39static int sec_mismatch_verbose = 1; 40static int sec_mismatch_verbose = 1;
41/* ignore missing files */
42static int ignore_missing_files;
40 43
41enum export { 44enum export {
42 export_plain, export_unused, export_gpl, 45 export_plain, export_unused, export_gpl,
@@ -407,6 +410,11 @@ static int parse_elf(struct elf_info *info, const char *filename)
407 410
408 hdr = grab_file(filename, &info->size); 411 hdr = grab_file(filename, &info->size);
409 if (!hdr) { 412 if (!hdr) {
413 if (ignore_missing_files) {
414 fprintf(stderr, "%s: %s (ignored)\n", filename,
415 strerror(errno));
416 return 0;
417 }
410 perror(filename); 418 perror(filename);
411 exit(1); 419 exit(1);
412 } 420 }
@@ -2119,7 +2127,7 @@ int main(int argc, char **argv)
2119 struct ext_sym_list *extsym_iter; 2127 struct ext_sym_list *extsym_iter;
2120 struct ext_sym_list *extsym_start = NULL; 2128 struct ext_sym_list *extsym_start = NULL;
2121 2129
2122 while ((opt = getopt(argc, argv, "i:I:e:msST:o:awM:K:")) != -1) { 2130 while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:")) != -1) {
2123 switch (opt) { 2131 switch (opt) {
2124 case 'i': 2132 case 'i':
2125 kernel_read = optarg; 2133 kernel_read = optarg;
@@ -2139,6 +2147,9 @@ int main(int argc, char **argv)
2139 case 'm': 2147 case 'm':
2140 modversions = 1; 2148 modversions = 1;
2141 break; 2149 break;
2150 case 'n':
2151 ignore_missing_files = 1;
2152 break;
2142 case 'o': 2153 case 'o':
2143 dump_write = optarg; 2154 dump_write = optarg;
2144 break; 2155 break;