Skip to content

Failed to find symbols in linked external libraries on Linux #132023

Closed
@inflation

Description

@inflation

Code

Not sure if it's Rustc's problem or cargo's problem, but 1.82.0 failed to find symbols in external libraries when linking. This only happens on Linux, macOS works fine on the CI, and Windows works fine by testing locally.

git clone https://github.com/inflation/jpegxl-rs --recursive
cd jpegxl-rs
cargo test --all-features

inflation/jpegxl-rs#104

I expected to see this happen: links fine in testing

Instead, this happened: 1.82.0 failed to find symbols in libbrotlicommon.a

Linker commands related to external libraries:

"-Wl,--as-needed" "-Wl,-Bstatic" "-ljxl" "-ljxl_cms" "-ljxl_threads" "-lhwy" "-lbrotlicommon" "-lbrotlidec" "-lbrotlienc" "-Wl,-Bdynamic" "-lstdc++"

Version it worked on

It most recently worked on: 1.81.0

Version with regression

rustc --version --verbose:

rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions