[Python-Dev] MinGW And The other Py2.4 issue

A.B., Khalid abkhd at hotmail.com
Mon Dec 13 17:43:18 CET 2004

Paul Moore wrote:
>I tried this out, and from some basic uses, it seems to work OK.
>However, the PYD file references msvcrt.dll, which suggests that there
>will be issues in more complex cases. The biggest problem with CRT
>compatibility issues is that (AFAIK) no-one has actually been able to
>trigger a *real* error, all of the problems are still theoretical. I
>have done some fairly extensive analysis of what could go wrong, and I
>suspect that there are very few genuine cases where data from one CRT
>could end up being manipulated by another - but this doesn't mean that
>the problems aren't real, just VERY hard to locate :-(

First of all, thank you for your input. It is greatly appreciated. And
yes if Martin, for whom I have much respect, can help here, then that
would be awesome.

Okay. This is partly my own fault. I am not using a standard MinGW
distribution. This is why there is no release date in the sys.version
information of the Python I compiled. I am using GCC RC 3.4.1 but the
linking is still done by the 2002 MinGW 3.2, which is most probably hard-
wired to use msvcrt.dll. Having said that, however, let me quickly add
that it is almost a certainity that the newer standard MinGW
distributions link with the latest libraries.

Nevertheless, I updated pyMinGW's cygwinccompiler.py to always link in
with libmsvcr71, and rebuit the sample pymingw extension[1]. Now
according to objdump we get the following:


00007014       000070b0 00000000 00000000 00007420 00007158

        DLL Name: KERNEL32.dll
        vma:  Hint/Ord Member-Name Bound-To
        72fc        0  AddAtomA
        7308      147  FindAtomA
        7314      191  GetAtomNameA

00007028       000070c4 00000000 00000000 00007468 0000716c

        DLL Name: msvcr71.dll
        vma:  Hint/Ord Member-Name Bound-To
        7324       56  __dllonexit
        7334      189  _errno
        7340      610  ctime
        7348      619  fflush
        7354      630  fputs
        735c      634  free
        7364      642  fwrite
        7370      685  malloc
        737c      701  puts
        7384      724  strcmp
        7390      726  strcpy
        739c      730  strlen
        73a8      733  strncpy
        73b4      748  time

0000703c       00007104 00000000 00000000 00007478 000071ac

        DLL Name: msvcrt.dll
        vma:  Hint/Ord Member-Name Bound-To
        73bc      510  abort

00007050       00000000 00000000 00000000 00000000 00000000

There is an export table in .edata at 0x6000


So what see ye? :) Does it look good?

Best wishes

[1] pymingw-01.zip (5.37 KB):
Location: http://jove.prohosting.com/iwave/misc/pymingw-01.zip
MD5: 63b486093b344b0299538c952dea4ce1
Contents in KB:
PYMINGW  PY          1.115  13/12/04  16:12 pymingw.py
PYMINGW  I             278  13/12/04   1:00 pymingw.i
EXAMPLE  C             848  13/12/04   0:23 example.c
SETUP    PY            192  13/12/04   0:59 setup.py
_PYMINGW PYD         9.216  13/12/04  16:12 _pymingw.pyd

Don't just search. Find. Check out the new MSN Search! 

More information about the Python-Dev mailing list