Hello,
I’ve tried to compile my project on Linux and it works great, however I have problems on OpenBSD.
The default crypto library is LibreSSL and I had to use pkg_add openssl to install OpenSSL. Fine.
Now, I try to compile my project and it doesn’t work, I guess because the OpenSSL library isn’t in the usual folder, headers are in /usr/local/include/eopenssl40/ and the library is in/usr/local/lib/eopenssl40.
But I can’t get it to work even when using shards build myprogramm -- --linker-flags='-L /usr/local/lib/eopenssl40 -lssl -lcrypto'. I still get this error:
test$ shards build authd --link-flags='-I/usr/local/include/eopenssl40/ -L/usr/local/lib/eopenssl40/ -lssl -lcrypto'
Dependencies are satisfied
Building: authd
Error target authd failed to compile:
Showing last frame. Use --error-trace for full trace.
There was a problem expanding macro 'macro_10576938180752'
Code in lib/openssl_ext/src/openssl_ext/bio/bio.cr:10:5
10 | {% if OpenSSL::BIO.has_method?(:ktls_recv?) %}
^
Called macro defined in lib/openssl_ext/src/openssl_ext/bio/bio.cr:10:5
10 | {% if OpenSSL::BIO.has_method?(:ktls_recv?) %}
Which expanded to:
1 |
> 2 | Box(IO).unbox(LibCrypto.BIO_get_data(bio))
^-----------
Error: undefined fun 'BIO_get_data' for LibCrypto
The problem comes from the openssl_ext library (used by crystal-community/jwt).
I really don’t know what to do at this point. I can write anything in the --link-flags= parameter, it changes absolutely nothing. But I know that the library is in /usr/local/lib/eopenssl40/ :
test$ nm -g /usr/local/lib/eopenssl40/libcrypto.so.45.0 | grep BIO_get_data
00251b10 T BIO_get_data
Thanks for your help.