[Python-Dev] windows 2.5 build: use OpenSSL for hashlib [bug 1535502]

Gregory P. Smith greg at electricrain.com
Tue Aug 8 02:21:07 CEST 2006


On Tue, Aug 08, 2006 at 01:46:13AM +0200, "Martin v. L?wis" wrote:
> Gregory P. Smith schrieb:
> > hashlib's OpenSSL implementation on windows comes in the form of a
> > 300k _hashlib.pyd library.
> 
> What do you mean by "comes"? I can't find any _hashlib.vcproj file
> inside the PCbuild directory.

I'll see about creating one later today when I'm reunited with my laptop.

> >> I believe that the performance of the OpenSSL routines depends on
> >> the way OpenSSL was built, e.g. whether the assembler implementations
> >> are used or not. Somebody would have to check, but I doubt they are.
> > 
> > That'd be unfortunate as that negatively impacts the socket _ssl
> > module as well.  OpenSSL should always be built with the assembler
> > implementations.
> 
> But Visual Studio doesn't ship with an assembler! So how could I
> build it?

yes it does.  Visual Studio comes with MASM (ml) and OpenSSL ships
with build scripts to use it.  See openssl's INSTALL.W32 file.  Also,
a free assembler (NASM) is available that OpenSSL is also capable of
building with if for some reason you don't have masm installed.

Looking into how the windows python build process works (honestly
something i've not looked at since 2.0) it appears that
PCbuild/build_ssl.py handles the compilation of OpenSSL..

I haven't tested this yet (I'll try it tonight) but I believe this
patch is all thats needed to enable the openssl assembly build:

--- build_ssl.py        (revision 51136)
+++ build_ssl.py        (working copy)
@@ -98,6 +98,8 @@
         if not cmd: break
         if cmd.strip()[:5].lower() == "nmake":
             continue
+        if re.match("set OPTS=no-asm", cmd):
+            continue
         temp_bat.write(cmd)
     in_bat.close()
     temp_bat.close()

Alternatively just modifying build_ssl.py to run "ms\do_masm.bat"
before it runs "nmake -f ms\32.mak" should work.

-g



More information about the Python-Dev mailing list