Skip to content

openssl dynamic linking from Cross.toml needs at runtime libssl1.0.0 which doesn't exist anymore #1567

@frederikhors

Description

@frederikhors

In my project I need to use openssl not for the HTTP part of my app but because I need to decode a PKCS7 file.

I added to my Cargo.toml:

openssl = { version = "0.10.66", default-features = false }

and to Cross.toml:

[target.aarch64-unknown-linux-gnu]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH",
]

When I launch cross it builds but when the --release executable runs on Debian 12 machine with openssl installed the error is:

error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

Why is it binded to libssl.so.1.0.0 and not to latest versions?

The openssl installed on the machine is:

openssl version -a
OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
built on: Sun Sep  1 14:59:10 2024 UTC
platform: debian-arm64
options:  bn(64,64)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -fzero-call-used-regs=used-gpr -DOPENSSL_TLS_SECURITY_LEVEL=2 -Wa,--noexecstack -g -O2 -ffile-prefix-map=/build/reproducible-path/openssl-3.0.14=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/aarch64-linux-gnu/engines-3"
MODULESDIR: "/usr/lib/aarch64-linux-gnu/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_armcap=0xbd

If I use ldd I get this:

ldd executable
    linux-vdso.so.1 (0x0000ffffb51f0000)
    libssl.so.1.0.0 => not found
    libcrypto.so.1.0.0 => not found
    libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffffb3fe0000)
    libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffffb3fb0000)
    libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffffb3f10000)
    libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffffb3ee0000)
    libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffb3d30000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffffb51b3000)

Thank you all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions