Closed Bug 381686 Opened 17 years ago Closed 17 years ago

Mingw build error

Categories

(Firefox Build System :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 381247

People

(Reporter: bengt.erik.soderstrom, Unassigned)

References

Details

Today (20070523, 6.00 UTC) I got the following build error with Mingw:

/usr/bin/make -C config export
cat: ../config/build_number: No such file or directory
make[2]: Entering directory `/cygdrive/d/mozilla/mozilla/object-mingw/config'
cat: ../../config/build_number: No such file or directory
make[3]: Entering directory `/cygdrive/d/mozilla/mozilla/object-mingw/config/mkd
epend'
/cygdrive/d/mozilla/mozilla/build/cygwin-wrapper gcc -o mkdepend.exe -mno-cygwin
 -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -O3  -DINCLUDEDIR=\"/usr/include\
" -DOBJSUFFIX=\".o\" -DPREINCDIR=\"d:/mozilla/mingw/bin/../lib/gcc/mingw32/3.4.5
/include\"  host_cppsetup.o host_ifparser.o host_include.o host_main.o host_pars
e.o host_pr.o
host_include.o:include.c:(.text+0x455): undefined reference to `IS_DIR'
host_include.o:include.c:(.text+0x611): undefined reference to `IS_DIR'
host_include.o:include.c:(.text+0x658): undefined reference to `IS_DIR'
collect2: ld returned 1 exit status
make[3]: *** [mkdepend.exe] Error 1
make[3]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/config/mkde
pend'
make[2]: *** [export] Error 2
make[2]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/config'
make[1]: *** [alldep] Error 2
Product: Firefox → Core
QA Contact: build.config → build-config
This is caused by the fix for bug 381247. Backing out to the previous version (3.4) of include.c makes Mingw happy.
Mingw doesn't seem to recognise IS_DIR. I did some Googling, maybe S_ISDIR does work?
Blocks: 381247
Probably ... someone with a mingw build care to verify that?
Actually,

1) why is mingw building mkdepend? isn't it just using gcc -MD?

2) we should probably just change #ifdef _MSC_VER to some other #ifdef that is a general test for Windows. but I don't know if XP_WIN works in this context.
It seems that the fix for bug 381247 also breaks Solaris builds. The proposed patch there, using S_ISDIR instead of IS_DIR is indeed solving the Mingw bustage.

The patch looks like this, simple and effective:

Index: config/mkdepend/include.c
===================================================================
RCS file: /cvsroot/mozilla/config/mkdepend/include.c,v
retrieving revision 3.5
diff -u -p -8 -r3.5 include.c
--- config/mkdepend/include.c	23 May 2007 03:48:13 -0000	3.5
+++ config/mkdepend/include.c	23 May 2007 10:29:17 -0000
@@ -40,17 +40,17 @@ does_file_exist(char *file)
     return 0;
   return (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
 }
 #else
 static int
 does_file_exist(char *file)
 {
   struct stat sb;
-  return stat(file, &sb) == 0 && !IS_DIR(sb.st_mode);
+  return stat(file, &sb) == 0 && !S_ISDIR(sb.st_mode);
 }
 #endif
 
 extern struct	inclist	inclist[ MAXFILES ],
 			*inclistp, *inclistnext;
 extern char	*includedirs[ ],
 		**includedirsnext;
 extern char	*notdotdot[ ];
I have now also made a build (20070523, 13.00 UTC) with the patch above using the Mozilla Build Environment (Benjamin S) and VC8 Express. It works fine. 

I just realized that there just has been a check-in of include.c ver 3.6 for bug 381247. 

So this can be regarded as a duplicate to bug 381247 and consequently resolved. 
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.