Skip to content

Linux release builds fail with undefined symbol errors on rust 1.87 #142752

Open
@nathanwhit

Description

@nathanwhit

Summary

When attempting to update our project (deno) to 1.87.0, we hit new undefined symbol errors on linux release builds (failing CI run).

From debugging, it seems that it only occurs on linux when doing a full release build with fat LTO.

The errors are all from undefined symbols in the ring crate, and look like the following (also available in the linked CI run above):

note: ld.lld-20: error: undefined symbol: ring::pbkdf2::PBKDF2_HMAC_SHA1::h57847d34594a04c4
          >>> referenced by option.rs:0 (/rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/option.rs:0)
          >>>               /home/runner/work/deno/deno/target/release/deps/denort-e9bf5af81f044939.lto.denort-e9bf5af81f044939.denort.f9214744e9c94e5-cgu.0.rcgu.o:(tokio::runtime::task::raw::poll::hae1d648e9a03fa09)
          >>> referenced by option.rs:0 (/rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/option.rs:0)
          >>>               /home/runner/work/deno/deno/target/release/deps/denort-e9bf5af81f044939.lto.denort-e9bf5af81f044939.denort.f9214744e9c94e5-cgu.0.rcgu.o:(tokio::runtime::task::raw::poll::hae1d648e9a03fa09)
          >>> referenced by option.rs:0 (/rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/option.rs:0)
          >>>               /home/runner/work/deno/deno/target/release/deps/denort-e9bf5af81f044939.lto.denort-e9bf5af81f044939.denort.f9214744e9c94e5-cgu.0.rcgu.o:(tokio::runtime::task::raw::poll::hb26b9155d0fe261c)
          >>> referenced 1 more times
          clang-20: error: linker command failed with exit code 1 (use -v to see invocation)

I've attempted to get a smaller reproduction but haven't been able to, so unfortunately I only know for certain that it reproduces when building a release build of deno on linux.

You can reproduce it by cloning https://github.com/denoland/deno, then doing a release build, i.e.

cargo +1.87.0 build --release --bin denort

(you don't need the --bin flag, as it reproduces when building all binary targets, but it cuts down the compilation time a bit).


I've bisected this regression with cargo-bisect-rustc and it points to 2a06022 as the cause.

Version it worked on

It most recently worked on: Rust 1.86

Version with regression

Rust 1.87.0

rustc --version --verbose:

rustc 1.87.0 (17067e9ac 2025-05-09)
binary: rustc
commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
commit-date: 2025-05-09
host: x86_64-unknown-linux-gnu
release: 1.87.0
LLVM version: 20.1.1

The first nightly with the regression was nightly-2025-03-29.

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.P-highHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions