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

libopensc.so not found when using non-default install prefix #2923

Closed
jclc opened this issue Nov 1, 2023 · 2 comments
Closed

libopensc.so not found when using non-default install prefix #2923

jclc opened this issue Nov 1, 2023 · 2 comments

Comments

@jclc
Copy link

jclc commented Nov 1, 2023

Problem Description

Building from source and installing with a non-default prefix such as /usr/local makes the binaries (at least pkcs11-tool) not link properly to the libopensc.so library. libopensc.so is properly installed to /usr/local/lib. Adding symbolic links to /usr/lib, /usr/lib64 and /usr/local/bin does not help.

Using the default prefix /usr works properly.

Tested on Rocky Linux 8

Proposed Resolution

Steps to reproduce

# ./configure --prefix=/usr/local --sysconfdir=/etc/opensc
# make
# make install

Logs

[root@machine opensc-0.23.0]# ldd /usr/local/bin/pkcs11-tool
        linux-vdso.so.1 (0x00007ffce3b27000)
        libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007fe8bab18000)
        libopensc.so.8 => not found
        libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fe8ba517000)
        libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fe8ba2f7000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007fe8b9f32000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x00007fe8b9d1a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe8bb002000)

(note: not the exact print since reconfiguring and rebuilding opensc cleared the terminal history, recreated from memory)

@dengert
Copy link
Member

dengert commented Nov 1, 2023

I regularly build OpenSC on against multiple versions of OpenSSL and set PREFIX=/opt/ossl-n.n.n and configure with --prefix=$PREFIX
But also set LDFLAGS="$LDFLAGS -Wl,-rpath,$PREFIX/lib" on linux. Other OS may use -R

Also do the same when building OpenSSL, libp11 and any other packages that are installed into these /opt directories.

@frankmorgner
Copy link
Member

use LD_LIBRARY_PATH=/usr/local/lib or edit your /etc/ld.so.conf accordingly

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

3 participants