dependency to openssl

Dirk Hohndel dirk at hohndel.org
Fri Feb 15 20:00:48 PST 2013


Linus Torvalds <torvalds at linux-foundation.org> writes:

> On Fri, Feb 15, 2013 at 4:53 PM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>>
>> Just copy the two files in git/block-sha1, and then replace
>> "SHA1_init()" with "blk_SHA1_init()" etc. The silly thing is optimized
>> C - to the point that it actually beats the openssl hand-runed
>> assembler version on most CPUs.
>
> Ok, I just sent a patch. It's entirely untested, but it compiles, so
> it must be perfect.

Thank you for that. It compiles indeed on Linux and Mac so it /IS/
perfect. I made it work for Windows as well, just in case (actually, I
made it work for cross compiled Windows - I'm sure Lubomir will yell if
it still fails on native Windows).

> People should double-check that the headers (for memcpy and for the
> htonl() stuff) are sufficient for OSX and Windows, but the code itself
> is what git uses, so it shouldn't really have any real portability
> gotchas. But our header files are a bit different from the git ones,
> as is obviously our build environment, so it's possible that there is
> some "Windows needs xyz.h in order to use <arpa/inet.h>". I wrote the
> git code, but others handled the Windows oddities.

arpa/inet.g is instead replaced by winsock2.h - and then linking against
-lwsock32 gets you htonl()

/D


More information about the subsurface mailing list