From: SourceForge.net <no...@so...> - 2009-03-02 08:56:56
|
Bugs item #2651823, was opened at 2009-03-01 13:49 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2651823&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 53. Configuration and Build Tools >Group: current: 8.5.6 Status: Open Resolution: None >Priority: 9 Private: No Submitted By: Fausto Lubatti (lubatti) Assigned to: Mo DeJong (mdejong) Summary: Tcl_StatBuf definition problem with VS2005 and Win XP x64 Initial Comment: TCL version 8.5.6 I found a problem when trying to build TCL version 8.5.6 using Visual Studio 2005 SP1 on a AMD64 machine with Windows XP Professional x64 edition. I'm not able to compile, since when I give the command: nmake -nologo -b -f makefile.vc MACHINE=AMD64 release I get the following error (see file error.log): NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\amd64\cl.EXE"' : return code '0x2' during compilation I noticed the following unrecoverable error (see file run.log): ..\generic\tclCmdAH.c(818) : error C2079: 'buf' uses undefined struct '_stati64' ..\generic\tclEncoding.c(3522) : error C2079: 'stat' uses undefined struct '_stati64' ..\generic\tclFCmd.c(113) : error C2079: 'statBuf' uses undefined struct '_stati64' ..\generic\tclFCmd.c(229) : error C2079: 'statBuf' uses undefined struct '_stati64' ..\generic\tclFCmd.c(365) : error C2079: 'statBuf' uses undefined struct '_stati64' ..\generic\tclFCmd.c(489) : error C2079: 'sourceStatBuf' uses undefined struct '_stati64' ..\generic\tclFCmd.c(489) : error C2079: 'targetStatBuf' uses undefined struct '_stati64' ..\generic\tclFileName.c(2525) : error C2027: use of undefined type '_stati64' d:\fausto\tcl_tk_8.5.6\tcl8.5.6\generic\tcl.h(372) : see declaration of '_stati64' ..\generic\tclIOUtil.c(68) : error C2079: 'buf' uses undefined struct '_stati64' ..\generic\tclIOUtil.c(1748) : error C2079: 'statBuf' uses undefined struct '_stati64' ..\generic\tclIOUtil.c(2886) : error C2079: 'buf' uses undefined struct '_stati64' ..\generic\tclIOUtil.c(4130) : error C2079: 'sourceStatBuf' uses undefined struct '_stati64' All those structure refer to tyoe Tcl_StatBuf which is defined in the tcl.h, so I revert to this file. So I looked ot the file tcl.h in the generic dirctory of tcl sources and look at the original definition, which I report here: # if _MSC_VER < 1400 || !defined(_M_IX86) typedef struct _stati64 Tcl_StatBuf; # else typedef struct _stat64 Tcl_StatBuf; # endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # endif /* __BORLANDC__ */ It looks like that if you are using a version less than Vs 2005 or you are not building for a X86 (like I am) machine, I get the definition typedef struct _stati64 Tcl_StatBuf; which is not good for the compiler. I changed the test with a slightly different version: # if _MSC_VER >= 1400 && defined(_M_X64) typedef struct _stat64 Tcl_StatBuf; # elif _MSC_VER < 1400 || !defined(_M_IX86) typedef struct _stati64 Tcl_StatBuf; # else typedef struct _stat64 Tcl_StatBuf; # endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # endif /* __BORLANDC__ */ so on my machine (AMD64) and building for an AMD64 with VS 2005 I get the following definition: typedef struct _stat64 Tcl_StatBuf; The modification to the if statement will leave the original definitions for versions less than VS 2500, that I presume was the intent of the original statement, and also leaves the original definition when building on Windows XP Professional Edition for X86 (32 bit version). As a general suggestion, I would change that statement, and rather than testing _M_IX86 and _M_X64, which identify the specific processor, and probably is not pertinent too much with the definition of Tcl_statBuf, i would use the variable _WIN64 which identify if you are building wor a win32 or win64 system, leaving the alternatuve definition only for old Visual Studio version that build for win64 (if ever supported...) # if _MSC_VER < 1400 && defined(_WIN64) typedef struct _stati64 Tcl_StatBuf; # else typedef struct _stat64 Tcl_StatBuf; # endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # endif /* __BORLANDC__ */ I have no other Visual Studio versions, or other machines to see if this works also on higher version of Visual Studio, or different machine architecture. I attach the following files: make_amd64.bat (the bat that I use to rebuild on Windows XP x64 for the AMD64 target machine using Visual Studio 2005 SP1) make_win32.bat (the bat that I use to rebuild on Windows XP for the win32 target machine using Visual Studio 2005 SP1) run.log (the log file produced when building on the x64 machine using AMD64 as the target machine) error.log (the error log file produced when building on the x64 machine using AMD64 as the target machine) tcl.h (the tcl.h file that build correctly both on x64 and on win32 machine) tcl_original.h (the original 8.5.6 distribuited tcl.h file that fails on x64 builds correctly on win32 machine) Hope this helps. Regards Fausto Lubatti fau...@po... ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2009-03-02 08:56 Message: Thanks for the submission of the right gunk for that particular compiler/platform. Prio9 so it is flagged to be dealt with in next release ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2651823&group_id=10894 |