Code Monkey home page Code Monkey logo

rust-openssl-cannot-link-statically's Introduction

rust-openssl-cannot-link-statically

This repository demonstrates rust-openssl cannot be statically linked with env OPENSSL_STATIC set in .cargo/config.toml under project root.

Summary

Related issues go as

The phenomenon is: any library which falls into /usr/lib/ won't be statically linked (which is basically all libraries found by pkg-config)

Prerequisite

  • openssl: 0.10.42

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

cargo build

3. Check linkage with ldd

ldd target/debug/rust-openssl-cannot-link-statically

Got output log as

        linux-vdso.so.1 (0x00007ffc00d2c000)
        libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007ff37e652000)
        libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007ff37e35e000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff37e358000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff37e33e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff37e31c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff37e147000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff37e745000)

where libssl.a and libcrypto.a should be used instead of libssl.so.1.1 and libcrypto.so.1.1.

rust-openssl-cannot-link-statically's People

Contributors

sammyne avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.