You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you specify OPENSSL_STATIC, you need to include OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR if you want to avoid the pkg-config behavior. When you specify OPENSSL_LIB_DIR you need to give it the directory with the *.a files. Other search results may say to use /usr/lib or /usr/lib64 but for example on ubuntu 22.04 it should be /usr/lib/x86_64-linux-gnu.
Problem
It seems that rust-openssl cannot be statically linked with env
OPENSSL_STATIC
set in .cargo/config.toml under project root.Prerequisite
For reproduction, a github repo has been made as https://github.com/sammyne/rust-openssl-cannot-link-statically, and steps for reproductions go as follow.
Reproduction
1. Start the container as building env
docker run -it --rm \ -v $PWD:/workspace \ -w /workspace \ rust:1.65.0-bullseye \ bash
2. Build the project within the started container
3. Check linkage with ldd
Got output log as
where libssl.a and libcrypto.a should be used instead of libssl.so.1.1 and libcrypto.so.1.1.
Really appreciate if someone could help me out~
The text was updated successfully, but these errors were encountered: