fixdep is designed only for parsing text files. read_file() appends a terminating null byte ('\0') and parse_config_file() calls strstr() to search for CONFIG options. rustc outputs *.rlib, *.rmeta, *.so to dep-info. fixdep needs them in the dependency, but there is no point in parsing such binary files.
Showing the changes to scripts/basic (1 of 1 file). Show all
Unified · Split
| @@ -250,6 +250,15 @@ static int is_ignored_file(const char *s, int len) · 249 unmodified lines | ||
| 250 | 250 | str_ends_with(s, len, "include/generated/autoksyms.h"); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | +/* Do not parse these files */ | |
| 254 | +static int is_no_parse_file(const char *s, int len) | |
| 255 | +{ | |
| 256 | + /* rustc may list binary files in dep-info */ | |
| 257 | + return str_ends_with(s, len, ".rlib") || | |
| 258 | + str_ends_with(s, len, ".rmeta") || | |
| 259 | + str_ends_with(s, len, ".so"); | |
| 260 | +} | |
| 261 | + | |
| 253 | 262 | /* |
| 254 | 263 | * Important: The below generated source_foo.o and deps_foo.o variable |
| 255 | 264 | * assignments are parsed not only by make, but also by the rather simple |
| @@ -382,7 +391,7 @@ static void parse_dep_file(char *p, const char *target) · 126 unmodified lines | ||
| 382 | 391 | need_parse = true; |
| 383 | 392 | } |
| 384 | 393 | |
| 385 | − if (need_parse) { | |
| 394 | + if (need_parse && !is_no_parse_file(p, q - p)) { | |
| 386 | 395 | void *buf; |
| 387 | 396 | |
| 388 | 397 | buf = read_file(p); |