diff options
author | Michal Marek <mmarek@suse.cz> | 2011-03-11 16:34:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-13 18:59:58 -0400 |
commit | 7840fea200cd1ad93ed19853a83752a21f691326 (patch) | |
tree | e13f604355993207d34cc5abe335ec944ff871d7 /scripts/mod | |
parent | e8444a3e3b56b268c6ca31a2f77040fd944834fb (diff) |
kbuild: Fix computing srcversion for modules
Recent change to fixdep:
commit b7bd182176960fdd139486cadb9962b39f8a2b50
Author: Michal Marek <mmarek@suse.cz>
Date: Thu Feb 17 15:13:54 2011 +0100
fixdep: Do not record dependency on the source file itself
changed the format of the *.cmd files without realizing that it is also
used by modpost. Put the path to the source file to the file back, in a
special variable, so that modpost sees all source files when calculating
srcversion for modules.
Reported-and-tested-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/sumversion.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index ecf9c7dc1825..9dfcd6d988da 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c | |||
@@ -300,8 +300,8 @@ static int is_static_library(const char *objfile) | |||
300 | return 0; | 300 | return 0; |
301 | } | 301 | } |
302 | 302 | ||
303 | /* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to | 303 | /* We have dir/file.o. Open dir/.file.o.cmd, look for source_ and deps_ line |
304 | * figure out source file. */ | 304 | * to figure out source files. */ |
305 | static int parse_source_files(const char *objfile, struct md4_ctx *md) | 305 | static int parse_source_files(const char *objfile, struct md4_ctx *md) |
306 | { | 306 | { |
307 | char *cmd, *file, *line, *dir; | 307 | char *cmd, *file, *line, *dir; |
@@ -340,6 +340,21 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md) | |||
340 | */ | 340 | */ |
341 | while ((line = get_next_line(&pos, file, flen)) != NULL) { | 341 | while ((line = get_next_line(&pos, file, flen)) != NULL) { |
342 | char* p = line; | 342 | char* p = line; |
343 | |||
344 | if (strncmp(line, "source_", sizeof("source_")-1) == 0) { | ||
345 | p = strrchr(line, ' '); | ||
346 | if (!p) { | ||
347 | warn("malformed line: %s\n", line); | ||
348 | goto out_file; | ||
349 | } | ||
350 | p++; | ||
351 | if (!parse_file(p, md)) { | ||
352 | warn("could not open %s: %s\n", | ||
353 | p, strerror(errno)); | ||
354 | goto out_file; | ||
355 | } | ||
356 | continue; | ||
357 | } | ||
343 | if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) { | 358 | if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) { |
344 | check_files = 1; | 359 | check_files = 1; |
345 | continue; | 360 | continue; |