Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 93f09fb1333c970ce05c94b192cf3bc698a38f24
Ticket: 3571241fffffffffffffffffffffffffffffffff
_USE_32BIT_TIME_T wrong for 32bit __MINGW32__
User & Date: earnie on 2012-09-25 19:25:40
Changes

  1. icomment:
    I downloaded the latest package 8.5.12.  I used the tcl package to test changes I am making to the MinGW.org mingwrt and w32api source before I distribute them.
    
    The problem is that _USE_32BIT_TIME_T is set explicitly in tclWinPort.h as delivered.  The functions enabled by _USE_32BIT_TIME_T do not exist in the MSVCRT.DLL.  _WIN64 doesn't have the functions at all so there is a guard to not define _USE_32BIT_TIME_T.  _WIN32 has the functions but only in a non-standard DLL.
    
    The problem occurs during linking with ld complaining about unresolved symbols for __localtime32, __mktime32 and __gmtime32.  They are unresolved because libmsvcrt.a does not contain the symbols.  These symbols are used based on _USE_32BIT_TIME_T in include/time.h when we create an alias function of localtime, mktime and gmtime respectively.
    
    Now, with the current release of w32api this may not have been an issue because there were some extra nonsense (IMO) guards which prevented the use of these symbols even when _USE_32BIT_TIME_T was enabled.  With MSVC it wouldn't cause an issue because the DLL used by it would contain these symbols.  It is an issue now for MinGW.org because the current repository code, which will soon be released, has the extra guards removed and has exposed the issue.  The issue is that MSVCRT.DLL does not contain the functions enabled by _USE_32BIT_TIME_T.
    
    
  2. login: "earnie"
  3. mimetype: "text/plain"
  4. username: "earnie"