[Python-Dev] Re: Switching to VC.NET 2003

Paul Moore pf_moore at yahoo.co.uk
Sun Jan 4 09:57:57 EST 2004

"Martin v. Loewis" <martin at v.loewis.de> writes:

> Paul Moore wrote:
>> I don't know if Martin has already done this, but it needs doing. I'm
>> not a distutils expert, but I am willing to look at it in the longer
>> term.
> I haven't changed any Python file at all in the process of compiling
> with VC 7.1. However, Python (since 2.3) indicates the compiler used
> to build it in sys.version; I believe this could be used as an
> indication to find out whether it was build with VC6 or VC7.1 (dunno
> whether it could also tell apart 7.0 and 7.1).

I have a patch which seems to do the right thing with respect to
adding "-lmsvcr71" to the GCC link command.

The resulting build looks OK, and building a simple extension works
fine. Apparently, however, Phillip J. Eby got a working DLL without
needing this. And indeed I have no problems omitting the -lmsvcr71. So
we don't have a real example of the "potential issue" with mismatched
MSVC runtimes. Nevertheless, if you do "objdump -p myext.pyd" and look
at the import tables, you do see that runtime symbols are satisfied
from msvcrt without the -l flag, and from msvcr71 with it (apart from
abort, which is always from msvcrt, which seems to be a peculiarity of
how the mingw startup code is linked).

I've uploaded it to SourceForge (http://www.python.org/sf/870382) and
assigned it to you. I hope that's OK.


More information about the Python-Dev mailing list