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

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

Open
frederikhors opened this issue Oct 4, 2024 · 7 comments

Comments

@frederikhors
Copy link

frederikhors commented Oct 4, 2024

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.

@frederikhors frederikhors changed the title openssl dynamic linking from Cross.toml needs at runtime libssl1.0.0 which doesn't exist anymore on Debian 12 openssl dynamic linking from Cross.toml needs at runtime libssl1.0.0 which doesn't exist anymore Oct 4, 2024
@thomas725
Copy link
Contributor

Having the same problem, target system has libssl1.1 & libssl3 available, but the cross build link's against 1.0.0.

I believe one way to workaround this would be to use a container that has one of those instead of the one used by default.

@frederikhors
Copy link
Author

Yeah. They are going to upgrade the Docker images soon. I hope.

@Emilgardis
Copy link
Member

Yes, this is planned!

@frederikhors
Copy link
Author

Ok. I think we can close this.

@Emilgardis
Copy link
Member

Reopening since it's not fixed yet

@Emilgardis Emilgardis reopened this Oct 19, 2024
@thomas725
Copy link
Contributor

Yeah. They are going to upgrade the Docker images soon. I hope.

Who are "they"? Is there an upstream project responsible for that? Where can I find the currently used docker container's definition?

@Emilgardis
Copy link
Member

The definitions live here: https://github.com/cross-rs/cross/tree/main/docker

"They" would be the maintainers of cross-rs, so for example me :)

I've made a remark here about upgrading https://redirect.github.com/cross-rs/cross/pull/973#issuecomment-2397886693

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