Subject: Re: Run cross-compiled libssh2 win32 apps in wine?

Re: Run cross-compiled libssh2 win32 apps in wine?

From: Peter Stuge <peter_at_stuge.se>
Date: Sat, 30 Jan 2010 00:12:03 +0100

All good now.

Peter Stuge wrote:
> Now, since I don't have MD5 the crash is unsurprising. Let's see
> what I can do here.

Ok. With some of the pushed changes there's no more crash.

==================
All 2 tests passed
==================

..this is with libgcrypt which only has AES, SHA1, RSA and DSA.

With the last pushed commit to simplify ifdefs in direct_tcpip.c I
can build it standalone quite easily, both dynamically and
statically:

$ make
i686-mingw32-gcc -I../libssh2/include -o dyn-direct_tcpip.exe direct_tcpip.c -L../libssh2/lib -L../libgcrypt/lib -lssh2 -lws2_32
i686-mingw32-strip dyn-direct_tcpip.exe
i686-mingw32-gcc -static -I../libssh2/include -o static-direct_tcpip.exe direct_tcpip.c -L../libssh2/lib -L../libgcrypt/lib -lssh2 -lws2_32 -lgcrypt -lgpg-error
i686-mingw32-strip static-direct_tcpip.exe

This produces really good size executables:

$ ls -l *exe
-rwxr-xr-x 1 stuge stuge 9216 Jan 30 00:09 dyn-direct_tcpip.exe
-rwxr-xr-x 1 stuge stuge 399360 Jan 30 00:09 static-direct_tcpip.exe

And they pack with great results:

$ upx *exe
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2008
UPX 3.03 Markus Oberhumer, Laszlo Molnar & John Reiser Apr 27th 2008

        File size Ratio Format Name
   -------------------- ------ ----------- -----------
      9216 -> 5120 55.56% win32/pe dyn-direct_tcpip.exe
    399360 -> 152064 38.08% win32/pe static-direct_tcpip.exe
   -------------------- ------ ----------- -----------
    408576 -> 157184 38.47% [ 2 files ]

Packed 2 files.

(This particular example still doesn't run correctly on win32, I'm
looking into fixing that.)

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-30