[Ur] C FFI and openssl

Todd Roth toddjroth at gmail.com
Mon Jul 27 21:40:07 EDT 2015


Benjamin, Your suggestion to change the linker syntax worked!  It compiled after I changed the Crypt.urp file to the following:

ffi crypt
include crypt.h
link crypt.o -lcrypto -lssl

Thanks for your help,
Todd

> On Jul 26, 2015, at 6:26 PM, Benjamin Barenblat <bbaren at mit.edu> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Hi Todd,
> 
> I’m a bit rusty on linker syntax, but I _think_ that instead of
> 
>    gcc […] -lcrypto -lssl […]crypt.o
> 
> you want
> 
>    gcc […]crypt.o […] -lcrypto -lssl
> 
> The linker needs to see that crypt.o uses 'SHA256@@OPENSSL_1.0.0' so it
> can pull the appropriate symbol out of libcrypto.so, and it makes only
> one pass from left to right.
> 
> As an aside, I’ve written an FFI library [1] which looks like it does
> exactly what you want.  Naturally, you’re welcome to use it.
> 
> Best,
> Benjamin
> 
> [1] https://benjamin.barenblat.name/gitweb/?p=urweb-crypto-hash-openssl.git
> -----BEGIN PGP SIGNATURE-----
> 
> iQF8BAEBCgBmBQJVtV6WXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
> ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5OThCQjVEMTlDOEE3QjE3OUUwREFCODY5
> RTczMDE0OUVCOTFDNTNCAAoJEJ5zAUnrkcU7T3YH/3TDT5CzkcZDGW855a2HoVGz
> zlMe2B64dfMMecNHitW09Pxl49bdUCsVXruH+0hVuapHLRFUMDkfgr0IZgG/aL6j
> +HUZmgJhpbqZ4oi5M3pA64cwg/2qGFBYbLKd3HA0HIoEvFkyEgqk8glWdcdg77hw
> 33+AVguRXKBCgGuI7hnpj5KZXpSoH94lOjD7veKKcPfG7kTa2FoFATp2eDsupxAd
> j7JkfehvTy3IyE2wictoBmojbMdfj6/9Cf4E73fL987GDeLqEjfkEHxi7DxJQZTk
> eNZhoNFSG54OkJx++hNPHi4OGbKxLV+cakrY/H4lqvx/tDrkLlXYi57qmq949no=
> =CWCh
> -----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150727/2edde824/attachment.html>


More information about the Ur mailing list