Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info to readme that libssl.so is required to exist in the library search path. #16

Open
Rotwang opened this issue Dec 30, 2015 · 0 comments

Comments

@Rotwang
Copy link
Contributor

Rotwang commented Dec 30, 2015

On ubuntu 15.10 by default openssl package pulls in libssl1.0.0 package which contains versioned libssl:

# dpkg -L libssl1.0.0 | grep libssl[.]so
/lib/x86_64-linux-gnu/libssl.so.1.0.0

Unfortuantely such library isn't fount by default by the dlopen (dlopen is used by dyncall library used by moar and nqp):

# cat t.c
#include <dlfcn.h>
#include <stdio.h>

int main (void) {
    printf("%p\n", dlopen("libssl.so", RTLD_LAZY));
    return 0;
}
# gcc -o t t.c  -ldl
# ./t
(nil)

Perl6 example:

$ perl6 --version
This is Rakudo version 2015.12-36-g64a61a3 built on MoarVM version 2015.12
implementing Perl 6.c.
$ cat t
#!/usr/bin/env perl6

use v6;
use NativeCall;

sub SSL_library_init() is native('ssl') { ... }
SSL_library_init();
$ perl6 t
NativeCall: Consider adding the api version of the library you want to use, sub foo is native(ssl, v1)
Cannot locate native library 'libssl.so': libssl.so: cannot open shared object file: No such file or directory
  in method setup at /home/ubuntu/.rakudobrew/moar-nom/install/share/perl6/sources/DA0980735978E745E73F676402B9B166FEBF3818 line 230
  in method CALL-ME at /home/ubuntu/.rakudobrew/moar-nom/install/share/perl6/sources/DA0980735978E745E73F676402B9B166FEBF3818 line 241
  in block <unit> at t line 7

When we pass version along with the library dlopen and NativeCall work properly:

# cat t.c
#include <dlfcn.h>
#include <stdio.h>

int main (void) {
    printf("%p\n", dlopen("libssl.so.1.0.0", RTLD_LAZY));
    return 0;
}
# gcc -o t t.c  -ldl
# ./t
0xe40040

Perl6 example:

$ cat t
#!/usr/bin/env perl6

use v6;
use NativeCall;

sub SSL_library_init() is native('ssl', v1.0.0) { ... }
SSL_library_init();
$ perl6 t
$ echo $?
0

However unversioned libssl resides in libssl-dev:

# dpkg -L libssl-dev | grep libssl[.]so
/usr/lib/x86_64-linux-gnu/libssl.so

I see two distinct reasonable ways to remedy headaches in the future:

  • Add information to the README file that unversioned libssl.so must be available in the library path.
  • Add logic to the module which finds proper library or allow user to specify the library himself.
niner added a commit to niner/openssl that referenced this issue Feb 3, 2020
We know that we support OpenSSL 1.1 and 1.0, so rather than hoping that
/usr/lib64/libssl.so points to a supported version, we should try those
first and fall back to the symlink later. This matches the dependency
stated in META6.json more closely.

Fixes GH sergot#16 and sergot#54 and sergot#59
niner added a commit to niner/openssl that referenced this issue Jun 29, 2020
We know that we support OpenSSL 1.1 and 1.0, so rather than hoping that
/usr/lib64/libssl.so points to a supported version, we should try those
first and fall back to the symlink later. This matches the dependency
stated in META6.json more closely.

Fixes GH sergot#16 and sergot#54 and sergot#59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant