aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-06-27 11:57:47 +0200
committerRon Yorston <rmy@pobox.com>2017-07-14 13:47:26 +0100
commit32fb4fe097115b23914832d26dba4d1de62f5f17 (patch)
treeefe43532a3f5becea1438775d263621a5567e9eb
parentc2002eae394c230d6b89073c9ff71bc86a7875e8 (diff)
downloadbusybox-w32-32fb4fe097115b23914832d26dba4d1de62f5f17.tar.gz
busybox-w32-32fb4fe097115b23914832d26dba4d1de62f5f17.tar.bz2
busybox-w32-32fb4fe097115b23914832d26dba4d1de62f5f17.zip
fixdep: read the dependency files in binary mode
We want to make sure that the original line endings are preserved, as fixdep hardcodes the assumption of Unix-type line endings. The symptom is this (kinda hard to understand) error when building in Git for Windows' SDK (which is a special-purpose version of MSYS2): $ make mingw64_defconfig && make -j15 HOSTCC scripts/basic/fixdep C:/git-sdk-64/mingw64/x86_64-w64-mingw32/include/ctype.h 64-w64-mingw32/include/ctype.h: Invalid argument fixdep: make[1]: *** [scripts/Makefile.host:104: scripts/basic/fixdep] Error 2 make: *** [Makefile:358: scripts_basic] Error 2 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--scripts/basic/fixdep.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index f012551af..7bb808b9e 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -126,6 +126,10 @@
126#define INT_FIG_ ntohl(0x4649475f) 126#define INT_FIG_ ntohl(0x4649475f)
127*/ 127*/
128 128
129#ifndef O_BINARY
130#define O_BINARY 0
131#endif
132
129#ifdef __MINGW32__ 133#ifdef __MINGW32__
130#define UNUSED __attribute__ ((__unused__)) 134#define UNUSED __attribute__ ((__unused__))
131 135
@@ -337,7 +341,7 @@ void do_config_file(char *filename)
337 int fd; 341 int fd;
338 void *map; 342 void *map;
339 343
340 fd = open(filename, O_RDONLY); 344 fd = open(filename, O_RDONLY | O_BINARY);
341 if (fd < 0) { 345 if (fd < 0) {
342 fprintf(stderr, "fixdep: "); 346 fprintf(stderr, "fixdep: ");
343 perror(filename); 347 perror(filename);
@@ -408,7 +412,7 @@ void print_deps(void)
408 int fd; 412 int fd;
409 void *map; 413 void *map;
410 414
411 fd = open(depfile, O_RDONLY); 415 fd = open(depfile, O_RDONLY | O_BINARY);
412 if (fd < 0) { 416 if (fd < 0) {
413 fprintf(stderr, "fixdep: "); 417 fprintf(stderr, "fixdep: ");
414 perror(depfile); 418 perror(depfile);