Skip to content

Adds world to the link path; bad neighbor #447

Closed
@lilith

Description

@lilith

As openssl-sys adds the world to the link path, it prevents linking against any libs that have a different version in /usr/lib

cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto

It appears that link path order is randomized by cargo, so this will cause nicely randomized link failures if other native crates are in use (or silently cause the wrong/unpatched version of a lib to be linked instead).

This can be fixed by producing the following output instead:

cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu/libssl*
cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu/libcrypto*
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions